Exporting the Clonk
Fair warning: This is not a very user friendly guide. I wrote it up in about 15 minutes without polishing it at all, just writing in exactly what was needed. Mostly it is a note to self so I don't forget the steps involved, now that I've figured out how to export without problems 100% of the time.
This is a guide on how to properly export a Clonk model or update/add to the Clonk's animations.
This is not a guide on how to make extra animations for a mod. Sadly, as modular animation structure (each animation as a separate file, ie: gamebryo) is not how OGRE format works. OGRE exports the armature and all animations into a single *.skeleton file. There's not really anything I can do about that.
For mods, it might be possible in the future to have a *.skeleton file containing some new animations and append it to the clonk somehow, like how #append-to works in script. This is totally conjecture though and is at the behest of the engine programmers (read: ck). This might become a necessary feature when OC is done and if people start making expansion packs and mods similar to CR's time.
Loading up the .blend file properly
• Make sure Randrian's Modified OGRE Exporter is installed, not the vanilla one.
• Open two explorer windows; one showing the directory of the ClonkOpenRevolution.blend file, and another showing blender 2.49's executable. Drag the clonk's .blend file onto the 2.49 exe. If you don't load up the clonk's blend file directly it won't load Actions.txt, it seems. (if 2.49 is your default program for .blend files you can just run ClonkOpenRevolution.blend)
To export just the mesh
This guide's section would be relevant for making more Clonk skins. Model a clonk, texture it, import it into 2.49 (.obj works well for that), make sure it's at the correct scale, and rig it to the Armature (visible on layer 16).
• Edit /models/Livings/clonk/Actions.txt so it only has the Walk animation (keep all groups and everything. Just remove all [Action]s after walk. This speeds up the model export significantly.
• Save and reopen the file as previously instructed. Actions.txt does not reload reliably and this works around it.
• For whichever model you are exporting, rename it's Object Name to "Clonk". (OB: "Clonk" under Editing in buttons window)
• Hit 'Update' to update the animation list (only 'Walk' should appear now)
• make sure xml converter is pressed, and export
• after exporting, change Object name back to whatever it was originally. They should be identical (for example, ME:"clonkAlchemist" [F] OB:"clonkAlchemist")
• Switch back to Actions.txt, hit undo deleting the actions and save
• rename the exported 'Graphics.mesh' file to the respective Clonk. ie: GraphicsSteampunk.mesh/GraphicsFarmer.mesh etc.
To export the animations
• make sure xml converter is pressed, and export. You don't need to change the Object name of whatever clonk you're exporting because that is not saved in the *.skeleton file. Only the mesh has a pointer to the skeleton, not the other way around.
• Delete all the other exported files than the .skeleton and rename it "Clonk.skeleton". Copy & paste into the Clonk.ocd
Known bugs
• Having a 'ExportName=' will cause the exporter to not notice the defined 'Group='. This is what caused the bugs relating to the bow not blending with the bow walk/kneel/etc. anims. Don't use it if you're using a define 'Group=', or just don't use it at all. Renaming the actual animation in blender is safer.
• If you're not using an Actions.txt for your object but you have Randrian's installed this will cause problems. You can switch between them; I suggest just using Randrian's and always using an Actions.txt. Or you could just export from blender 2.6*; but 2.6* seemed to have some bug where if you played past the last 50 frames of an animation OC's engine would crash. I don't know if this is still the case.
• Quaternions suck in blender 2.49. Like, they really really really suck. Interpolating between two keyframes usually ends up doing something stupid if the angle is too much, or because 2.49 felt like having a laugh at you. You can fix this in the IPO Curve editor by randomly editing the WXYZ quat channels of a bone's transform until you get the correct rotation.
Guide to ClonkOpenRevolution.blend's Layers
- Layers 1-10 (the entire top row): These layers are for skins. Currently only layers 1-4 are filled. Layer 5 will be filled with the Fisherman clonk whenever he gets created.
- Layer 11: IK Control for the Clonk's armature. Used for animating the clonk.
- Layer 12: Typical Layer for other model(s) used when animating. For example, you could put the sword on this layer to help animate swordplay, or the axe to animate wood-cutting. Putting the model in the right spot/parented to the correct bone is up to you.
- Layer 13: Store layer for a bunch of tools/weapons. Not all those from OC are stored here, you'll have to import those.
- Layer 14: Currently Empty
- Layer 15: Contains boompack and javelin, and for some reason a 'box'
- Layer 16: FK Armature. Helpful for identifying bone names. While the IK armature is used to create animations in blender, FK is what actually gets exported to OC's engine. So you'll want to know what the names of bones are for mesh attachment and whatnot.
- Layer 17: Currently Empty
- Layer 18: Contains an accurate guide for aiming animations. 0 should be animation start, and 180 animation end. Remember to use linear interpolation with aiming animations.
- Layer 19: Contains Crate model. Was used to animate the CarryArms* animations.
- Layer 20: Some old CR hands I guess? And the 3D models for the IK controllers.