Jump to content

per fracture object density


breadbox

Recommended Posts

I have an RBD fracture and I would like to dynamically alter the density of each piece.

this would be similar effect as a glue constraint, but also could have other uses. If the object has no density its basically setting the object to inactive state, the bullet solver doesn't move the object. then I can add density per attrib transfer in SOPS and the pieces should become active.

what I am trying is to add a RBD state object and then use an expression in the density parm to give each object an individual density based on a attribute that I assigned in the sops.

I'm pretty sure its a syntax issue that I'm not very good with expressions.

attached shows my setup.

post-5696-0-19184900-1358122373_thumb.pn

Link to comment
Share on other sites

1) You need ONE density value per dyn. object (but you have points of the same dyn. objects with different "newDensity" value - you can store it as attribute in Geometry data, or create for example point per dyn. object in sops and then fetch this data into rbd state with expression.

2) You can't use local variables to access attribs in dops. use "point/prim/detail" expression instead - something like point("`$DOPNET`:`$OBJID`/Geometry", 0, "newDensity", 0)

Here is example:

3ak_density_per_dyn_obj.hipnc

Edited by bloomendale
Link to comment
Share on other sites

Thanks,

Your example makes sense. does this work with animated values though? I'm trying a simple test and it doesn't work as I'd like it to.

The effect I'm looking for is to hold objects in place until a certain time and then release them to the dynamics engine. In this case I have key framed a metaball to drive color which transfers into the attr to drive density.

maybe there is another way to set objects active or passive?

I think this can also be done with glue, but the glue seems a bit unstable its still behaving a bit odd.

3ak_density_per_dyn_obj_BW.hipnc

Link to comment
Share on other sites

here is another attempt. a slightly different way. trying to use activate to turn each RBD fracture ON. I'm using the same type of expression that worked in your example. however once inside the dop network, looking at the details view, my custom point attr "activate" is no longer animating. but its fine in the sop context?

Opps, have to check use deforming Geometry in the RBD object. I didn't think animation attributes counted as "deforming" but i guess it does.

works fine now.

Activate_Switch.hipnc

Edited by breadbox
Link to comment
Share on other sites

awesome, would love to take a look. did you mean to attach a hip?

Im noticing a huge speed hit when I tick the box for deforming geometry, but is there a way to bring in the changing attribute values without ticking that box? my geometry points are not animated per say, but I am animating an activation value to hold them in the air until I need them to fall.

Link to comment
Share on other sites

Oh, sorry about that! Here it is attached, though bloomdale's example is quite similar ( just uses rbd point objects, rather than rbd fracture).

If the per-point densities are changing over time, then yes, you'll have to choose deforming geometry (yeah, it's slow :( unfortunately), but for just reading the values from the points, you don't need it.

bullet_animated_mass.hipnc

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