How to move/translate primitives by attributes to World XYZ = 0

Recommended Posts

Good day everyone!
I been stuck for a while with a simple task, such as to move all of primitives, which has attribute "class" (cause primitives separated from each other threw "connectivity" node for later use as pseudo group) to World Coordinates XYZ = 0, 0, 0.

Does anybody know how to solve that? Especially helpfull will be solution threw SOP nodes or VOP nodes. VEX welcome as usual, but can this problem be solved without scripting by the same time?
Thanks

Edited by GreenAvoy

Share on other sites

Okay - I solved it. Thing is that you need to use third input of "Transform Pieces" node. First input for that do you want to transform (it could be multiply objects). Second input - points, to where you need to relocate your staff from 1st input. And third input I used to move all of my primitives (which I use for 1st input) to locate at the points of third input.
Pic is attached:

Share on other sites

simplest way is probably to pack the geo and attribwrangle @P = {0,0,0};

edit: another way without VEX and packing could be to loop over prims by "class" and in the loop a simple transform with -\$CEX, -\$CEY, -\$CEZ as transform and \$CEX, \$CEY, \$CEZ as pivot

Edited by 3dome

Share on other sites
7 minutes ago, 3dome said:

simplest way is probably to pack the geo and attribwrangle @P = {0,0,0};

edit: another way without VEX and packing could be to loop over prims by "class" and in the loop a simple transform with -\$CEX, -\$CEY, -\$CEZ as transform and \$CEX, \$CEY, \$CEZ as pivot

Unfortunately I found that with VEX at the current moment I cannot deal at all. Even with expressions. Everything except nodes gives me really hard to understand. I can only copy-past any code. That's why I try to avoid VEX but using only nodes (VOP). Trust me - it's a nightmare...