Individual value in "For Loop" Vop

   3099   3   2
User Avatar
Member
19 posts
Joined: 9月 2011
Offline
Hi,

I am trying to set parameter inside “For Loop Vop” as an individual value. I think it might connect to Folder List. What I want to do is that number of lists connects to loop times and the parameters inside the folder directory connect to parameters inside For Loop.

I know how to do it with “For Each Sop”. For Each has stamp(“..”, “FORVALUE”,0) and we can set it can be used in expression. But For Loop.

It's bit hard to explain so maybe it's better to see the image

Thanks,
Ryoji

Attachments:
forLoopVop.jpg (273.7 KB)

User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
this is definitely an interesting one

so the part that is tricky here is that you are trying to tie a multiparm parameter to an actual vex variable (in essence, creating new variables for every loop operation).

This is totally untested, but what about not using a multiparm folder and instead use an actual int slider for your forLoop iterations, then create the parameter each time with an expression that (somehow) uses the iteration number to create a new parameter/variable?

alternatively, you can also use the multiparm attribute as parameters, and drive the value underneath with expressions that somehow look into the forLoop iteration (i.e. the iteration passed as a variable to something that can then be parsed via a standard expression)

this is definitely tricky, but I bet not impossible you could perhaps also do it by passing a point cloud as the second input with a point for each iteration, and the iteration value on each point (the point cloud can be created by an add sop tied to a multiparm in the standard sop methods, then parsed in vops in a more vex like mode)
-G
User Avatar
Member
8637 posts
Joined: 7月 2007
Offline
it's quite straightforward
no need for intermediate parameters
just use ch() function to get count and the values from multiparm

Attachments:
for_vop_and_multiparm.hip (86.8 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
19 posts
Joined: 9月 2011
Offline
That's great! I couldn't come up with that way.

Thanks a lot,
Ryoji
  • Quick Links