Need help understanding how to extract additive blendshapes

   1933   5   2
User Avatar
Member
80 posts
Joined: April 2019
Offline
I've been working on extracting blendshapes, to be applied to a skeletal mesh in Unreal, by referencing an alembic cache of the same mesh, which has the corrective blendshapes already baked into it.



By calculating the offset between the point positions on the skeletal mesh and those on the alembic cache, and then applying an inverse of the pose transform, I'm able to create a perfect blendshape for the leg, with the knee bent at 38, 76, 144, 155 degrees.

For example, this is the blendshape for when the knee is bent at a 114 degree angle.



These 4 blendshapes work perfectly when they are applied one at a time at the correct knee bend angles.



However, what I'm really wanting is for each of the blendshapes to be calculated such they can be applied in an additive way, instead of only applying one at a time.

At the moment when I apply them all, they overshoot the reference from the alembic cache.



I understand why this is happening but I cannot get my head around the maths for how to extract the blendshapes in a way that factors in the affect of the previous blendshapes being applied.

For example, when the knee is at a 114 degree rotation, and the first 3 blendshapes all have a weight of 1, the end result should match the alembic cache, rather than overshoot it.

I'm hoping someone can help me with the maths for achieving this.

I've included this example setup in case someone is willing to assist.

Thank you
Edited by mrpdean - Jan. 6, 2023 07:00:58

Attachments:
Untitled-1.jpg (218.9 KB)
Untitled-2.jpg (100.9 KB)
Untitled-1.gif (194.8 KB)
Untitled-2.gif (183.8 KB)
Example.zip (168.8 KB)

User Avatar
Member
542 posts
Joined: Nov. 2016
Offline
Not my area, but I'm thinking instead of calculating the offset from the skeletal mesh, you could calculate it from the previous blendshape. (38 from skeletal mesh, 76 from 38, 114 from 76...)
Edited by Tanto - Jan. 6, 2023 12:37:37
User Avatar
Member
80 posts
Joined: April 2019
Offline
Thanks Tanto. That was the first thing I tried as it seems like the logically solution, however it doesn't work for me.

Oddly, I end up with the exact same blendshape as when I calculate the offset from the original skeletal mesh, which doesn't make any sense to me mathematically. Clearly I'm missing something which I'm hoping will be obvious to others here
User Avatar
Member
9380 posts
Joined: July 2007
Offline
here is a file with your blendshapes corrected to represent difference from previous blendshape

including 2 methods:

1. individually corrected fixed number of blendshapes - if you add new blendshape you need to add new correction
2. procedurally corrected arbitrary number of sequential blendshapes - uses the ability of Blendshape SOP to use packed prims as blendshapes, so the correction happens sequentially on all blendshape primitives i the input geo
therefore if you add more blendshapes it will just work
Edited by tamte - Jan. 7, 2023 02:47:52

Attachments:
Blendshapes_fix.hipnc (322.3 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
9380 posts
Joined: July 2007
Offline
there is also Sequence Blend SOP if you want to have just 1 slider and link its value to different angles (in your case $FF)
and there you could use your original blendshapes as it's essentially blending from 1 to the next (or more if subd or cubic) between each 2 integer values of Input Blend parameter
Edited by tamte - Jan. 7, 2023 03:25:33
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
80 posts
Joined: April 2019
Offline
Thank you very much Tamte. That's brilliant!!

I will study it to understand better how it's working.
  • Quick Links