How to read point attrs in MOPs Transform Modifier's vexpression?

Ask questions about how to achieve specific effects, how to work with certain operators, etc.
Post Reply
surf3d
Posts: 2
Joined: Wed Jun 22, 2022 11:19 am

How to read point attrs in MOPs Transform Modifier's vexpression?

Post by surf3d »

Hello!
I have two MOPs Instancers merged together. The instances have an attribute set to -1 and 1 to make them translate in opposite directions. I haven't forgot to transfer the attr to instances and I see it set up correctly. It seems like I can't make the MOPs Transform Modifier's read this attribute from points in the vexpression section. I try this vexpression:
translate *= set(i@dir, 0, 0);
Should it work or I do something wrong?

User avatar
toadstorm
Site Admin
Posts: 117
Joined: Sun Sep 22, 2019 1:28 pm

Re: How to read point attrs in MOPs Transform Modifier's vexpression?

Post by toadstorm »

Without having Houdini in front of me, there's one thing I'd check for.

Since you mentioned you merged two Instancers together... you'll probably need to regenerate the i@id attribute to prevent duplicates. You can use the Enumerate SOP or a point wrangle with the expression i@id=@ptnum to do this. Otherwise, having duplicate id values can cause some pretty weird results.

If that doesn't work, could you please attach an example file demonstrating the problem?

surf3d
Posts: 2
Joined: Wed Jun 22, 2022 11:19 am

Re: How to read point attrs in MOPs Transform Modifier's vexpression?

Post by surf3d »

Thank you so much! You were right, it was the duplicating "id" thing!

Post Reply