diff --git a/translator/writer/write_arnold_type.cpp b/translator/writer/write_arnold_type.cpp index 2b4e07796e..506e79d7dc 100644 --- a/translator/writer/write_arnold_type.cpp +++ b/translator/writer/write_arnold_type.cpp @@ -48,11 +48,6 @@ void UsdArnoldWriteArnoldType::Write(const AtNode *node, UsdArnoldWriter &writer UsdStageRefPtr stage = writer.GetUsdStage(); // get the current stage defined in the writer SdfPath objPath(nodeName); - UsdPrim prim = stage->GetPrimAtPath(objPath); - if (prim && prim.IsActive()) { - // This primitive was already written, let's early out - return; - } const AtNodeEntry *nodeEntry = AiNodeGetNodeEntry(node); int nodeEntryType = AiNodeEntryGetType(nodeEntry); bool isXformable = (nodeEntryType == AI_NODE_SHAPE @@ -60,7 +55,8 @@ void UsdArnoldWriteArnoldType::Write(const AtNode *node, UsdArnoldWriter &writer if (isXformable) writer.CreateHierarchy(objPath); - prim = stage->DefinePrim(objPath, TfToken(_usdName)); + + UsdPrim prim = stage->DefinePrim(objPath, TfToken(_usdName)); // For arnold nodes that have a transform matrix, we read it as in a // UsdGeomXformable @@ -150,13 +146,8 @@ void UsdArnoldWriteGinstance::Write(const AtNode *node, UsdArnoldWriter &writer) UsdStageRefPtr stage = writer.GetUsdStage(); // get the current stage defined in the writer SdfPath objPath(nodeName); - UsdPrim prim = stage->GetPrimAtPath(objPath); - if (prim && prim.IsActive()) { - // This primitive was already written, let's early out - return; - } writer.CreateHierarchy(objPath); - prim = stage->DefinePrim(objPath, TfToken(_usdName)); + UsdPrim prim = stage->DefinePrim(objPath, TfToken(_usdName)); AtNode *target = (AtNode *)AiNodeGetPtr(node, "node"); if (target) { diff --git a/translator/writer/write_geometry.cpp b/translator/writer/write_geometry.cpp index 4912694705..e127b5853e 100644 --- a/translator/writer/write_geometry.cpp +++ b/translator/writer/write_geometry.cpp @@ -287,14 +287,9 @@ void UsdArnoldWriteProceduralCustom::Write(const AtNode *node, UsdArnoldWriter & SdfPath objPath(nodeName); _exportedAttrs.insert("name"); - UsdPrim prim = stage->GetPrimAtPath(objPath); - if (prim && prim.IsActive()) { - // This primitive was already written, let's early out - return; - } // All custom procedurals are written as ArnoldProceduralCustom schema writer.CreateHierarchy(objPath); - prim = stage->DefinePrim(objPath, TfToken("ArnoldProceduralCustom")); + UsdPrim prim = stage->DefinePrim(objPath, TfToken("ArnoldProceduralCustom")); // Set the procedural node entry name as an attribute "arnold:node_entry" UsdAttribute nodeTypeAttr = prim.CreateAttribute(TfToken("arnold:node_entry"), SdfValueTypeNames->String, false);