Kinefx joint orientation - how to swap axis (axes)

   1047   2   2
User Avatar
Member
67 posts
Joined: April 2019
Offline
I've imported an FBX character, which includes the joint orientations in the transform matrix.

For example:



However, I would like to reorient the joints so that the x axis is pointing down the bone and the the z axis is point out, where the x axis was previously pointing.



How can I do this using either vex, vops or python?

I know about the orient joints node, however I want to do it procedural rather then eyeballing it, using the imported orientations but just swapping the axes around.

Hoping someone can point me int he right direction regarding the maths etc for achieving this.

Thanks!

Attachments:
Untitled-2.jpg (19.2 KB)
Untitled-1.jpg (109.4 KB)

User Avatar
Member
8752 posts
Joined: July 2007
Offline
from title I'm assuming your Y axis is already aligned with the bone direction an you just want to "swap" axes
try this in a point wrangle

vector angles = {-90, 0, -90};
prerotate(3@transform, radians(angles), 0);

adjust the angles as needed for different axes "swap"
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
67 posts
Joined: April 2019
Offline
That does the job perfectly.

Thanks so much!
  • Quick Links