Jump to content

Blender: Difference between revisions

3,208 bytes added ,  7 September 2021
ADDED subheader "Oni-specific issues with Blender header" and MOVED subheaders "Rotation order issue between Oni and Blender", "Broken alpha transparency and Textures on animated models" FROM article "Editing Creating an animation rig in Blender"
m (general wiki and language touchup on new material)
(ADDED subheader "Oni-specific issues with Blender header" and MOVED subheaders "Rotation order issue between Oni and Blender", "Broken alpha transparency and Textures on animated models" FROM article "Editing Creating an animation rig in Blender")
Line 168: Line 168:
         bpy.ops.object.visual_transform_apply()
         bpy.ops.object.visual_transform_apply()
         bpy.ops.anim.keyframe_insert_menu(type='BUILTIN_KSI_LocRot')</pre>
         bpy.ops.anim.keyframe_insert_menu(type='BUILTIN_KSI_LocRot')</pre>
==Oni-specific issues with Blender==
===Rotation order issue between Oni and Blender===
The previous XSI process allowed us to get to work pretty quickly: you could simply export any animation from Oni as a COLLADA file using OniSplit, then import it to XSI and it would work (mostly) without any quirks. That is not the case with Blender.
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".
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.
{| class="wikitable"
|-
! KONCOMcomb_p in Blender's XYZ !! KONCOMcomb_p in ZYX
|-
| [[Image:ARB KONCOMcomb p XYZ.png|500px|frameless]]
| [[Image:ARB KONCOMcomb p ZYX.png|500px|frameless]]
|}
Because of this, geyser implemented the '''-blender''' argument in OniSplit, which solves this problem by converting Oni assets' rotation order from XYZ to Quaternions and then to ZYX, and vice versa when exporting assets from Blender to Oni. So that conversion flow looks as follows:
*From Oni to Blender:
XYZ → Quaternions → ZYX
*From Blender to Oni:
ZYX → Quaternions → XYZ
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===
'''Currently there is no option in OniSplit that would allow exporting animated models with textures.''' While you don't need textures for animating, they are very useful, particularly in case of Oni - the models are low detail to a point where you can lose sense of which direction elbows and knees are facing, if you don't have the textures on.
Because there is no option to export animated models with textures, '''the current workaround for that is to import an unanimated model with textures, then import an animated model,''' and either copy materials from the unanimated model to the animated one (the faster method), or set the materials on the animated model manually.
You will also most likely need to set shading settings on some body parts on the unanimated model to fix Alpha transparency issues (much like in XSI) - specifically connect the Alpha parameter of Base Color node to any parameter in Principled BSDF that will work, like Emission Strength (this should be set up differently as that's technically incorrect, but I don't know how at this moment).
{| class="wikitable"
|-
! Konoko upon importing to Blender !! Fixed transparency !! Copying materials !! Setting materials in Shading
|-
| [[Image:ABR Konoko broken alpha.png|200px|frameless|center]] || [[Image:ABR_Konoko_fixed_alpha.png|200px|frameless|center]] || [[Image:ABR_Copying_materials.png|200px|frameless|center]] || [[Image:ABR Konoko fixed alpha.png|200px|frameless|center]]
|-
|}


[[Category:Bi-platform modding tools]]
[[Category:Bi-platform modding tools]]
191

edits