breaking a bridge

   5169   4   0
User Avatar
Member
325 posts
Joined: 7月 2005
Offline
Hi there,

I am planning to create a breaking-bridge effect in DOPs, but for now I am concentrating on a simpler “proof of concept” model. I have a stack of cubes (kind or rubix-cube) and a fan force pushing the cubes. I want to create a controllable object breaking – i.e. I need to find a way to add more and more objects into the process of breaking – i.e. at the first stage the whole stack of cubes is solid (internal glue is either -1 or very high) then some cubes start to fall off, and, finally, the whole stack is scattered by the Fan force.

What I am doing is applying colors from black to white to the cubes and then use Partition SOP to create groups of cubes for me. It works fine for non-controllable breaking – i.e. the groups of cubes in the simulation are set up at the beginning of simulation and I can’t find a way to modify those groups after the simulation is started.

Ideally it would be great if Internal Glue strength could be controlled with the Prim Color attribute (created and modified at the SOP level) – I have a simple VEX Distance SOP that changes the primitives’ color, based on distance to a target object. So I thought I could bring that target object closer to my cubes – change their color – and thuss effect their internal glue strength and make the cubes’ stack collapse in the simulation. But I don’t think it is currently possible, as RBD State DOP doesn’t seem to be able to use the $CD attribute. Or am I missing the point? What is the right approach to add more and more objects into the RBD State group, based on certain parameter? (and I need something more sophisticated than $TX – what is shown in Choreographed breaking example file)

Maybe some clever expression that will somehow modify the selection of groups in RBD State DOP based on the color?

Thanks.
I liked the Mustang
User Avatar
スタッフ
4441 posts
Joined: 7月 2005
Offline
You can use a prim expression in an RBD State DOP. You'll need some way to associate each RBD Object with a particular primitive. But that should be pretty easy. Just make sure the primitive number is embedded in the object name, or use a Modify Data DOP on the frame when the object is created to create the association and use a dopoptions expression to extract the primitive number. And in te RBD State DOP, remember to set the Glue Strength parameter to Set Always.

Mark
User Avatar
Member
325 posts
Joined: 7月 2005
Offline
Sorry, maybe I failed to express myself clearly, so let’s keep it blunt: is it possible to access object’s Cd attribute in DOPs? Is it possible to apply the objects Cd parameter as a glue strength in RBD State DOP? Or as an alternative – any other user-created attribute.

In the Details View I can see the Cd parameter under Geometry data subgroup (/obj/dopnet1/obj0/Geometry)– so I assume it is accessible somehow – however dopfield and dopoption expressions can only access the Option subfield (e.g. …/Position/Option or Geometry/Option) – while Cd parameter is kept directly under Geometry data field. Is it possible to access it and how?

Edit:
Thanks, mtucker - after having read your reply like 10 times I see that you are actually answering my question, however the technique you are describing seems kind of uneasy. Still fighting.

P.S. btw - I am trying to use RBD Glue object and tryingto achieve animating the glue parameter for each piece.
I liked the Mustang
User Avatar
スタッフ
4441 posts
Joined: 7月 2005
Offline
Do you have the animating prim color on the RBD Object geometry as well? If so, that makes things easier. You can access geometry information attached to DOP objects (almost) exactly the same way you access geometry information on SOPs. All the same expressions functions work (in this case the prim expression). So to get the Cd attribute value for geometry attached to an RBD object, use:

prim(“/obj/dopnet1:rbdobject1/Geometry”, 0, “Cd”, 0)

Where “/obj/dopnet1” should be the path to your DOP Network, “rbdobject1” should be the name of your DOP object (or you can use the variable $OBJID if you are writing this expression in an RBD State DOP to modify the Glue Strength).

In general, any expression that lets you access information about SOP geometry can be used to access the same information for geometry attached to a DOP object. You just need to use the extended path syntax in the first argument to point to the particular DOP object you are interested in.

Mark
User Avatar
Member
325 posts
Joined: 7月 2005
Offline
Oh, yeah, mtucker,

this is as sweet as a candy!

Thanks alot - Houdini is not a package - it's magic! - In the eve I was lame enough to suspect Houdini of being limited (I though that DOPs didn't allow arbitrary attributs access) and then, as always, it turned out to be just the lack of my knowledge and experience.

Thanks for your great job, Mark!
I liked the Mustang
  • Quick Links