dayvbrown Posted June 18, 2009 Share Posted June 18, 2009 Hi all, I'm running an rbd sim where there is a bunch of continually spawning stuff falling through frame and doing all the usual rbd-ish things but as this is a VERY long shot the objects just keep falling and hence the sim is getting a bit overblown as the number of objects escalates. My question is about removing objects from the sim once they are out of frame, ie: when there y position is less than "whatever". I feel as if i'm missing something really simple, i've tried to make groups and various other things but it seems the sop expressions i know are pretty useless here... Any help would be great, Dave. Quote Link to comment Share on other sites More sharing options...
johner Posted June 18, 2009 Share Posted June 18, 2009 (edited) My question is about removing objects from the sim once they are out of frame, ie: when there y position is less than "whatever". I feel as if i'm missing something really simple, i've tried to make groups and various other things but it seems the sop expressions i know are pretty useless here... Yeah, with DOPs you often need to pull the information you want from the data attached to the DOPs objects themselves, in this case the Position data. A Group DOP with an expression set to something like: dopoption("..",$OBJID, "Position", "ty") < -2 followed by a Delete DOP should do the trick. See attached. Edit: I should add you could get the same result with just a Delete DOP and "*" in the Object Group parameter and a similar expression to above in the Activation field, since that field is re-evaluated for every object. But I personally think the Group/Delete approach is more clear. DOPs_delete_out_of_frame.hip Edited June 18, 2009 by johner 1 Quote Link to comment Share on other sites More sharing options...
dayvbrown Posted June 18, 2009 Author Share Posted June 18, 2009 Perfect!! Massive thankyou that works perfectly. You've saved me a lot of pain Yeah, with DOPs you often need to pull the information you want from the data attached to the DOPs objects themselves, in this case the Position data. A Group DOP with an expression set to something like: dopoption("..",$OBJID, "Position", "ty") < -2 followed by a Delete DOP should do the trick. See attached. Edit: I should add you could get the same result with just a Delete DOP and "*" in the Object Group parameter and a similar expression to above in the Activation field, since that field is re-evaluated for every object. But I personally think the Group/Delete approach is more clear. Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted October 18, 2011 Share Posted October 18, 2011 I'd like to do the same thing, delete DOP objects based on a position threshold. The problem is "dopoption($DOPNET, $OBJID, "Position", "ty")" returns the local position of each object. Let's say you got 10 objects, each positioned at a different height and you apply just gravity to everyone, their "ty" value will match at each frame. How can I get their real world position data? Quote Link to comment Share on other sites More sharing options...
johner Posted October 18, 2011 Share Posted October 18, 2011 The problem is "dopoption($DOPNET, $OBJID, "Position", "ty")" returns the local position of each object. You need to take each object's center-of-mass into account, which is stored in the "p" (for pivot) field. So instead of just accessing "ty": dopoption($DOPNET, $OBJID, "Position", "ty") + dopoption($DOPNET, $OBJID, "Position", "py") Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted October 18, 2011 Share Posted October 18, 2011 thanks Johner, works like a charm ! 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.