I've been playing with the new 'shape match' constraint in vellum, but can't work out how to dynamically scale them during the sim. Normal approach would be to animate rest length scale, which would let you make the simmed objects bigger or smaller. When using 'shape match' however, the rest-length is always set to 0, making any scaling redundant.
Is it not possible to animate these constraints?
Thanks!
Vellum Shape Match Constraint - How to animate rest scale?
1907 5 1-
- rorymclean3D
- Member
- 6 posts
- Joined: Jan. 2019
- Offline
-
- tamte
- Member
- 9417 posts
- Joined: July 2007
- Offline
-
- rorymclean3D
- Member
- 6 posts
- Joined: Jan. 2019
- Offline
-
- kgfx
- Member
- 2 posts
- Joined: Jan. 2019
- Offline
Hi there - I'm aware this is an old topic, so I apologize for reopening.
I have been unable to get the first option to work as suggested by Tomas (animate v@rest point attribute on the ConstraintGeometry)
I have attached a simplified build as an example -
I am sourcing geometries that are split into two groups (idGrp 1 and 2), which are then assigned different constraint properties based on their group at sop level.
One of the groups uses shape match constraints, but I'd like the Nage attribute I've created (based on @TimeInc) within the dopnet to drive the scale of the Shape Match ConstraintGeometry - I've created a 'stretchSM' group on the vellum constraint, which I'm referencing in the dopnet.
I don't want to use a shape blend, as eventually I'll be sourcing lots of different shapes randomly, and the first method seems the simplest.
Any help or further guidance would be much appreciated.
Thanks! - K
I have been unable to get the first option to work as suggested by Tomas (animate v@rest point attribute on the ConstraintGeometry)
I have attached a simplified build as an example -
I am sourcing geometries that are split into two groups (idGrp 1 and 2), which are then assigned different constraint properties based on their group at sop level.
One of the groups uses shape match constraints, but I'd like the Nage attribute I've created (based on @TimeInc) within the dopnet to drive the scale of the Shape Match ConstraintGeometry - I've created a 'stretchSM' group on the vellum constraint, which I'm referencing in the dopnet.
I don't want to use a shape blend, as eventually I'll be sourcing lots of different shapes randomly, and the first method seems the simplest.
Any help or further guidance would be much appreciated.
Thanks! - K
-
- tamte
- Member
- 9417 posts
- Joined: July 2007
- Offline
v@rest on ConstraintGeometry is a point attribute so your wrangle has to be set to Points
then your code:
would completely override it which would result in all points having the same value and therefore shape would be a single point
but even if you did this:
it would just scale v@rest from previous timestep, resulting in exponential scaling, which is likely not what you want either
one way is to store the original v@rest in another attribute like v@restorig, you can do it in SOPs or even generally create it on the fly in DOPs for pieces that don't have it yet
then your code:
v@rest = stretch;
but even if you did this:
v@rest *= stretch;
one way is to store the original v@rest in another attribute like v@restorig, you can do it in SOPs or even generally create it on the fly in DOPs for pieces that don't have it yet
int pt = primpoint(0, @primnum, 0); float age = point(1, "Nage", pt); float stretch = fit01(age,chf("min"), chf("max")); if( i@has_restorig == 0 ) { v@restorig = v@rest; i@has_restorig = 1; } v@rest = v@restorig * stretch;
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- kgfx
- Member
- 2 posts
- Joined: Jan. 2019
- Offline
-
- Quick Links


