asnowcappedromance Posted August 12, 2010 Share Posted August 12, 2010 hi everybody! I created a dopnet in which I activate rbd objects based on their distance to eachother, for this purpose I used the ActiveValue Node. (sphere hits brickwall, bricks get activated if the distance threshold is lower than a certain value) The active value node only takes in the brick groups as a mask. Now the bricks that get hit by the sphere get an active value of 1 and the collision happens, but as soon as the sphere passes the bricks and continues it's route, the value switches back to 0. My idea was to get the bricks into a new group as soon as they got activated, but I get an error message when I try to use the following expression: if( dopfield( $DOPNET, "brickobj_" + ($OBJID-3), "SolverParms", "ActiveValue", "active" ) == 1, 1, 0 ) would be nice if someone could help me here, best regards, Manuel Brickwall.hipnc Quote Link to comment Share on other sites More sharing options...
Macha Posted August 12, 2010 Share Posted August 12, 2010 (edited) Try, if( dopfield( $DOPNET, "brickobj_" + ($OBJID-3), "SolverParms", "ActiveValue", 0,"active" ) == 1, 1, 0 ) I don't know why but it likes to have a 0 in there... At least no error now. Does it work for you Manuel? Edited August 12, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 13, 2010 Author Share Posted August 13, 2010 hey man, thanks for the quick reply! the error message vanishes, but no groups are created when the objects get an active value of 1. strange ... Quote Link to comment Share on other sites More sharing options...
Macha Posted August 13, 2010 Share Posted August 13, 2010 (edited) If you add this expression, without if(), does it work? Since it evaluates to 1 or 0 anyway I think if() would be unnecessary. The dataname is hinted at in the ActiveValue node. It seems to switch on and off the groups with the correct members according to the Active value. dopfield($DOPNET, "brickobj_" + ($OBJID-3), "SolverParms/ActiveValue", "Options",0, "active") Edited August 13, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
Macha Posted August 13, 2010 Share Posted August 13, 2010 (edited) Actually, if you reverse the active 0-1 values and then add a gravity node for that group you get a very interesting frozen-dynamics effect. Brickwall_frozen.hipnc Edited August 13, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 13, 2010 Author Share Posted August 13, 2010 haha, indeed interesting Macha ok you are right, I looked up the dopfield expression in the help and you have to use a "/" if you're addressing subdata. it seems that the whole setup works incorrectly because my distance expression does a weird thing even before the active value gets 1. In the new file I've created "CustomData" with holds the distance value and there are 2 problems that I don't know how to solve: a) all the bricks share the same value instead of having a distinct value on its own the value starts with 0 and increases as the sphere approaches the bricks. thanks again for your help, maybe you can figure it out regards ... Brickwall.hipnc Quote Link to comment Share on other sites More sharing options...
mawi Posted August 13, 2010 Share Posted August 13, 2010 haha, indeed interesting Macha ok you are right, I looked up the dopfield expression in the help and you have to use a "/" if you're addressing subdata. it seems that the whole setup works incorrectly because my distance expression does a weird thing even before the active value gets 1. In the new file I've created "CustomData" with holds the distance value and there are 2 problems that I don't know how to solve: a) all the bricks share the same value instead of having a distinct value on its own the value starts with 0 and increases as the sphere approaches the bricks. thanks again for your help, maybe you can figure it out regards ... Have not looked at your file but type your condition into the activision of a modify data-DOP, set the type to boolean, value float to 1 and type a nice name into value 0 name. As soon as contition is met it will create and store the named data. You can now put that object into a group by putting dopoption($DOPNET,$OBJID,"Position","yourDataName") in group expression. The important part here is that the data will not be destroyed when condition is no longer true. Cant give you a file now but will post one later if you cant make it work. Quote Link to comment Share on other sites More sharing options...
mawi Posted August 13, 2010 Share Posted August 13, 2010 Here is a fast file coloring RBDs if ever been under 0 TY. Hope it helps. modifyData.hipnc Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 13, 2010 Author Share Posted August 13, 2010 thanks for the reply Mawi, I will have a good look at your file tomorrow! I just solved the grouping issue on my own, I think my solution goes into the same direction as yours. I created an attribute "hasbeenhit" with a modify data DOP as it was suggested in one of the tutorials of the gnomon dynamics DVD. However, this doesn't resolve the distance expresson problem that I described earlier. Any suggestions why my values start from 0 and increase instead of being large at the beginning and getting smaller over time? Brickwall_edit_02.hipnc Quote Link to comment Share on other sites More sharing options...
Macha Posted August 14, 2010 Share Posted August 14, 2010 (edited) If you look at the Position data you see that all objects start at 0,0,0. I don't know why it does that but could you find a way to get at the original world position and then add it to each? I admit, a bit of a hack... They don't do that in mawi's file so I guess it is a glue object specific thing. I dimly remember having such a problem a while ago. Edited August 14, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
Macha Posted August 14, 2010 Share Posted August 14, 2010 (edited) Something like this here appears to give the right distance. While doing it I noticed that your initial position of the sphere SOP does something weird to the dops position, so I moved the it into the geometry context. I got to run now so I don't have time to pursue it but that could be one of the problems. Brickwall_edit_dist.hipnc Edited August 14, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 14, 2010 Author Share Posted August 14, 2010 I didn't have the time to work on the issue today, but it's a common thing that objects get the coordinates 0,0,0 when importing the into a dopnet either with RBD Glue Object oder with the RBDfracturedObject. it's very annoying that it doesn't keep the position data and I don't know how to get rid of this problem ... Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 15, 2010 Author Share Posted August 15, 2010 hey Marc, did you have another chance to look at the problem over the weekend? I tried playing around with the sop solver to calculate the distance at sop level, but I had no luck. Really could use another clue ! So if you could push me into the right direction I'd be very happy regards, Manu Quote Link to comment Share on other sites More sharing options...
Macha Posted August 15, 2010 Share Posted August 15, 2010 Didn't my last posted file calculate the correct distance? Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 16, 2010 Author Share Posted August 16, 2010 oh damn it, I should have looked more closely. I guess it was late in the evening when I looked at your file. It seems to provide the right distance value, I guess tonight I can finally make good process with this thingy thanks for your help !! Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted August 18, 2010 Author Share Posted August 18, 2010 ok guys, I made some progress but I'm still not satisfied with the result. Thanks to Macha I could create a proper distance creation (but only if $FF>1, at Frame 1 the coordinates are still 0,0,0 strangely) To make the distance test work I have to increase the substeps to 4, otherwise the collision will be not detected as the sphere moves too fast. Can I improve the workflow yet? The simulation takes incredibly long although I'm only using low-res geometry. Another weird thing/problem: The Active Value Dop activates only bricks that are in either the dist_grp or the hit_grp, but when the sphere collides, the whole wall shifts and wobbles, how is that even possible? I've attached my latest scene and look forward to your suggestions! cheers and good night, Manu Brickwall_edit_03.hipnc 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.