revelationsr Posted June 5 Share Posted June 5 Hello. I am using a Vellum SOP solver. I have a grid animated, it is following a path. I have a matching geo of the grid being simulated. I have attached a "target to geometry" constraint so the simulated cloth is now following the animated cloth attracted to the matching point order. With in the vellum solver (so at simulation time) I would like to change the stiffness of this constraint. I have a geometry wrangle that is bind to the "ConstrainGeometery" and I have a group to isolate the constraints. So I can change at sim time the stiffness. This works as expected. So far so good. My problem is the next step. I want to measure the length of the constraint. Some how I want to grab each constraint. Find the 2 points that makes it up. Then measure that distance. Ultimately I want to plug that into a ramp and manipulate the stiffness based on how far apart the sim geo points are from the animated points. Example. Close low pull. Far high pull. Any thought would be appreciated. clothConstraintTest.hipnc Quote Link to comment Share on other sites More sharing options...
fencer Posted June 5 Share Posted June 5 Geometrywrangle > Inputs > Input 1 > Myself // stiffness is working because now it no longer is "stuck" to the animated geo @stiffness = .001; // find pt0 // find pt1 int pt0 = primpoint(0, @primnum, 0); int pt1 = primpoint(0, @primnum, 1); vector pt0p = point(0, "P", pt0); vector pt1p = point(0, "P", pt1); // length = (pt0, pt1) f@rlength = length(pt0p-pt1p); // chf get max_distance float md = ch("max_distance"); // normalized_length fit01 ( 0, max_distance) //chramp ("stiffness ramp" , normalized_length) f@nrlength = chramp("stiffness_ramp", fit(f@rlength, 0, md, 0, 1)); //chf get stiffness_multiplier //float stiffness = ramp_value * stiffness_multiplier; @stiffness = f@nrlength * ch("stiffness_multiplier"); //f@stiffness = stiffness; Quote Link to comment Share on other sites More sharing options...
revelationsr Posted June 5 Author Share Posted June 5 @Fencer. Thank you for the response. What I had originally is very close to what you have there. I put it in the setup and it is not working. I honestly dont know what I am missing. The scene bellow has the script above in it. In theory the cloth should rise up and when it gets about 1/4 of a meter away it should yank towards the animated geo. clothConstraintTest.hipnc Quote Link to comment Share on other sites More sharing options...
fencer Posted June 5 Share Posted June 5 30 minutes ago, revelationsr said: @Fencer. Thank you for the response. What I had originally is very close to what you have there. I put it in the setup and it is not working. I honestly dont know what I am missing. The scene bellow has the script above in it. In theory the cloth should rise up and when it gets about 1/4 of a meter away it should yank towards the animated geo. clothConstraintTest.hipnc 618.85 kB · 0 downloads Set wrangle input Geometrywrangle > Inputs > Input 1 > Myself Analyze data before choosing values and final multiplier. Quote Link to comment Share on other sites More sharing options...
revelationsr Posted June 5 Author Share Posted June 5 Input "myself" ! Well poopy. There is the missing piece of the puzzle. Thank you so much man! 1 Quote Link to comment Share on other sites More sharing options...
revelationsr Posted Monday at 09:24 PM Author Share Posted Monday at 09:24 PM Hello. I have noticed a problem with the setup. I assumed the script was working but after getting some odd results I realised there is something off. There is a "attach to geometry" constraint. The point of the script was that in the cloth sim it would take each constraint on each frame. Measure its distance from current cloth location to attached geometry. Then take that length and put it on a ramp to control that constraints stiffness. Example. Close = loose far = stiff I dont think the script is reading the 2 points Position that make up the constraint correctly. I noticed this when I plugged a color node to read the attribute "rlength" (the attribute that measures distance from point 0 to point 1). It was white ( meaning 1 ) constantly for everything until the happens to pass close the world centre (0,0,0). Then I would see black starting to appear on the points closest to world centre. This means that at least one of the two points are coming up 0,0,0. Any thoughts? clothConstraintTest.hipnc Quote Link to comment Share on other sites More sharing options...
revelationsr Posted Tuesday at 01:45 PM Author Share Posted Tuesday at 01:45 PM Solved. Thank you 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.