Jump to content

Quick scripting question...


Recommended Posts

Hi guys, I couldnt figure out something, need your help.


So I want to pre scale individual primitives with foreach sop before generating the voronoi fracturing (it is a wood mesh). The classic work flow, scale it down so can get the splinter look when you scale it back after the fracturing. So I just want to make sure I control pre scale the each individual piece by their longest side.


Thats kinda it, I ve been trying to do it with vopsop and attrwrangle but I just couldnt make it work correctly. 


I would much appreciate some help. 




I was going for this kinda solution. Change the name of the string that I might use to scale, and compare the each axis with each other.. but again if you guys know a better way, Im ready to learn.

s@mysizeName = "X";

if ( v@sizeAttr.z > v@sizeAttr.x ||v@sizeAttr.z >v@sizeAttr.y)
    s@mysizeName = "Z";
s@mysizeName = s@mysizeName;

if (v@sizeAttr.x >v@sizeAttr.y ||v@sizeAttr.x >v@sizeAttr.z)
    s@mysizeName = "X";
s@mysizeName = s@mysizeName;

if (v@sizeAttr.y >v@sizeAttr.x ||v@sizeAttr.y >v@sizeAttr.z)
    s@mysizeName = "Y";
s@mysizeName = s@mysizeName;
Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...