Jump to content
Iraklo

Get an attribute from iteration before current from ForEach loop

Recommended Posts

Hi guys,

 

is it possible to get an attribute value from loop before current in foreach loop?

Share this post


Link to post
Share on other sites

Did you tried it via the detail from the metadata? Thus if the metadata node is active in the forloop go to the dateilview in you geo spreadsheet. You will fin there different attributes. Maybe you could use onr of them... Sorry, cant give you an exact way for it. Interested in it as well but maybe its a good starting point.

Share this post


Link to post
Share on other sites

@Follyx

thanks for reply.

as far as I know metadata gives current iteration and number of iterations and I want position of primitive.

Share this post


Link to post
Share on other sites

hm.. why you dont use a sopsolver inside the loop to write the wanted data in an attribute for further use?

But maybe the for loop is a closed system where the solvers prevoius frame wont work. In case you want the posdata from the previous frame. Dont know. Dont sit on the PC. 

Edited by Follyx

Share this post


Link to post
Share on other sites

sop solver works only during animation right? So after every change I have to re simulate again. I don't think that that's the way I want to go.

Share this post


Link to post
Share on other sites

hmm... a wrangle with the iteration from @currentframe -1 metadata and ask for the pos...?

can you up a file for it?

Share this post


Link to post
Share on other sites
8 hours ago, Follyx said:

hmm... a wrangle with the iteration from @currentframe -1 metadata and ask for the pos...?

can you up a file for it?

The scene is very basic: I have randomly sized, randomly positioned boxes. Some of them are intersecting, some do not. I want to stack them one after another like books on shelf.

This is what I have now.

Capture.JPG

Share this post


Link to post
Share on other sites

Hello Iraklo

 

My guess would be to use a sop solver as Folly suggested. It is really close to a for loop actually if you think about it, and you can more easily store the data you need IMHO. You can simply use a timeshift after the solver if you wish to have the result on frame 1, a for loop would also have to recook if  you make changes anyway.

Edited by Nebucadnezar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×