Jump to content

Animation of RBD Packed Object informed by the simulation geometry it's affecting


tanzola

Recommended Posts

Hello,

I'm sure my title for this post could be clearer, so for visualization purposes, say I have a field of discs that are RBD Packed Objects on the XZ plane, and above them there's a sphere with gravity:

5dce1eba09e17_ScreenShot2019-11-14at10_40_49PM.png.5629ed85f9aa0b63eee92ea40ad9c8c7.png

Normally the sphere would fall onto the discs and the discs would act more or less like a ground object, but I'm trying to have the discs raise up depending on each one's respective distance to the sphere. 

So far I've found that the positions of the discs (RBD Packed Objects) can be controlled in a sop solver within the dopnet, but I have no idea how to reference the position of the simulated geometry (the sphere) to inform the discs' positions. Can anyone show me the way?

My ultimate goal is to eventually replicate the desired effect with the sphere being a vellum object.. would that require a different workflow?

Here's my setup so far that may or may not save you a minute:

sample.hipnc

Thanks for taking a look!

Link to comment
Share on other sites

I cant upload the file since Im at work, but I downloaded your file and tested around. Correct me if I'm wrong, you wanna simply just store the distance between sphere and the discs somewhere. 

So here's my thought: Make your sphere a packedobject too, connect a sopsolver with the multisolver, and in sopsolver, you can actually use object mask in DOP import node. So in your DOP import node, use 0 as the object mask to get your discs, and copy a DOP import then use 1 as the object mask to get your sphere. Then under it just use a wrangle like: f@dist = distance(@P, point(1,"P",0)); Then you can see the distance attribute is stored in the discs object.

If you wanna stored the distance in sphere, you need to create an array attribute, and append the array with the distance for each disc ptnum.

Hope this can help you.

Link to comment
Share on other sites

Hey Jie,

Thank you for the response. Conceptually that all makes sense. I'm still pretty new to dops and I can't seem to get the dop import node working in the sop solver. If you find the time, would you mind elaborating on the setup required in order to have the dop import node work by changing the 0 to a 1 in the mask parameter? Merging the rbd objects before the multisolver seemed like an intuitive solution, but I can't seem to get that working.

Thanks again!!

Edited by tanzola
Link to comment
Share on other sites

Check this:

5dd2ea19e34bd_Annotation2019-11-18205927.thumb.jpg.6e56aecae9729c155d763f3ac110eacc.jpg

sample_03_simple.hipnc

First of all - before making a rbd sim make sure that all of your objects have proper names. I know you don't use constraints, but lets keep it consistent!

No need for a sop solver, use Geometry wrangle - much faster and cleaner. Also it is a good practice to update the velocity when moving the position. Oh, and make the caps regular Static Object - you are gonna manipulate them manually inside the DOPS.

  • Like 1
Link to comment
Share on other sites

Hey Pavel,

Thanks so much for taking the time. This info will really help me a lot. 

I've never encountered the Empty Data and Enable Solver nodes before, but I think I understand. It seems like the Enable Solver tells Geometry Wrangles which objects to apply to by entering the names set by the Empty Data node..

And I'm not sure how the names will come into play, but hope to remember that tip when I get into constraints.

Thanks a ton!!

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