lorig Posted December 14, 2009 Share Posted December 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
graham Posted December 14, 2009 Share Posted December 14, 2009 (edited) 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 December 14, 2009 by graham Quote Link to comment Share on other sites More sharing options...
lorig Posted December 14, 2009 Author Share Posted December 14, 2009 Thank you! That got really complex really quickly. I'm going to have to study this a while then I think I'll have a few more questions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.