Jump to content
br1

Flip viscosity driven by age

Recommended Posts

I'd like to generate a stack of objects falling on each other over time.

The effect I want is that when they fall on the ground they are close to solid, but then loose viscosity while aging :

- First object is solid at frame 10, and at frame 20 gets liquid while the second object (newly born and falling) is solid.

I'm not sure where I can control the viscosity so that it's affected by the age of the particles.

Can someone point me to tips/suggestions or an example file ?

thanks

Bruno

Share this post


Link to post
Share on other sites

There's an option called something like "set viscosity by attribute". Turn that on, add a sop solver and pipe the age into an attribute create...

Share this post


Link to post
Share on other sites

pipe the age into an attribute create...

This is the step that I don't get.

My initial setup is created from the Flip Fluid from Object shelf tool. In the sopsolver I haven't see any presence of "age" or "life" while examining the nodes with the detail view, and I'm not sure how I am supposed to get it into the attribute create.

Share this post


Link to post
Share on other sites

This is the step that I don't get.

My initial setup is created from the Flip Fluid from Object shelf tool. In the sopsolver I haven't see any presence of "age" or "life" while examining the nodes with the detail view, and I'm not sure how I am supposed to get it into the attribute create.

I'm not sure if you want the attribute 'age' or something custom. With age you will have points dying/disappearing. But if you use the particle fluid emitter you can create a birth group, in the sop solver set an attribute for birth to the birth group equal to time; $BIRTH = $T. Then create another attribute that is $T-$BIRTH, this will give you how long it's been alive.

make sense?

Share this post


Link to post
Share on other sites

I'm not sure if you want the attribute 'age' or something custom. With age you will have points dying/disappearing. But if you use the particle fluid emitter you can create a birth group, in the sop solver set an attribute for birth to the birth group equal to time; $BIRTH = $T. Then create another attribute that is $T-$BIRTH, this will give you how long it's been alive.

make sense?

My issue is that I have been unable to get/use birth groups, age or life attributes with FLIP particles. If I follow your suggestion and add an attribute like $BIRTH = $T, that attribute evolves over time, so the result is always the same and all my particles loose they viscosity at the same time whether they have been born early or late.

Share this post


Link to post
Share on other sites

Yeah, as the particles in FLIP these days are not really particles (as in POPs), but "just" points with attributes, they don't have an age by default.

Here's a hip where I've gone and modified the DOP sourcing to add birth time, check the added AttribCreate DOP in /obj/AutoDopNetwork/source_surface_from_sphere_object1/source_particles/attribcreate_BIRTHTIME

Then I set the viscosity in a SOP Solver DOP to be ($T - $BIRTH) * multiplier

ageflipt.jpg

ageflip.mov (5Mb)

ee_flip_age_v002.hip

  • Like 6

Share this post


Link to post
Share on other sites

Thanks Eetu !

Exactly what I was looking for ! I Didn't think about digging deep in the sourcevolume.

By the way I followed your WIP thread and was wondering with your viscosity setup (ala *sand solver*) why the sopsolver works as intended when using the flipfluidobject referencing a SOP Path, but not when using a sourcevolume. Any tips ?

Share this post


Link to post
Share on other sites

By the way I followed your WIP thread and was wondering with your viscosity setup (ala *sand solver*) why the sopsolver works as intended when using the flipfluidobject referencing a SOP Path, but not when using a sourcevolume. Any tips ?

Forget this question. I just had to reconnect the point position to the noise in the vopsop.

Share this post


Link to post
Share on other sites

Here's a hip where I've gone and modified the DOP sourcing to add birth time, check the added AttribCreate DOP in /obj/AutoDopNetwork/source_surface_from_sphere_object1/source_particles/attribcreate_BIRTHTIME

Then I set the viscosity in a SOP Solver DOP to be ($T - $BIRTH) * multiplier

Nice effect, eetu!

FWIW, there's a way to create an age attribute fully in DOPs that's very lightweight (if a bit obscure). Use a GasLinearCombination DOP with the following parameters:

Destination: age

Geometry: Geometry

Combine Operation: Add

Source1: age

Constant: 1

then set the Constant scale factor (right next to it) to Timestep.

This does the equivalent of age = age + Timestep for every particle, with a default age of 0 for new particles.

In general GasLinearCombination can be a fast way to perform simple math on particle attributes in H12 (note that you won't get a local variable for an attribute created this way).

  • Like 1

Share this post


Link to post
Share on other sites

Nice effect, eetu!

FWIW, there's a way to create an age attribute fully in DOPs that's very lightweight (if a bit obscure). Use a GasLinearCombination DOP with the following parameters:

Destination: age

Geometry: Geometry

Combine Operation: Add

Source1: age

Constant: 1

then set the Constant scale factor (right next to it) to Timestep.

This does the equivalent of age = age + Timestep for every particle, with a default age of 0 for new particles.

In general GasLinearCombination can be a fast way to perform simple math on particle attributes in H12 (note that you won't get a local variable for an attribute created this way).

Neat trick! This should be in the help docs. :)

  • Like 1

Share this post


Link to post
Share on other sites

Yeah. In general whenever I see a node starting with "Gas..." my eyes roll...there are so many of them and they look like little secrets

Share this post


Link to post
Share on other sites

Yeah. In general whenever I see a node starting with "Gas..." my eyes roll...there are so many of them and they look like little secrets

Remarkably, GasLinearCombination is actually a simplification of the behemoth that is GasCalculate, with the addition of OpenCL support for fields, as well as fast, large-scale operations on particles attributes (useful for FLIP among other things).

Share this post


Link to post
Share on other sites

Hi Johner, I tried doing this trick with the Gas Linear Combination and it looks like it´s not creating anything at all.

Then again, I know squat about gas microsolvers, so I´m sure I´m setting up this wrong...could you show a really fast and simple example on how to set this up and how to access to this attribute (seeing how we cannot use its local variable)?

For the latter I was thinking on dopfields expressions, combined with an Attribute Create inside a SOP Solver so I can generate myself the variable for convenience...

am I on the right track?

Edited by Netvudu

Share this post


Link to post
Share on other sites

hi!

would be nice to have age or life on the flip solver, as an option. id has been added, this would be also very usefull.

Share this post


Link to post
Share on other sites

I usually add "birthframe" to the points before they go to the sim. It's just an attribcreate set to $FF. In the sim if I need to drive an attribute based on 'age' I just reference it using $BIRTHFRAME in a sop solver, or inside a vop in the sop solver.

Share this post


Link to post
Share on other sites

I really don't know how to use inside the DOP get age method,I just create a properties directly from the SOP may more simple and more practical;Who can give me a example file for the vop way?

Edited by Billy2013

Share this post


Link to post
Share on other sites

I really don't know how to use inside the DOP get age method,I just create a properties directly from the SOP may more simple and more practical;Who can give me a example file for the vop way?

File attached.

Viscosity_By_Age.hip

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

×