pushpathadam Posted April 2, 2009 Share Posted April 2, 2009 Hi, I am having some difficulty creating group membership with an expression testing an object's position in world space. Basically I bring in 9 spheres as fractured object and am trying to put the ones with x position greater than 0 into my group test. Underneath I attach a group node with a new group 0 name: test, mask: * and for expression I tried both dopfield("/obj/dopnet1", $OBJNAME, "Position", "Options", 0, "tx") > 0 dopfield("/obj/dopnet1", $OBJNAME, "Position", "Options", 0, "tx") + dopfield("/obj/dopnet1", $OBJNAME, "Position", "Options", 0, "px") > 0 No errors ..but neither expression captured any on my object positions...although I could see the values of P and T updating in the details view. I've been able to make groups work without expressions so a couple of questions... -Anything obviously wrong with my expressions? -Is their a way to verify group membership in some view ...details? middle mouse? like in DOPS and SOPs -Can anyone point me to a working example with expressions in a group dop? thanks Tom Quote Link to comment Share on other sites More sharing options...
johner Posted April 2, 2009 Share Posted April 2, 2009 Underneath I attach a group node with a new group 0 name: test, mask: * and for expression I tried both dopfield("/obj/dopnet1", $OBJNAME, "Position", "Options", 0, "tx") > 0 dopfield("/obj/dopnet1", $OBJNAME, "Position", "Options", 0, "tx") + dopfield("/obj/dopnet1", $OBJNAME, "Position", "Options", 0, "px") > 0 -Anything obviously wrong with my expressions? The second one looks good to me. You might use dopoption to save a little typing: (dopoption(".",$OBJID, "Position", "px") + dopoption(".",$OBJID, "Position", "tx")) > 0 You can used $OBJID or $OBJNAME in these expressions, but OBJID is guaranteed to be unique. A good way to debug these is go into a textport, and do something like: cd /obj/dopnet1 echo `(dopoption(".", "sphere_2", "Position", "px") + dopoption(".", "sphere_2", "Position", "tx")) > 0` or any subset of the expression to see the current values for a specific object. You might be getting tripped up by solve order here. The group DOP runs on the first frame before the solve, but px and tx aren't updated until the RBD solver runs the first time. It's worth re-reading the part about the two-part solve in the docs. The grouping happens in the first pass before any solving. In the example file attached, you have to go to frame 2 before the group shows up. You'd have to get a little trickier to get the group to work on the first frame with an RBD Fractured Object. -Is their a way to verify group membership in some view ...details? middle mouse? like in DOPS and SOPs Details view. You should be able to just click on the name of the object and see the groups it's in. -Can anyone point me to a working example with expressions in a group dop? See attached. groupexr.hip Quote Link to comment Share on other sites More sharing options...
pushpathadam Posted April 2, 2009 Author Share Posted April 2, 2009 Awesome! I realised that I was specifying the current location incorrectly ..."." did the the trick.. and yeah ..saw the frame 2 issue.. probably work around that with a little bit of preroll thanks! Tom The second one looks good to me. You might use dopoption to save a little typing: (dopoption(".",$OBJID, "Position", "px") + dopoption(".",$OBJID, "Position", "tx")) > 0 You can used $OBJID or $OBJNAME in these expressions, but OBJID is guaranteed to be unique. A good way to debug these is go into a textport, and do something like: cd /obj/dopnet1 echo `(dopoption(".", "sphere_2", "Position", "px") + dopoption(".", "sphere_2", "Position", "tx")) > 0` or any subset of the expression to see the current values for a specific object. You might be getting tripped up by solve order here. The group DOP runs on the first frame before the solve, but px and tx aren't updated until the RBD solver runs the first time. It's worth re-reading the part about the two-part solve in the docs. The grouping happens in the first pass before any solving. In the example file attached, you have to go to frame 2 before the group shows up. You'd have to get a little trickier to get the group to work on the first frame with an RBD Fractured Object. Details view. You should be able to just click on the name of the object and see the groups it's in. See attached. 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.