0
$\begingroup$

I am using blender to import a humanoid model into my unity application. I am currently having an issue in my unity application, I have an external sensor strapped to my leg which sends quaternion data to unity making the humanoid mimic my movement.

The issue I am having is when I lift my leg to the side (SHOULD BE pivot around local z axis) the unity humanoids leg is twisting (pivoting around y axis).

I have tried loads of different approaches to try and swap the y and z axis in my unity application but this just isnt possible using quaternions.

I have decided to see if I can alter the axis on the bone in blender, I basically want to swap the y and z axis so the local z axis is top to bottom and y is front to back.

enter image description here

When I lift my leg to the side I would like the humanoids leg to pivot on y instead of z.

I'm finding it really hard to explain my issue so please feel free to ask any question, it would also be helpful just to know if this isnt possible so I dont waste even more time.

EDIT - Export Settings & Disconnect Screenshot (Refer to Comments)

enter image description here

After disconnecting the parent bones as @Nathan suggested in the comments it seems to have swapped the z and y axis as required but I now have a different issue. When I lift my leg to the side the unity humanoids leg moves to the side but disconnects from the joint.

enter image description here

This is what blender looked like after disconnecting the bones which I wasnt sure is correct

enter image description here

$\endgroup$
11
  • $\begingroup$ have you already tried 'affect only origins' to reorient the bones? You can also try messing around with export settings, depending on how you are exporting to unity. $\endgroup$ – Jay Jan 14 at 16:57
  • $\begingroup$ Select all bones, clear parent->disconnect. Switch to normal orientation, individual origins, then r x 90 enter (rotate 90 degrees in X axis.) The Y axis will then point where the Z axis used to point, and the Z axis will point where the -Y used to point. You can't make the Z point to where the +Y used to point without flipping the X; this is "coordinate system handedness" (which very well may be an issue with your project, DX and OGL use different handedness.) Doing your conversions in Unity is possible, yes, even with quaternions, and if handedness is the issue, will be necessary. $\endgroup$ – Nathan Jan 14 at 17:37
  • $\begingroup$ @Jay What export settings would you suggest using? I am exporting it as a FBX file. $\endgroup$ – Luke Rayner Jan 14 at 18:00
  • $\begingroup$ @Nathan I tried doing what you suggested but I am very new to blender (downloaded it 7 hours ago). I disconnected all the bones from their parents and then using the top options to switch to Normal (Transform Orientation) and the option next to it Individual origins but I'm not sure how to do the next step $\endgroup$ – Luke Rayner Jan 14 at 18:02
  • $\begingroup$ @LukeRayner The next option is, rotate. Hit 'r', hit 'x', hit '9', hit '0', hit 'enter'. This means, rotate it 90 degrees in the X axis. $\endgroup$ – Nathan Jan 14 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.