10-07-2012, 07:34 AM
I've been thinking about a better concept in regard to animated models (specifically players). I don't know if this is already possible with iqm, so it might require engine changes first. My suggestion is to separate model files and animation data, similar to how skins / textures are separated from the model itself.
Currently, exporting player models requires the final iqm file to contain the mesh, skeleton and the animations. I'm suggesting that instead, the player's iqm only contains the mesh and skeleton with no animation data. Animations would either be a separate file, or preferably a folder where each animation is its own file. The character configuration would then specify the animation package to use (eg: xonotic-data.pk3dir/models/player/erebus.iqm_0.txt). Obviously, this means the skeleton of the model must contain the same bones the animation file is meant to work with. If however there are bones in the mesh that don't exist in the animation, don't animate them... whereas if there are bones in the animation that the mesh doesn't have just ignore them. This would allow some freedom on the rig if someone adds or removes unimportant bones. Ideally, each animation would only reference and address the bones it needs to move, rather than having a list with all of them.
There are mainly three reasons why I'd like this feature. The most important one is that this would not require editing and exporting all player models when a new animation is added to the code (like the crouch-strafing or shotgun slap were). I recently had to re-rig one of my meshes to the Erebus skeleton in Blender so I could update the animations on it. If animations were kept separate, one would simply make a new animation, export it, place it in the correct folder, and it work. No need for anyone who's created a player model in the past to modify their meshes... once again as long as they don't modify the skeleton on their mesh.
Second reason is that this would allow configuring multiple characters using the same model to use different animations. Say someone decides to make a zombie based on the Ignis model. He doesn't need to modify the model itself and can only create a zombie version of the texture as a new skin. However, he'd want the character to walk and crawl like a zombie. For this he'd need to maintain a parallel version of the Ignis mesh, with a different set of animations. If animations are separate, he can create those independently or use an animation set made by someone else. You could also make each character use a specific walk cycle and movements with skins.
Third reason is file size. Less important since animation data doesn't take up a lot, but it's always a good thing to not duplicate something when you don't need to. Since we have LOD's too, each LOD model has to contain the same animation data, which is pretty pointless. And as long as Erebus and Nyx don't move differently, why duplicate the same animations in each?
My question is if DarkPlaces currently supports separate animations for the IQM format. If it does, are there instructions on how to export them in Blender? If so and the other developers agree, I can try to do this for all official models and put my changes on GIT.
Currently, exporting player models requires the final iqm file to contain the mesh, skeleton and the animations. I'm suggesting that instead, the player's iqm only contains the mesh and skeleton with no animation data. Animations would either be a separate file, or preferably a folder where each animation is its own file. The character configuration would then specify the animation package to use (eg: xonotic-data.pk3dir/models/player/erebus.iqm_0.txt). Obviously, this means the skeleton of the model must contain the same bones the animation file is meant to work with. If however there are bones in the mesh that don't exist in the animation, don't animate them... whereas if there are bones in the animation that the mesh doesn't have just ignore them. This would allow some freedom on the rig if someone adds or removes unimportant bones. Ideally, each animation would only reference and address the bones it needs to move, rather than having a list with all of them.
There are mainly three reasons why I'd like this feature. The most important one is that this would not require editing and exporting all player models when a new animation is added to the code (like the crouch-strafing or shotgun slap were). I recently had to re-rig one of my meshes to the Erebus skeleton in Blender so I could update the animations on it. If animations were kept separate, one would simply make a new animation, export it, place it in the correct folder, and it work. No need for anyone who's created a player model in the past to modify their meshes... once again as long as they don't modify the skeleton on their mesh.
Second reason is that this would allow configuring multiple characters using the same model to use different animations. Say someone decides to make a zombie based on the Ignis model. He doesn't need to modify the model itself and can only create a zombie version of the texture as a new skin. However, he'd want the character to walk and crawl like a zombie. For this he'd need to maintain a parallel version of the Ignis mesh, with a different set of animations. If animations are separate, he can create those independently or use an animation set made by someone else. You could also make each character use a specific walk cycle and movements with skins.
Third reason is file size. Less important since animation data doesn't take up a lot, but it's always a good thing to not duplicate something when you don't need to. Since we have LOD's too, each LOD model has to contain the same animation data, which is pretty pointless. And as long as Erebus and Nyx don't move differently, why duplicate the same animations in each?
My question is if DarkPlaces currently supports separate animations for the IQM format. If it does, are there instructions on how to export them in Blender? If so and the other developers agree, I can try to do this for all official models and put my changes on GIT.