Vex modifing @P: how to update @N?

   1068   3   0
User Avatar
Member
1004 posts
Joined: 4月 2017
Offline
Hi!

I'm using vex to animate a "bend" on paper pieces (they have thickness). It's all good but the normals dont change. The result is a bent silhouette but with flat normals (same normals it had before the bend started).

I need the normals to "turn" so it matches what my @P bend is doing. I don't want to use a normal sop on it as it could create new hard edges mid animation that would POP during animation.

-Olivier
User Avatar
Member
8525 posts
Joined: 7月 2007
Offline
either use Bend SOP directly
or if you need to use custom vex deformer implement it in Deformation Wrangle, so that the derivatives would be used to compute the full deformation transform per point and not just position offset
you will have to make sure your vex function is spatially continuous or you can also provide full xform matrix per point yourself
Edited by tamte - 2021年4月21日 13:07:05
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1004 posts
Joined: 4月 2017
Offline
Ah, I see. I was starting to think I needed to work with matrices. At the moment, I'm just doing something like:
@P += v@BendDirection * f@BendMask

But If I use a matrix and give it a "bend", I should be able to use that matrix on both @P and @N right?

I've never used the Deformation Wrangle so I think I'll avoid it this time since I'm in a rush!

Thanks for the info!
User Avatar
Member
7737 posts
Joined: 9月 2011
Offline
olivierth
Ah, I see. I was starting to think I needed to work with matrices. At the moment, I'm just doing something like:
@P += v@BendDirection * f@BendMask

But If I use a matrix and give it a "bend", I should be able to use that matrix on both @P and @N right?

I've never used the Deformation Wrangle so I think I'll avoid it this time since I'm in a rush!

Thanks for the info!

If you have the matrix, then the transformbyattribute sop can apply the rotation to the normals.

If not, then the deformation wrangle can compute the matrix from the jacobian of the deformation. In order for that to work though, the deformation has to be a function of 'pos', rather than a per point attribute. Otherwise the deformation won't vary spatially and there's nothing to compute the derivative of.

If all bets are off, just check the box on the attribute vop to recompute normals when position is changed. This is similar to appending a Normal sop.
  • Quick Links