Jump to content

Removing rbd objects from simulation


dayvbrown

Recommended Posts

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.

Link to comment
Share on other sites

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 by johner
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 years later...

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?

Link to comment
Share on other sites

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")

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