Jump to content

Getting OBJID or dop object name in Sop Solver


lugnut

Recommended Posts

Hi-

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?

 

Thanks 

 

 

Link to comment
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:
rbd_objects.jpg.427778c05eb2053cdb88842e8e65b8cc.jpg

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.
dop_id_shrink.gif.c15fc7d7f153eaae25e6afc570de0754.gif

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:
frac_obj.png.75f895af1ba4edb98f593c847b7c2a0f.png

H16.5.268 Indie - dop_objid.rar

Edited by galagast
  • Like 1
Link to comment
Share on other sites

Jeff, 

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!

 

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