how to find primitives with broken constraints(coneTwist)
2931 6 0- behzad_ph
- 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 .
- N-G
- 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.
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.
- behzad_ph
- Member
- 27 posts
- Joined: Nov. 2017
- Offline
N-Gthank 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 :
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.
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]
- N-G
- Member
- 209 posts
- Joined: March 2018
- Offline
- behzad_ph
- Member
- 27 posts
- Joined: Nov. 2017
- Offline
N-Gthat 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
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.
- N-G
- 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.
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
- behzad_ph
- Member
- 27 posts
- Joined: Nov. 2017
- Offline
-
- Quick Links