revelationsr Posted Thursday at 09:43 AM Share Posted Thursday at 09:43 AM 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 Thursday at 11:12 AM Share Posted Thursday at 11:12 AM 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 Thursday at 12:51 PM Author Share Posted Thursday at 12:51 PM @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 Thursday at 01:29 PM Share Posted Thursday at 01:29 PM 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 Thursday at 02:07 PM Author Share Posted Thursday at 02:07 PM Input "myself" ! Well poopy. There is the missing piece of the puzzle. Thank you so much man! 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.