Skip to content

Commit

Permalink
Merge pull request #1684 from zenustech/PrimitiveTransform-clone-when…
Browse files Browse the repository at this point in the history
…-input-is-prim

PrimitiveTransform-clone-when-input-is-prim
  • Loading branch information
legobadman authored Jan 4, 2024
2 parents 91af8ef + 22e40c1 commit df15ca0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions zeno/src/nodes/prim/TransformPrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,16 @@ struct PrimitiveTransform : zeno::INode {
auto path = get_input2<std::string>("path");

std::string pivotType = get_input2<std::string>("pivot");
auto select = get_from_list(path, iObject);
if (select.has_value()) {
transformObj(select.value(), matrix, pivotType, translate, rotation, scaling);

if (std::dynamic_pointer_cast<PrimitiveObject>(iObject)) {
iObject = iObject->clone();
transformObj(iObject, matrix, pivotType, translate, rotation, scaling);
}
else {
auto select = get_from_list(path, iObject);
if (select.has_value()) {
transformObj(select.value(), matrix, pivotType, translate, rotation, scaling);
}
}

set_output("outPrim", std::move(iObject));
Expand Down

0 comments on commit df15ca0

Please sign in to comment.