Hey guys,
I was already updating the old Blender2Dbpro thread, but it seems to have been culled by the powers that be. Here, I shall start the new thread. The old thread was a few versions behind the current Blender release, and wasn't collated very coherently. I will be writing a tutorial/guidelines for getting an animated model from Blender to Dbpro in this thread in an easy to read/implement manner. It isn't really that hard to do, but I will try to be as exhaustive as possible, and use a butt-load of images.
I will update this first post as I go, updating the tutorial here.
Regards,
Greenlig
------------------
In this tutorial, I will be taking you through the process of making a simple model in blender, with an Armature system(bones), that will export to Dbpro. The model will be necessarily simple, but the principles and methods behind the export will be the main focus. Let us BEGIN!
Open Blender.
When it loads, select everything in the scene by
pressing 'a' twice.
Since the cube is selected by default, pressing 'a' once deselects it, and again selects all.
Now delete the selected objects by pressing 'x'. It will throw up a
small dialogue asking "Erase selected object(s)?" - Click it. What we want is a clean slate for exporting your model.
Now, with the mouse over the 3D view, press spacebar so the menu pops up. Navigate to 'Add -> Mesh -> Monkey'. Click Monkey.
This will create the Monkey primitive (Suzanne is her name

) that we will be using for the exercise.
Suzanne will be selected, so now we want to rotate her so she faces the front view. Just as a side note, at the moment, we are viewing Suzanne from the top viewport. There wont be any problems editing the object from here, but I always like my models to face the front. There is an option to compensate for this rotation in the exporter, so lets just rotate Suzanne so she is facing the front.
In the current view, press 'r' then 'x'. Now type '90' and left-click.
This will rotate Suzanne('r') along the X-axis('x'), by 90 degrees. Left clicking always finalizes an action. If you don't want a rotation or transformation that you have just keyed in, try right clicking instead. That will cancel the operation.
Now navigate to the side-view by pressing '3' on the number pad.
In the side-view, left click at the base of Suzanne's chin. This will set the cursor(little red sight) at the base of her chin.
Press the spacebar again, and navigate to "Add -> Armature". This will add a bone system, creating it at the cursor.
The bone is obscured by Suzanne at the moment, so we need to make it X-Ray.
In the Edit tab which will be open beneath the 3D viewport, select the option "X-Ray".
If you haven't randomly clicked the left mouse button at this stage, the bone should be centred in Suzanne's head. You can check by flipping between the front(1), side(3), and top(7) views on the numberpad.
If it isn't centred, you can fix that by pressing 'g' in whichever view, and lining it up with the middle of the model. 'G' is the Translate tool, and will let you re-position the currently selected item.
With the Bone now selected and positioned correctly, go into the side-view(3 on Numpad), and
press Tab to go into edit mode.
We want to add another Bone to this system so we can animate the head. The animation will be wonderfully poor, but it will be animated!
Now, with the uppermost Bone point selected automatically,
press 'e' to extrude a new bone. Move it so it roughly goes back with the shape of Suzanne's head.
Left-click to confirm the new bone creation.
Now, press Tab to leave edit mode.
The model should be ready now for parenting to the bone. One thing though, to make sure everything is ready,
select Suzanne by right-clicking her, and press 'CTRL-A'. The "Apply Object" menu will come up, with "Scale and Rotation to ObData" selected. Click on that.
Our rotation moved it from 0 degrees on the X-axis to 90 degrees, and this will now set the current rotation to 0 degrees. It can save a lot of hassles further on with animation.
With Suzanne selected, hold down SHIFT and Right-click the Bone system, selecting both.
Now press 'CTRL-P', selecting "Armature -> Create From Bone Heat".
Your model should now have the bone system parented to it. The bone heat method is a really easy way of skinning objects. It works very effectively with almost all types of models, and requires very little tweaking. For our purposes, it is perfect. The main benefit of this method is, however, that all the vertices are assigned to a bone.
One of the stipulations of Blender2DBpro exporting is that you need to have all the vertices assigned to a bone. If this isn't the case, the export will fail. Bone heat makes sure that all are selected. Isn't that nice?!
Now select the Bone system with a right-click, then press "CTRL-TAB". The will get you into Pose mode. Select either of the bones and rotate them. The base bone should rotate the entire mesh, and the top bone should just rotate the back of the head. Your model is now ready to be animated!
To Be Continued...and images added when I screen cap them all!
PART TWO
OK -
So, if you
followed all the steps in the first post, you should be at a stage something like THIS.
I have split the viewport so that you can see the front and side views, you don't need to do that just yet. Navigation can still be done with the Numpad.
NOW, we are going to animate Suzanne very simply. I am not doing a tutorial about animation in Blender(just yet), so expect just a rotate or two. Also, I think video tutorials are much easier, so I might get a mic and work on that.
ANIMATION
GO TO THE SIDE VIEW BY PRESSING "3" ON THE NUMPAD
Select the armature by right-clicking it. Now, if you haven't already,
go to pose mode by pressing "CTRL-TAB". You will know you are in pose mode because the bones will have a light blue outline.
There is a little slider along the bottom of the viewport.
Make sure that is set at "1". Not critical to an export, but it makes sense to start your animation at frame one!
Ok, now
select BOTH bones, either by "SHIFT-RIGHT CLICK" or pressing "B" and border selecting both.
With both selected, and the slider at "1", press "I". A menu will appear for what you would like to keyframe. You will see a lot of options, but we are
only going to chose "Rot", the rotation option.
Once clicked, the selected bones should now be completely blue.
Now, we want to move forward twenty-one frames, and key another position. You can either drag the frame slider to go forward, click on it and enter the number manually, OR, you can hit the arrow-keys. The up-arrow key will go forward in ten frame increments, and the right will go forward in single frame increments.
Press the "UP-Arrowkey" twice, setting the current frame to "21".
Now, we want to animate this guy a little.
Select the top bone only, with a right click.
Press "R" to rotate the bone anywhere you want. I suggest getting a good deformation of about 45 - 60 degrees in either direction. It doesn't really matter, as long as you can see it deforming.
When you have rotated it enough, left-click to apply that, then press "I", and select "Rot" again.
Now, if you grab the slider, and scroll through the first twenty-one frames, you should see the model deforming very nicely indeed. It's a simple and crap animation, but it will export just fine.
Now, we need to set the frames to export.
Navigate to the Render tab by pressing "F10". You will see, about half way along, a big button with "ANIM" on it.
Beneath that, there is a little box with "End: 250" in it. That is the frame to export to. We need to change that to "21".
Select it with a left click, and type in "21".
Now, we need to split the screen for the export to work. If you hover over the line that splits the button panel from the viewport, you will notice the cursor change.
Right click on the line and select "Split view". A line will appear in the viewport above, showing where you can split it, just
split it down the middle.
Now you have two viewports looking at the same thing. It doesn't matter what the second viewport is doing, as long as it shows the 3D model, the export should work.
I just remembered something else. When blender exports a .X file, if you don't have a material applied, it will render as white, with no shading. To fix this, we need to
go to the Materials Tab by pressing "F5". Now,
select the MODEL, not the armature, by right-clicking on it. The material tab should show there is no assigned material.
There will be a little button there that says "Add New". Press that button.
That is all you need to do in the materials tab. It will give the mesh a base colour and make it able to be shaded in DBpro.
We are almost done now! Your model should already be selected in the viewport, but if not, select it with a right-click.
MAKE SURE you are on frame "1".
Now,
in the top menu, navigate to "File -> Export -> Direct X" and click on it.
In one of the viewports, a dialogue should be presented. It will take up the whole viewport.
There are several buttons available, but all we need to select are "Anim", "Swap zy", and "Flip z". Nothing else needs to be changed in that dialogue.
Select "Export All", and navigate to where you want your model placed, then press "Export Direct X". Also, very importantly,
press "Exit" on the export dialogue once it is finished (about 1-2 seconds).
Your model should now be fully exported.
The code I use to test models is very simple.
load object "yourmodelhere.x",1
set object speed 1,2
loop object 1
do
control camera using arrowkeys 0,.05,.05
text 10,10,"test"
loop
Fire up DBpro, and test it.
THE KEY THINGS TO REMEMBER WITH EXPORTING
- Make sure when rigging that all vertices are assigned to a bone. Bone heat automatically does this.
- Make sure you have two viewports open when you export.
- Make sure the model has a material.
- Press "Exit" in the export dialogue after each export.
So, after too long, I have finished it, and have a few images I need to add yet, but they have all been screen-capped so it shouldn't be long.
Sorry again for the wait, I have had a pretty tough year so far, and didn't have the energy/motivation to do much 3D I'm afraid!
Please let me know if you have any problems with the tutorial.
Cheers,
Greenlig