Skip to content

Commit

Permalink
PrimitiveTransform-clone-when-input-is-prim
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Jan 3, 2024
1 parent 370b207 commit 22e40c1
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 22e40c1

Please sign in to comment.