Jump to content

Set Initial State


Recommended Posts

Hey guys, 

It's the first time that i'm trying to save a initial state of my sim. In this case i'm working Grains.

What I did was: create my grains from a sphere and simulate it until it set on the ground. Now i need to keep it like this, like a initial state, to work on my real scene.

My first idea was to save this grains' specific frame as a bgeo and load it back with a file node but, right now, this loaded grain particles don't interact with the other objects anymore. 
I think that the problem is on importing this back with a file node. Not sure though. 

Thx again,

EDIT: So in case that anyone else got the same doubt, i've just recorded a tutorial about it:



Best,

Alvaro Edited by ParticleSkull
Link to comment
Share on other sites

Hey Petr, 

I have just opened your file and i think i got what's going on there. Altough I couldn't make it work properly.

So, there's a node to save the initial state and another one to load the sim back. However it looks like it's saving all the simulation frames so, when i load it back, it's just playing back the whole simulation again (cached this time). Is there a way to load one frame only, in this case the frame 50 where the torus is settled on the floor, and keed it dynamic so it can interact with other objects?

Thx man,

Alvaro

Link to comment
Share on other sites

Yes, the File DOP will save all frames.

You will not load it inside DOP network via File SOP, but you will choose one frame, that one you want as initial frame and set path to this frame/file in the Initial State parameter on DOP Network.

Then set display flag inside DOP Network above that File SOP so you will not overwrite your initial state.

 

 

Just quick ask to google gives me link to this tutorial, same workflow for particles:

https://www.youtube.com/watch?v=CmE_EXRZ2ck

Link to comment
Share on other sites

Hi, DOPS are little bit different then sops. If the node is in the context it still can be calculated even if it's not in chain.

 

Basically when you disconnected the File DOP, you kept it active, and in Write mode, but it hadn't any input, so when you started new simulation it wrote empty file immediately and overwrote your initial state.

 

Try to disable that File DOP, set it's mode to No Operation or delete it before you leave dopnet to set up Initial State.

Edited by pezetko
Link to comment
Share on other sites

Great! Now it's working just fine! 

Thx Petr, now if you don't mind, i would like to go a bit further.

I have my initial state, the fragments are on the floor but now I want to add another dynamic object on the scene, to interact with the fragments.
Since it's reading the initial state sim file, it look's like that the AutoDopNetwork doesn't recognize new objects. Do you have any idea on how can I work with this?

Thx,

Alvaro

Link to comment
Share on other sites

Nice, :)

Instead of specifying Initial State for whole dop network you can just initialize only some dop object.

 

E.g. in attached file:

1. I created active rbd sphere, make that breakable and simulated.

2. When I was satisfied with the look I save the sim file that way I showed you (with File DOP set to write) (after it's saved I set File DOP to No Operation)

3. Then I decided I want to add Torus into the simulation. I created Torus SOP, made it active RBD with help of Shelf tools.

4. Then I setup File DOP to "Load" mode and set up switch (with $SF==1) that is switching between Initial State and simulated object. That way it can continue from saved state but also interact with new objects.

merge_sim_init_files.hipnc

Link to comment
Share on other sites

Thx again Petr, you're helping understand it a lot.

I have also noticed that, when i'm working with a static (and animated) object, i have to add the Switch node between the File node and the Groundplane node.

It works just fine like this, but i would like to understand what's going on there.
My doubt is why the File node must be switching with the Groundplane node. It's just because it's on top of the chain, maybe?

 

here's an image showing exactly what i'm talking about:
https://www.dropbox.com/s/2iq51m0y0bhonbl/switch-node.jpg?dl=0

I'll record a tutorial about this technique in case anyone have the same doubt and it'll have a great special thx to you.

Best,

Alvaro

Edited by ParticleSkull
Link to comment
Share on other sites

Could you upload and example?

With that swith you are loading simulation data for that object on the first frame (only for the first rame as it's defined with that expression) and then you let simulation to compute the rest by allowing update object's data (instead of constant fetching saved init state).

Link to comment
Share on other sites

Yes sure, it's here: https://www.dropbox.com/s/h307mup4cbv29i9/HeavyBakeSim.rar?dl=0 (The initial state file is already inside the sim folder)

 

So, with the $SF==1 the Switch node will first use the File node and, as soon as it goes to frame 2 (which is not == to 1), it keep going with the rest of the sim, ignoring the File node? (just forget about it)

EDIT: I've just realised how the Switch node works. So, =Tube and 1=File node. Then, if SF=1 switch to File node. If SF≠1 switch to Tube. Right?

Best,

Alvaro

Edited by ParticleSkull
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...