Blender: Difference between revisions

780 bytes added ,  14 May 2022
→‎Rotation order issue between Oni and Blender: Updated info on rotation order issue between Oni and Blender
(→‎BlenderOni: Filled BlenderOni)
(→‎Rotation order issue between Oni and Blender: Updated info on rotation order issue between Oni and Blender)
Line 69: Line 69:
If you import any Oni animation into Blender as it is, the rotations will be all wrong.
If you import any Oni animation into Blender as it is, the rotations will be all wrong.


That's because Oni's rotations are stored in XYZ Euler rotation order, while Blender's XYZ is actually ZYX despite being called "XYZ".
That's because Oni's rotations are stored in XYZ Euler rotation order, while Blender's XYZ is actually ZYX despite being called "XYZ" - and this is because Blender reads the Euler angles from the bottom of the hierarchy, rather than the top:
 
{{Quote|Which axis is on top, which one in the middle and which at the bottom, depends on the particular Euler gimbal: there are six types of them, as there are six possible combinations: XYZ, XZY, YXZ, YZX, ZXY and ZYX Euler rotation modes. '''These modes are named using the letters of the axes in order, starting from the axis at the bottom of the hierarchy, and finishing with the one on top.'''|[https://docs.blender.org/manual/en/latest/advanced/appendices/rotations.html Blender Manual, Rotation Modes] }}
 
In other words, Oni reads XYZ as X first, Y second and then finally Z, while Blender does reverse, it reads XYZ as Z first, Y second and Z as the last angle.


You can prove that by simply switching the rotation order of the body parts from XYZ to ZYX, as shown below – the image on the left shows KONCOMcomb_p imported to Blender without any adjustments, with the rotation order set to Blender's default "XYZ", while the image on the right shows the same animation after switching the rotation order to ZYX.
You can prove that by simply switching the rotation order of the body parts from XYZ to ZYX, as shown below – the image on the left shows KONCOMcomb_p imported to Blender without any adjustments, with the rotation order set to Blender's default "XYZ", while the image on the right shows the same animation after switching the rotation order to ZYX.
Line 90: Line 94:


To summarize: '''Always use the -blender argument when you're exporting assets from Oni to Blender''', otherwise you can expect the problem shown in the above screenshots.
To summarize: '''Always use the -blender argument when you're exporting assets from Oni to Blender''', otherwise you can expect the problem shown in the above screenshots.


===Broken alpha transparency and textures on animated models===
===Broken alpha transparency and textures on animated models===
191

edits