Search - User list
Full Version: Passing parameter inside a loop
Root » Houdini Indie and Apprentice » Passing parameter inside a loop
tosiho19
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
tosiho19
anyone?
jsmack
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.
tosiho19
ok thanks for the clarification!
old_school
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:

prim("../transform2", 0, "PR", 0)
or
prim(opinputpath("."), 0, "PR", 0)
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB