Jump to content
Sign in to follow this  
toothpaste

Vellum SOP - update pin group over time

Recommended Posts

Making a shower curtain vellum SOP set up, having trouble updating the pin constraint group, need help.

What I have done:

1. Group points to 'pin' group using animated bounding object to simulate curtain being pulled and snapping from the curtain rod.

2. Pipe cloth into vellum system, using the 'pin' group in a vellum constraint set too pin.

3. Here's where I need help, I don't know how/where to use a sop solver to update the 'pin' group frame to frame.  Does this solution differ when using vellum in DOPs?

4. Is there an '@active'-like attribute in vellum SOPs I can use to tell them when to enter and exit simulation?

 

I've attached a quick example file, please take a peek if you can.

Thanks!

vellum_update_pinConstraint_HELP.hipnc

Edited by toothpaste

Share this post


Link to post
Share on other sites

Thanks for your help Noobini!

I also want to do a snapping off animation ( someone pulling on the shower curtain to snap off the points one by one / release from the 'pin' group ), and I am animating the bounding object to try to achieve that, while it is updating in SOPs ( I see the points entering and leaving the group in the spreadsheet ) it is not transferring the updates into the vellum solver, could you help me solve this problem as well please?

Thanks!

Share this post


Link to post
Share on other sites

i'd say it's possible with a wrangle in the solver SOP (delete the constraint i'd say) but i'm not much of a coder. Will have a try anyway but I reckon @anim can write this up in seconds.

Share this post


Link to post
Share on other sites

there is couple of ways, but since it seems you only need hard pin contraints update and you are already basing everything off of a group here is the easiest way for your case

1. set Pin Type to Stopped, which will use @stopped attribute to define what's pinned instead of zero @mass, this makes it easier to unpin stuff as the actual @mass is not lost for pinned points

2. inside of the solver subnet, add POP Wrangle for example, bind first input to First Input Geo and use:

i@stopped = inpointgroup(0, "pin", @ptnum);

 

vellum_update_pinConstraint_HELP_fix.hipnc

Edited by anim
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Tomas! That solution worked as I expected!

To clarify what this piece of vex code does:

inpointgroup(0, "pin", @ptnum) : return True or False ( 1/0 ) based on if the current pt in input [0] is in group 'pin'

then assigning the value to the stopped attribute on each point in the vellum system

if stopped = 1, hard constraint is maintained

if stopped = 0, hard constraint is turned off 

 

PS. I really like this solution because it allows me to animate the bounding object back over the unpinned points to constraint them again in the same vellum system.

 

 

Thanks!

Share this post


Link to post
Share on other sites

Cool! That's a real smart way to get the same result without coding!  8)

Thanks for showing me another way to do it!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×