Hi,
How can you pass parameter inside a loop? For some reason the parameter exists inside the loop but doesn't affect the geometry.
thx
Passing parameter inside a loop
1921 4 1- tosiho19
- Member
- 46 posts
- Joined: Oct. 2019
- Offline
- tosiho19
- Member
- 46 posts
- Joined: Oct. 2019
- Offline
- jsmack
- Member
- 7659 posts
- Joined: Sept. 2011
- Online
You can't do that with a transform sop. Referencing a local variable/attribute in that way would mean that the node evaluates differently per element, which the transform sop does not.
To apply a different transform per point use a point wrangle/vop/expression node. To vary it per primitive use a primitive sop. Alternatively, use one of those nodes, or other nodes to create a transform attribute, (one of matrix, matrix3, quaternion, vector,) and use the transform by attribute sop to apply a varying transformation across multiple points.
For global (detail) attributes, use the detail() expression in the parameter of the transform sop.
To apply a different transform per point use a point wrangle/vop/expression node. To vary it per primitive use a primitive sop. Alternatively, use one of those nodes, or other nodes to create a transform attribute, (one of matrix, matrix3, quaternion, vector,) and use the transform by attribute sop to apply a varying transformation across multiple points.
For global (detail) attributes, use the detail() expression in the parameter of the transform sop.
- tosiho19
- Member
- 46 posts
- Joined: Oct. 2019
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
If you want to use the Transform SOP as is, and you have no desire to make this into a compile block, the easier thing is to just replace the trivial @PR with:
or
for tagging the input SOP generically.
The prim() expression is an old school method to fetch an attribute based on a specific index. Since all the prims have the same value inside the subnet you can use 0 or the first primitive value.
To make it compile safe, use an attrib wrangle as jsmack indicated above.
prim("../transform2", 0, "PR", 0)
prim(opinputpath("."), 0, "PR", 0)
The prim() expression is an old school method to fetch an attribute based on a specific index. Since all the prims have the same value inside the subnet you can use 0 or the first primitive value.
To make it compile safe, use an attrib wrangle as jsmack indicated above.
Edited by old_school - Nov. 23, 2020 13:29:55
There's at least one school like the old school!
-
- Quick Links