Jump to content

RBDPointObject Instances and Impacts


lorig

Recommended Posts

I'm trying to solve a problem where a bunch of instanced objects in an rbdpointobject hit the ground and then create particles where the objects hit the ground. I got this working for one object but am struggling to get it to work for all of the instanced objects in the RBDPointObject.

was able to get the hits of one of the boxes in a copy sop :

dopnumrecords("/obj/dopnet1","boxes_*","Impacts","Impacts")

and the positions of one of the objects:

dopfield("/obj/dopnet1","boxes_*","Impacts","Impacts",$PT,"positionx")

but don't know how to get it to work for all of the instanced objects

Does anyone have any helpful ideas?

test_impacts_rbdpointobject.hipnc

Link to comment
Share on other sites

Your problem comes from the use of all the wild cards in trying to fetch the data. The best approach is to actually use 2 Copy SOPs and stamping. The first one is used like you have done to copy a point X number of times based on the number of records. The second is used to copy the above data for each of your target boxes.

First I use argc(dopobjectlist("/obj/dopnet1/boxes_*", 0)) to figure out how many boxes there are and generate that amount of copies. Next I create a stamp a variable called "dopid" that uses arg(dopobjectlist(), $CY) to get the OBJID of the object that is currently being copied. I then use this variable to stamp in our expressions for the "objspec" argument rather than using "boxes_*". This allows me to look specifically at the data for one dop object at a time. In the interest of cutting back on nodes, I removed your Point SOP and just did the positioning in the Add SOP itself using another copy/stamp from the first Copy SOP that used the copy number as the record index.

Also, I've attached a custom Python SOP I wrote a long time ago that basically does all the above and everything you had setup in your file for you. It provides a simple interface to create impact points from any RBD objects in a simulation, being able to specify different configurations as well as excluding impacts against certain objects and providing a Impulse threshold you can use to ignore records below certain values. You can also simply toggle on any of the available impact data to be added as point attributes.

test_impacts_rbdpointobject.hipnc

sop_dopimpacts.otl

Edited by graham
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...