Jump to content

Pop Instance Path VEXpression question?


Recommended Posts

I have a FBX I imported from maya that contains multiple (more than 50) object level nodes called "objectname" + "number" like "debrispieces_01", inside that is a file node with the same name. If I say in the Pop instance vexpression

" float randinst = fit01(rand(@id), 0, 50); 

if( randinst == 1) { popinstancepath = "../../"objectname" + "number"/"file1"/"debrispieces_01"};




I want to do this, but don't want to type this 50 times. Could I put this into some sort of array? Maybe do some python scripting? 


Thanks guys!


Edited by Tyfx567
Link to comment
Share on other sites

Figured it out. I can either do an attribute create node above the particles if the points already exist and say "


op:/obj/FBX/geo`floor(fit01(rand($PT), 1,4))`/sphere`floor(fit01(rand($PT),1,4))` "


Or in the pop instance node I can say this:

float randinst = floor(fit01(rand(@id), 1,4));
instancepath = "op:/obj/FBX/geo" + sprintf("%s", randinst) + "/sphere" + sprintf("%s", randinst);
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...