Jump to content

Getting OBJID or dop object name in Sop Solver

Recommended Posts


I'm manipulating objects in a sim with a sop solver,  based on their dop object names. The simple case is to say, turn on or off the @active attrib in a bullet sim base on the object name. Right now I'm adding a string attrib with the name to the packed primitives on the SOP side, before they get made into an RBD packed object and checking that name the sop solver in the sim, using a point wrangle to make changes, etc.

It occurs to me though that OBJID is and the object name are both available but I can't figure out how to read them while in the sop solver. I know I can use a function like dopoptions to get the name but that requires me to have the OBJID of the dop oject that the sop solver is working on  and I can't figure out how to get that in the sop solver itself.

In short, what node/expression will get me access to the object's name or id in the sop solver inside a dop sim?





Share this post

Link to post
Share on other sites

If you're using the RBD Packed Object DOP, I believe you're best option is the one you're using now.. the point attributes.

$OBJIDs does not represent a unique ID for each packed primitive. It represents a simulation object's unique ID.

In the attached file, I've setup a Packed version and Fractured version.
Inside the DOP network, if you look at the Geometry Spreadsheet, this is what it would look like comparing the two:

For Packed Objects, you'll get just one simulation object. But for a Fractured Object, you'll get each piece as a separate simulation object.

EDIT: I accidentally hit the submit button >__<

As for accessing the OBJID, use the Fractured Object method. The Sop Solver already has code on how to access it on the dop_geometry SOP inside. (see the stamp function)
As an example, in the attached file, I used a Sop Solver to isolate OBJID 8 and shrunk it down during the sim.

A drawback with the Fractured Objects method is that it can be slow to process thousands of simulation objects. That is why the packed method was introduced a few versions ago.

As another note, the option to choose which method to use also appears whenever using the RBD Fractured Object shelf button:

H16.5.268 Indie - dop_objid.rar

Edited by galagast
  • Like 1

Share this post

Link to post
Share on other sites


thanks for your thorough reply. The stamp expression in the switch node is what I'm looking for. I do understand the packed/non-packed difference but was just looking for a way to differentiate by objects. Thanks!


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