how to find primitives with broken constraints(coneTwist)

   2932   6   0
User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
hi everyone , i've got a test project and i'm working on ConeTwist constraints and i'm trying to find the primitives whose constraints are broken.. so you can apply force to those specific pieces or tweak them by something and in general i want to have control on them .. i've been searching through the community and found some helpful stuffs, but had nothing to do with ConeTwist and it was for a GlueConstraintm cuz it was a little different .. i'll attach the file and i'll be really grateful if someone takes a look into it and help .. thanks a lot .

Attachments:
finding_prim_with_broken_constraints.hipnc (196.9 KB)

User Avatar
Member
209 posts
Joined: March 2018
Offline
Hello Behzad.
You should connect SOP Solver to third input of Constraint Network not to bullet solver.
After doing that, you can access to broken group and put constraints in or even bring them back.
You can iterate over all primitives and query for their specific attributes on primitive level.
Have a look at attached HIP file.

Attachments:
finding_prim_with_broken_constraints_FIXED.hipnc (214.6 KB)

User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
N-G
Hello Behzad.
You should connect SOP Solver to third input of Constraint Network not to bullet solver.
After doing that, you can access to broken group and put constraints in or even bring them back.
You can iterate over all primitives and query for their specific attributes on primitive level.
Have a look at attached HIP file.
thank u so much for this quick reply .. but yeah i knew that and i experimented with it, but since i wanted to apply a velocity on those primitives that have been detached from their constraints, i tried to have a go at a setup like that, but i didn't change it afterwards, sorry do you have any idea how it can be accomplished ? i tried the following vex code :
i have relationship_geometry connected to second input of prim wrangle ..

i@idx = findattribval(1,“point”,“name”,s@name);
i@prims = pointprims(1,@idx);
if(prim(1,“angle”,i@prims) > 0.2))
{
reomveprim(0,@primnum,0);
}

this link was pretty helpful..
http://forums.odforce.net/topic/31190-solvedset-velocity-on-glue-bond-rbd-piece/ [forums.odforce.net]
User Avatar
Member
209 posts
Joined: March 2018
Offline
OK.
I've fixed it.
It is simpler than what you want but I think it will help you.
See attached HIP file.
Hope it helps.

Attachments:
finding_prim_with_broken_constraints_FIXED 2.hipnc (232.1 KB)

User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
N-G
OK.
I've fixed it.
It is simpler than what you want but I think it will help you.
See attached HIP file.
Hope it helps.
that was a nice trick you used, was really helpful, although the velocity is not affecting per object .. i think that's why the entire thing starts to fly away, not just those pieces which were detached from constraints .. if we change operator priority in merge node(rbd packed obejcts), we can fetch all the primitives in sop solver attached to the multi_solver as far as i tested .. but of course i still can't get it to work right .. i'm grateful for your time @N-G
User Avatar
Member
209 posts
Joined: March 2018
Offline
You should use findattribvalcount VEX function because for each rbd packed object you have multiple point on cone twist constraint with the same name attribute.
In below link you can see an example to how to use this function alongside with findattributeval function.
http://www.sidefx.com/docs/houdini/vex/functions/findattribval.html [www.sidefx.com]
So:
-You need a point wrangle and connect main rbd packed object to first and constraint network to second input.
-For each rbd packed object iterate over constraint points and collect all attributes on them based on name.
-assign that to your main rbd object.
write the code and ask question if you have.
Edited by N-G - March 23, 2018 11:14:18
User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
@N-G you're so nice and i really appreciate the time you put into this.. i think that i finally made this work, here is the scene ..
i will test out your approach again.. thank you so much @N-G, you helped a lot ..

Attachments:
finding_prim_with_broken_constraints_all_fixed.hipnc (216.1 KB)

  • Quick Links