Jump to content

How to import and fix dae animation for reexport when there is no blend file


Recommended Posts

DISCLAIMER: This will only work on a Blender exported armature. If it was exported by 3dsMax it will be complicated or impossible to get it right. Also if the blend already exists in the art repository you'd better use that instead.

Step 1: Gather all the needed material

In order to make a clean project and make it nice for the people coming after him (so that no one has to do further editing), one should try to keep things organized. You can refer to this guide: Organizing your blender folder We will assume this convention for the rest of this guide. We will use the boar mesh as a demonstration.

  • First head to your local SVN or GIT copy of the game. See Build Instructions
  • Go to the following location to find the textures of the mesh you are trying to import:

 

binaries/data/mods/public/art/textures/skeletal
  • We are looking for this specific texture
animal_boar.dds
  • Notice it's a DDS texture. While blender supports it, it should be turned into a PNG, as it will be easier for people afterwards to edit it as it is more widely supported.

Info: You can find more information about the DDS image format here: DirectDraw_Surface

  • To convert it, either use you favorite graphics package, or do it in blender. Load the texture in the UV editor, and save it as PNG in the export/textures folder.

Important: Skip this step if the texture has any kind of alpha transparency used for clothing in the game. Else you will loose that information. There are a few tricks to keep it as is.

To do: Write a tutorial about this.

  • Then we need the mesh. You can find it here:
binaries/data/mods/public/art/meshes/skeletal
  • The file is:
boar.dae

Info: Notice the naming convention is incorrect it should have the "animal_" prefix, or should be put in a folder called animals. It could also be named:

fauna_boar.dae
  • Then we need all the animations. You can find them there :
binaries/data/mods/public/art/meshes/skeletal

Once you have gathered all of them put them in the import/meshes folder.

Step 2 Importing in Blender

  • Launch Blender
  • Delete everything in the scene.
  • Go to file / import/ collada select the base mesh (Do not forget to tick import units else you might run into trouble later)

Optional: Clear any material on the mesh and use the default one.

  • Depending on your renderer set up the material so that it uses the texture you put in import earlier
  • Clear anything you do not want in the scene especially the default anims. Unlink them from the armature as well

Import Process:

  • Import the first animation. For instance the walk collada file in the scene.
  • Switch to the animation layout.
  • Switch from dope sheet to action editor

DopeSheet.png

  • You should have at least two armature action_xxx
  • The one you want is the one attached to the armature.
  • Rename it boar_walk_01
  • Mark the other for deletion by shift clicking on the little X near it.

xmarker.png

  • Apply it to your first armature, and delete this imported one.
  • Make sure the little F is ticked near the animation name, else it won't be saved.

fmarker.png

  • Save and reload.
  • Import all the animation as described previously in the import process
  • This is not over yet.
  • For some reason each imported bone will have custom properties and those are the ones that screw up when re-exporting the animation. To fix those you must
  • Open the armature in edit mode and delete all those custom properties.

custom properties.png

Tip: In Blender one cannot simply delete materials or textures or animations you have to reload the scene after marking one of those for deletion. Else they will stick around. I think it’s a good practice to remove useless elements from your scene. First that reduces somewhat the blend file size then it makes it easier to find the animations you are looking for and finally were you to append materials from another blend file it will be easier to find especially if you set a good name.

Note: For the armature to work again you'll have to re-export every single animation. Also due to the nature of Blender armatures you'll probably have to update the skeleton file. I’ve made a handy script you can find there:

Also, sometimes the armature becomes too similar to another one and the game gets confused. So, you'll have to rename every bone. That's a rather annoying process especially if you have a lot of animations. This tutorial will guide you:

I attached the final blend file so you can see an example.

boar-10.blend

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...