lsalzman / iqm

Inter-Quake Model format development kit
MIT License
244 stars 72 forks source link

Exporting .iqm file from a Blender armature with non-connected bones causes mangled animations #54

Open AndreaJens opened 2 years ago

AndreaJens commented 2 years ago

Affected version of the script: Blender exporter, both version 2.74 and 2.9.3. Tested with: Blender 2.79, Blender 2.9.3 (same outcome); various other models with disconnected bones (same outcome)

Description: I am using the following 3D model, with an armature rig, in Blender 2.9.3 and exporting it via the iqm script: issue1

When I play any exported animation after importing the .iqm file in Raylib, the armature is completely mangled, as if each disconnected component was referring to a different origin: issue2

As the raylib code seems to work with models that were originally built in the .iqm format, I assume it is an issue with the exporter, especially considering how this might be linked to this comment on Issue #41.

Any idea what about what the problem could be?

Link to the model: LazorLoyra_293.zip

lsalzman commented 2 years ago

No idea offhand, but are all the bones properly parented to something that is ultimately parents up the chain to the root bone?

AndreaJens commented 2 years ago

Hi, thanks for the response. Unfortunately, I am not really an expert on how Blender saves armatures "under the hood". In the attached model, there is one (disconnected) parent bone that acts as a root, while arms and legs are parented to some of the child bones with the "keep distance offset" control. image I hope this piece of information might be useful!

lsalzman commented 2 years ago

I am not sure what is going on really, but maybe explore if the "keep distance offset" thing is the problem?

AndreaJens commented 2 years ago

Okay, I will check if a connected armature works until the end of next week and report on it👍 So far, I tested the export with two other armatures with disconnected sections and I have seen similar issues. It might be that:

If I find out that this is an armature type issue and it isn't supported, I will try some other export formats instead, thanks anyway!