Jump to content
Memo

How to assign attributes to points which are already cached.

Recommended Posts

Hi all, I'm a creative C++ coder playing with Houdini - pretty beginner but with some understanding of what's going on.

 

 

I've cached a flip simulation as BGEO sequence, and I'm having trouble adding custom attributes to the points which are dependent on initial position of the point in respect to the initial shape

 

E.g. let's say I want to melt a teapot, and I want to to use different triangulation parameters for the body and the spout. I.e. I want to mark the spout as "bodypart"==1 and the body as "bodypart"==2 and create groups based on that.

 

 

This I know how to do:

1. Load the teapot in a geo node. 

2. Cookie the spout with a simple shape hilighting the spout area, do points from volume, attribcreate and assign 1 for bodypart

3. repeat for other parts etc.

4. create a flip fluid out of these points and solve it

5. cache the resulting simulation as a BGEO sequence

6. load the BGEO seq, and all of my points still have the custom attributes, and I can use those for meshing and various other visualisations. 

 

This works perfectly and does exactly what I need. However problem with this, is if I decide to add/change body parts, I need to re-run the flip solver which makes no sense since the bodypart attrib has no effect on the simulation. Doing this attrib create before the flipsolver makes sense for things like color and viscosity, but it doesn't make sense for attributes which don't affect the sim I think. 

 

 

what I would like to do is:

1. Load a mesh and select different parts of that mesh and assign only attributes which are essential to the flip solver (e.g. Cd, viscosity etc).

2. create a flip fluid out of these points and solve it

3. cache the resulting simulation as a BGEO sequence containing only attributes which are essential to the flip solver

4. load the BGEO seq, and assign new attributes, which I will use for meshing and various other visualisations. 

 

 

If I use the same method (i.e. volume intersections) on the BGEO sequence, it understandably applies the volume intersection every frame, and so the attributes are re-applied every frame to the points inside the volume, and don't move with the points. 

 

What I really need is something like "at frame 1, do the cookie and attrib creation, and then maintain those attributes throughout the BGEO sequence" but I can't figure out how to do that in Houdini.

 

Any tips welcome!

 

P.S. I have 'reduce' set to off in my flip solver. 

 

 

Share this post


Link to post
Share on other sites

You can do it like this:

attrPostSolve_dv.hipnc

 

Note that you must enable "Add ID Attribute" on the FLIP Solver -> Particle Motion -> Behavior. That gives each particle a unique ID that is the same throughout the whole sim, even with changing point counts. So that is probably the key to this whole thing.

Share this post


Link to post
Share on other sites

doh, I knew there'd be a time node in there somewhere but I just couldn't figure it out :)

 

So I guess the attribcopy is the crucial thing here (other than the ID), to copy the relevant attributes from the time frozen branch, to the active branch. 

 

thanks so much!

Share this post


Link to post
Share on other sites

doh, I knew there'd be a time node in there somewhere but I just couldn't figure it out :)

 

So I guess the attribcopy is the crucial thing here (other than the ID), to copy the relevant attributes from the time frozen branch, to the active branch. 

 

thanks so much!

Exactly, but without the ID the AttribCopy SOP wont find the correct particle again - so they both go hand in hand really.

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

×