Skip to content

Commit 871e83d

Browse files
committed
- Delayed the call to UpdateGenericPropertiesAttributes() when creating Static Meshes
after the collisions have been handled. This ensures that the created meshes have a valid BodySetup when updating the generic attributes and ensures that certain generic attributes/properties dont get overwritten by the collisions processing (ie, CollisionTraceFlag)
1 parent 1580240 commit 871e83d

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

Source/HoudiniEngine/Private/HoudiniMeshTranslator.cpp

+18-17
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,8 @@ FHoudiniMeshTranslator::CreateStaticMeshFromHoudiniGeoPartObject(
17661766
OutOutputObjects = InOutputObjects;
17671767
return true;
17681768
}
1769-
1769+
1770+
// Create a new mesh translator to handle the output data creation
17701771
FHoudiniMeshTranslator CurrentTranslator;
17711772
CurrentTranslator.ForceRebuild = InForceRebuild;
17721773
CurrentTranslator.SetHoudiniGeoPartObject(InHGPO);
@@ -5942,22 +5943,6 @@ FHoudiniMeshTranslator::CreateStaticMesh_MeshDescription()
59425943
continue;
59435944

59445945
const FHoudiniOutputObjectIdentifier& CurrentObjId = Current.Key;
5945-
// Update property attributes on the SM
5946-
TArray<FHoudiniGenericAttribute> PropertyAttributes;
5947-
if (FHoudiniEngineUtils::GetGenericPropertiesAttributes(
5948-
CurrentObjId.GeoId,
5949-
CurrentObjId.PartId,
5950-
true,
5951-
CurrentObjId.PrimitiveIndex,
5952-
INDEX_NONE,
5953-
CurrentObjId.PointIndex,
5954-
PropertyAttributes))
5955-
{
5956-
// Defer post edit change calls until after all property values have been set, since the static mesh
5957-
// build function is called from PostEditChangeProperty.
5958-
constexpr bool bDeferPostEditChangePropertyCalls = true;
5959-
FHoudiniEngineUtils::UpdateGenericPropertiesAttributes(SM, PropertyAttributes, 0, bDeferPostEditChangePropertyCalls);
5960-
}
59615946

59625947
UBodySetup * BodySetup = SM->GetBodySetup();
59635948
if (!BodySetup)
@@ -6064,6 +6049,22 @@ FHoudiniMeshTranslator::CreateStaticMesh_MeshDescription()
60646049
MainBodySetup->CollisionTraceFlag = MainStaticMeshCTF;
60656050
}
60666051

6052+
// Update property attributes on the SM
6053+
TArray<FHoudiniGenericAttribute> PropertyAttributes;
6054+
if (FHoudiniEngineUtils::GetGenericPropertiesAttributes(
6055+
CurrentObjId.GeoId,
6056+
CurrentObjId.PartId,
6057+
true,
6058+
CurrentObjId.PrimitiveIndex,
6059+
INDEX_NONE,
6060+
CurrentObjId.PointIndex,
6061+
PropertyAttributes))
6062+
{
6063+
// Defer post edit change calls until after all property values have been set, since the static mesh
6064+
// build function is called from PostEditChangeProperty.
6065+
constexpr bool bDeferPostEditChangePropertyCalls = true;
6066+
FHoudiniEngineUtils::UpdateGenericPropertiesAttributes(SM, PropertyAttributes, 0, bDeferPostEditChangePropertyCalls);
6067+
}
60676068

60686069
if (bDoTiming)
60696070
{

0 commit comments

Comments
 (0)