Jump to content

save point position data across frames in sop solver


Recommended Posts

I am trying to create AI behaviour in the sop solver. I am able to update behaviours by using the prev frame data without any trouble.

The problem is for one particular behaviour I need to save the position of certain points across a frame range, and use this data to drive the other points in the simulation.

The solutions I could think of were:

  • I tried using a pop network outside of the sop solver to birth new particles and access these points back in the sop solver. But the solver errors out if i connect the data from the pop network into the solver tree. I guess this is because i am making new points outside of the solver.

  • I also tried to create new points using python and the `add` sop. this is terribly slow and almost brings the whole thing to a stop.

  • The most obvious solution seemed to be to create a list attribute in python and save the data into it. But if i do this in the sop solver then the data gets overwritten per frame.

Is there some way to create an attribute that could store an array or list of position data across frames.

From the documentation i understand that only floats, int and vectors can be used as attributes. I could just append the new position data to this list per frame and access it later in the tree.

Thanks

----------------------------------------------------------------------------

www.vimeo.com/tusk3d

Link to comment
Share on other sites

What are you using the old P values for? If it's for something like particle avoidance (making particle A avoid where particle B has been), you can leave a trail of points behind B in the sop solver and use vops + pc lookup to do the repulsion, then delete the trailed points outside of the solver. If this isn't what you're after, maybe tell us more about the effect you're trying to achieve.

Link to comment
Share on other sites

What are you using the old P values for? If it's for something like particle avoidance (making particle A avoid where particle B has been), you can leave a trail of points behind B in the sop solver and use vops + pc lookup to do the repulsion, then delete the trailed points outside of the solver. If this isn't what you're after, maybe tell us more about the effect you're trying to achieve.

Thanks for the reply.

I went ahead and used the approach you suggested and it works well. I am using hou.createPoint() in the solver node and using the new points in a VOP. I wanted to use these points as a seek behaviour for the agents.

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.

Guest
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...