Guest Jim_M Posted August 6, 2018 Share Posted August 6, 2018 Ok so just when I thought I had got my head around for each loops, I am struggling to get a custom attribute into a transform. The attribute is certainly seen by the copy to points node. and when I try to detail it in the transform, it justs gives back a zero. I've tried by including the transform in the for each loop, with a block begin fetch input etc. Makes no difference. (Using the spare input and -1 tag instead of the "../iteration". I've tried all combinations of cases @ signs, $ signs and whatever else. The "global attributes" colour and the scale nodes work fine. effector_v003.hip Quote Link to comment Share on other sites More sharing options...
3dome Posted August 6, 2018 Share Posted August 6, 2018 there is no attrib called effector on the detail level, thats why it's not working use point() function and point it to repeat_begin effector_v004.hip Quote Link to comment Share on other sites More sharing options...
Guest Jim_M Posted August 6, 2018 Share Posted August 6, 2018 (edited) 3Dome, thank you very much indeed. Of course. detail = detail. I am idoit. All is clear(er). I don't know why I thought I needed to reference iterations. I think it's because I was previously creating geometry and scaling each iteration, and I just got confused. And if you were working on primitive attributes you would use prim(surface_node, prim_num, attrib_name, attrib_index) So the point number is obviously 0 as there is only one box coming in, and its just referencing the incoming transform (& attribute) in the copyToPoints node for each copy based on the templated points? And if I wanted to use a 3 value float Attribute for scale, instead of a transform sop I would use a point vop and somehow get the attribute inside that? Any idea why using the pack option on the copyToPoints node loses the colour attribute? Many thanks, Jim Edited August 6, 2018 by Jim_M Quote Link to comment Share on other sites More sharing options...
3dome Posted August 6, 2018 Share Posted August 6, 2018 2 hours ago, Jim_M said: So the point number is obviously 0 as there is only one box coming in, and its just referencing the incoming transform (& attribute) in the copyToPoints node for each copy based on the templated points? No. The point number is 0 because the loop runs over each point of the grid, so for each iteration there is only 1 point => ptnum = 0 That point has your effector attribute, which is read by the point()-expression in the transform SOP to modify the box size. Then it gets copied onto the current point's position. Iteration done. Next iteration: same process but new point => different effector value, different position to copy the box to. After the loop has run through all points of the grid, it outputs the merged boxes as the result. 2 hours ago, Jim_M said: And if I wanted to use a 3 value float Attribute for scale, instead of a transform sop I would use a point vop and somehow get the attribute inside that? You can still use the transform for that. If you have a vector attrib called effector just change the attrib_index in the point expression to 1=y and 2=z 2 hours ago, Jim_M said: Any idea why using the pack option on the copyToPoints node loses the colour attribute? In 16.5.536 when I tick on Pack and Instance it keeps the color. Previous version had some "issues" with displaying packed color, apparently SideFX now made some changes. Anyway, if you unpack your stuff later the color attrib should be back. Quote Link to comment Share on other sites More sharing options...
Guest Jim_M Posted August 6, 2018 Share Posted August 6, 2018 Thanks for the clarity, that does help a lot. 1 hour ago, 3dome said: You can still use the transform for that. If you have a vector attrib called effector just change the attrib_index in the point expression to 1=y and 2=z Ahhhhh of course. Great. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.