Differences

This shows you the differences between the selected revision and the current
version of the page.


kbase:exporting_models_from_blender_into_wme 2008/05/31 12:17 kbase:exporting_models_from_blender_into_wme 2008/06/01 02:00 current
Line 1: Line 1:
====== Exporting models from Blender into WME ====== ====== Exporting models from Blender into WME ======
 +
 +Exporting directx files from Blender for use with Wintermute using the standard directx exporter takes a little editing and special positioning but is possible.  These are the methods I am currently using with Blender 2.46.
 +
 +Lets start with a simple model and skeleton.
 +{{kbase:blend1.jpg|Simple Model}}
 +I put the start bone at the crossing of the axis.  Then I add a pelvis bone in edit mode and parent it to the start bone.  The other bones are all connected.  The start bone is for positioning in Wintermute.  Notice also that the character is backwards from the normal "1" (keypad) or front position.  After I attached the model to the skeleton I rotated it 180 degrees in the top view.  Both the mesh and the skeleton must be selected when rotating or the rotations will get off and cause the light to reflect improperly in the game.  At that point, I press "ctrl" + "a" keys and select "apply rotation and scale to object" for both the mesh and skeleton. 
 +
 +Now I'll save the first action.  I've only saved one key frame which I will use for the idle action.  Naming the action isn't important here, except for your own purposes, since the directx exporter only exports the currently active action and gives it it's own name which must be edited.
 +{{kbase:blend2.jpg|animation}}
 +I'm ready to export the model now.  I export the model directly into my Wintermute project under actors.  Currently I am overwriting the trinity.x file.  I have also set .x files to be opened with the Scite editor.  Export in object mode. The vertices must be applied to the bones before exporting.
 +{{kbase:blend3.jpg|export}}
 +Click on Anim.
 +Click on Swap zy
 +Un-click Flipz, which is clicked on by default
 +Click on ExportAll and export to the Wintermute project.
 +
 +
 +Notice the speed switch.  Unfortunately the speed will be wrong and currently this switch is causing a crash for me.  I solved it by adding a TicksPerSecond template in the .x file. (see next pic)
 +{{kbase:blend4.jpg|xfile}}
 +This code:
 +template AnimTicksPerSecond {
 +<9e415a43-7ba6-4a73-8743-b73d47e88476>
 +DWORD AnimTicksPerSecond;
 +}
 +
 +AnimTicksPerSecond {
 +120;
 +}
 +
 +has been added to the x file in the top part, in the template section.  The 120 number is the length of my (very slow for Blender) walk cycle, which seems to work out.
 +
 +Now in Scite, I click on search and search for the word "animationSet".  There will only be one animation exported from the exporter and it's the last bracket in the x file.
 +{{kbase:blend5.jpg|xfile2}}
 +
 +Because this is the first export.  I will rename "AnimationSet0" to "Idle".  I will need to make the scale in actor3d much smaller than is currently in the trinity actor file.  5 to 15 will be about the right range. I can then open the game and see my model in game.  He will roller skate around but should be facing the right direction.  The velocities need to be adjusted for the proper walk and turn speed.
 +
 +The next export I do, I make another .x file which I call "generic.x".  I export each additional animation into that file, not the trinity.x file.  After I do a search and rename the animaitonSet to "Walk" or whatever the animation will be called in generic.x, I select everything from the word "AnimationSet" all the way to the end of the file, and copy it.  Then I open the trinity.x file, go to the end of the file, and paste the next animation.  I could also name multiple files walk.x, talk.x, etc, so I remembered what they were and export all the animations at once for the copy/paste.  Whichever action is currently in use will be exported, so it's a good idea to have the action window open when doing an export. (end)
 +
 
kbase/exporting_models_from_blender_into_wme.1212229045.txt.gz · Last modified: 2008/05/31 12:17 by Mnemonic
Recent changes RSS feed Creative Commons License Driven by DokuWiki