breadbox Posted January 14, 2013 Share Posted January 14, 2013 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. Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 14, 2013 Share Posted January 14, 2013 (edited) 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 January 14, 2013 by bloomendale Quote Link to comment Share on other sites More sharing options...
breadbox Posted January 14, 2013 Author Share Posted January 14, 2013 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 Quote Link to comment Share on other sites More sharing options...
breadbox Posted January 14, 2013 Author Share Posted January 14, 2013 (edited) 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 January 14, 2013 by breadbox Quote Link to comment Share on other sites More sharing options...
goldleaf Posted January 15, 2013 Share Posted January 15, 2013 If you use an RBD Point Object for your fracture geometry, here is a way to animate mass per-point. Incidentally, Bullet treats objects of 0 mass as static, so you can use this to make objects active and static. Quote Link to comment Share on other sites More sharing options...
breadbox Posted January 15, 2013 Author Share Posted January 15, 2013 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. Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 15, 2013 Share Posted January 15, 2013 deforming geo checkbox is switching between different sopgeo dops inside rbd object node - when on you're referencing geometry from sops every frame - which leads to drop in speed of course. to avoid it you can read density directly from sops. 3ak_density_per_dyn_obj2.hipnc Quote Link to comment Share on other sites More sharing options...
goldleaf Posted January 16, 2013 Share Posted January 16, 2013 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.