What is $OBJ?

   455   4   1
User Avatar
Member
229 posts
Joined: July 2013
Offline
I have seen $OBJ referred to as an "Object ID".

I have seen it used in a HScript expression in a parameter.

Can someone provide an example to explain more precisely what it is and how it is assigned to an object and if it can be listed for view, maybe i Geometry Spreadsheet?
User Avatar
Member
8599 posts
Joined: July 2007
Offline
It's a local variable that many DOP nodes can evaluate as currently processed object number by the node
There is many more local variables like $OBJID which is the actual unique object id within the sim

You can see on each DOP node's help which local variables it supports and what they mean like here [www.sidefx.com] for example
Edited by tamte - Jan. 19, 2024 00:30:11
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
229 posts
Joined: July 2013
Offline
Thank you Thomas for the link.

So, if I set up a fractured object RBD simulation and in the Gravity node inside the DOP Network type $OBJ for Force Y parameter, I see that the fractured pieces move at different accelerations. So is this using the index of each fractured part being processed by the solver to set its own gravity force?
User Avatar
Member
8599 posts
Joined: July 2007
Offline
litote
So, if I set up a fractured object RBD simulation and in the Gravity node inside the DOP Network type $OBJ for Force Y parameter, I see that the fractured pieces move at different accelerations. So is this using the index of each fractured part being processed by the solver to set its own gravity force?
well, not exactly, $OBJ is index of enumerated objects that the Gravity node processes when attaching it's force data, regardless of whether there is any solver in the dopnet or regardless of which objects the solver would process
this index starts at 0 and goes up to however many objects that node processes, which depends on it's group scope etc

if you want more stable result I'd advise to use $OBJID which is the actual objid data of each object, so for each object $OBJID will always return it's real objid value regardless of whether is processed first, second etc...

but yes, you can directly see different force value for gravity under each dop object that it processed
Edited by tamte - Jan. 19, 2024 03:21:50
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
229 posts
Joined: July 2013
Offline
Thanks again!
  • Quick Links