MocapStream rotations: how do I matrix?

   139   2   0
User Avatar
Member
55 posts
Joined: 9月 2019
Offline
I've been using the MocapStream SOP to drive blendshapes on my figure, which is a very straightforward and simple process. I was trying to figure out why it wasn't also giving me head and eye rotations when I noticed that they're not detail attributes like the blendshapes, but are stored in a point transform. Matrices are a complete mystery to me, and my best lead so far has been cracktransform(). However, I've only managed to output zeroes:

vector rot;
rot = cracktransform(XFORM_TRS, XFORM_XYZ, 0, {0,0,0}, @transform);

outputs

{ 0.0, 0.0, 0.0 }

whereas the transform matrix (head_rot on frame 1) looks like this:

[ 0.940178, -0.0863294, -0.329566, 0.0298117, 0.984498, -0.172842, 0.339378, 0.152677, 0.928177 ]

I tried to be clever and use a map points SOP, but that wouldn't even capture the transform matrix from MocapStream, so there goes that idea.

How do I do....anything?
User Avatar
Member
8833 posts
Joined: 7月 2007
Offline
A few things:

1. There should be no need to extract euler rotation values just to drive transform of your character, since in KineFX and APEX points with 3@transform attribute are what skeletons are made of so should usually be just a matter of retargetting

2. Make sure you use proper hint for attribute type

So try 3@transform to refer to matrix3 attribute since @transform would assume just float, even though in that case Id assume it would error out

3. To extract rotation, your 3rd argument should be 1, not 0, 0 is for translate and matrix3 doesn't have any translation component
Edited by tamte - 2024年12月20日 06:45:26
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
55 posts
Joined: 9月 2019
Offline
I actually knew the third argument needed to be 1, I probably just changed it in my normal frenzy of randomly changing parameters to see if any of my guesses magically solve the problem. 3@transform did fix the problem, though, so thank you. As for your first point, what would you suggest for retargeting if Map Points doesn't capture the transforms, meaning there's nothing for an FBIK/Rig Copy Transforms to read?
Edited by gordig - 2024年12月20日 07:23:42
  • Quick Links