View Full Version : Attaching a node to fluid output force?

02-22-2011, 08:40 AM
I'm looking for a way to easily control the amount of influence a fluid field has on particles. Would something like vector product work? I'm currently just keying the velocity attribute on the fluid from 1 to 0. Any ideas?

02-22-2011, 10:51 PM
Depending on the situation I guess, you could use the conserve on the particle or world dynamic influence on the particle or if you are handy with mel you could write a setFluidAttr code but thats probably not very practical.

02-23-2011, 12:35 AM
couldnt you also script on the dynamic weight attribute or is that just a shape versus pp attribute.

02-23-2011, 12:50 AM
Can't use dynamic weight attr cause that governs all fields. I need control over just the fluid container.

02-23-2011, 03:47 AM
It sucks, but I don't think there is a control for the magnitude of a fluid used a field( that doesn't affect the motion of the fluid ).

It is possible using fluidVoxelInfo and getFluidAttr to set the particle velocity from the fluid velocity grid inside an expression, but it is relatively slow to evaluate. This would give you control, however. Call fluidVoxelInfo with the particle location to get the voxel index at that position then get the value of the fluid velocity grid with getFluidAttr.

Another workflow, although it is a bit lame, would be to create a second fluid with only a dynamic velocity grid( no other grids ) and apply the first fluid as a field on the second, then use the second fluid as a field on the particles. The damp on the fluid should be set to around 0.2, so its velocities do not build up. The simulationRateScale will then determine how strong the fluid force is. One can also make the solver quality low for speed.

02-23-2011, 04:22 AM
okay I found a method that seems slow to run probably as slow as writing get and setFluidAttrs but more intuitive.

SOuP has pointCloudField and a fluidAttributeArray nodes. Essentially you connect the fluid to the fluidAttributeArray grabbing position and velocity and pass this into the pointCloudField. Now you can play with the pointCloudField node and control the force of your fluid. You'll notice things like fall off curve, you can clamp the velocity, radius etc.

Its a shame this is slow because it works well.

02-24-2011, 08:51 PM
some good options to try here, thanks all.

I've been playing a little with soup, just looking at how things are connected in the examples. I'll try this suggestion as well

CGTalk Moderation
02-24-2011, 08:51 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.