SphericalCow Posted March 27, 2017 Share Posted March 27, 2017 Hello OF, I have a small issue which I hope you can help with... I am creating attributes at SOP level to control the breaking of constraints in a SOP Solver in DOP's using the following VEX code in an attribute wrangle connected to 'relationship geometry' of the SOP solver. if (s@constraint_name == "pin_between"){ if ((f@torque>@break_torque||@angle>@break_angle||f@force>@break_force)){ s@constraint_name = "pin_broken"; i@breakframe = @Frame; } } My issue is that when I disable one of these attributes at the SOP level, the sop solver seems to interpret it at a value of 0, and the objects constraint will be completely removed on collision. Is there a better function to use than 'or' in this situation? An 'if else' seems more appropriate, but I am unsure of the syntax of that in this situation within VEX. Any help would be greatly appreciated. Many thanks in advance. Quote Link to comment Share on other sites More sharing options...
tamagochy Posted March 28, 2017 Share Posted March 28, 2017 All correct. When sop not create atribute but in wrangle you write it it equal 0. If you disable atribute in sop you have to delete it in wrangle. Quote Link to comment Share on other sites More sharing options...
SphericalCow Posted March 28, 2017 Author Share Posted March 28, 2017 That makes a lot of sense Tamagochy. Thanks for the info. Quote Link to comment Share on other sites More sharing options...
johanfx Posted June 7, 2018 Share Posted June 7, 2018 Hello i'm trying to break my hard or glue constraints but it doesn't work if (@constraint_name == "hard"){ if (f@torque > 7500 || f@angle > 10 ){ s@constraint_name = "hard_broken"; }} Quote Link to comment Share on other sites More sharing options...
tamagochy Posted June 7, 2018 Share Posted June 7, 2018 (edited) hard constraint use force only. Try this if (@constraint_name == "hard" && length(@force)>1000){ s@constraint_name = "hard_broken"; } or I use this one if(@constraint_name == "hard"&& length(@force)>1000) removeprim(0,@primnum,0); Glue constraint used strength attribute to brake Edited June 7, 2018 by tamagochy Quote Link to comment Share on other sites More sharing options...
johanfx Posted June 13, 2018 Share Posted June 13, 2018 none of those are working. could please send me a set up file. so i could see it please!! Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted June 13, 2018 Share Posted June 13, 2018 (edited) 3 hours ago, johanfx said: none of those are working. could please send me a set up file. so i could see it please!! Strange it doesn’t work... maybe it is breaking and deleting the primitive correctly, but reimporting it from sop afterward ? To avoid that, check if your constraint network in SOP context (outside DOP, where the Geometry Source of you Constraint Network is pointing to) is « animated » or considered time dependent. In this case, you have to manually set Overwrite with SOP to 0 on the Constraint Network DOP node, and delete the default expression inside this parameter. In short, it will import your network once at the start, and then relationship will live only inside DOP without being updated from SOP. And check that your display flags are set correctly to your last node in SOP Solver, sometimes i make this simple mistake :-) Edited June 13, 2018 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
johanfx Posted June 13, 2018 Share Posted June 13, 2018 Thanks it really help finally got everythin working right 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.