Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Best way to animate models from blender?

Author
Message
Hk47
10
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 6th Mar 2011 19:56
Hi everyone. I recently started using blender to make 3d models and it is going fairly well, except I have no idea how to animate the models for dark basic. Any help about the best way to animate models from blender would be very much appreciated. Thanks in advance.
Latch
13
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Mar 2011 06:00
Are you using darkbasic classic, or darkbasic pro?

Enjoy your day.
Hk47
10
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 7th Mar 2011 16:47
Dark basic classic (I probably should have mentioned that in my post).
hose 5
8
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 7th Mar 2011 20:55
<a href="http://toons-empire.com/" target="_blank" title="Cartoon Sex">Cartoon Sex</a>

lol
seppgirty
FPSC Developer
10
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 8th Mar 2011 00:48
i believe you have to use inverse kenetics animation in DB classic as aposed to bone based animation in DB pro. you have to save as a .x file. i think blender supports this.

gamer, lover, filmmaker
Latch
13
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Mar 2011 10:29
@seppgirty
Quote: "i believe you have to use inverse kenetics animation in DB classic as aposed to bone based animation in DB pro. you have to save as a .x file. i think blender supports this."

You are correct that DBC cannot use bone based animation like DBPro. Inverse kinomatic animation is more of a method of setting up an animation, or how you influence the movement of multiple bones or limbs by moving the furthest child limb, rather than it being not the same as bone based animation. I wonder if you meant hierarchical animation for DBC which is where each piece (limb) of a whole object is a separate mesh - unlike bone based animation where you have one figure and a skeleton that animates it. And you are right, Blender supports both types and inverse kinomatics and can export the file a .X .

@HK47
The first thing, is to grab a direct x exporter script. You can find a pretty decent one here:

http://forum.thegamecreators.com/?m=forum_view&t=166987&b=3

As far setting up your object for animation, you have to link multiple objects together in parent child relationships. Once that is done, you can begin animating your object.

Here's a quick walk through using Blender 2.49 . I haven't gotten around to downloading 2.5x but I'm sure the same controls exist, but may be selected through different means. For this example, we'll add a jointed arm to a body. I'm going to assume you know some basics about Blender like views, or adding meshes/objects or change from edit to object view.

Make sure you are in OBJECT MODE

1. In TOP view, press SPACE and add a cube

2. Press S to scale, type 4, and then press ENTER to scale the cube up four times. If you press N, you will see the object information box. You'll notice it's dimensions are 8 and the scale is 4 for each axis. The rotations should all be 0.00.

We scaled this object because we wanted it bigger, and also so that I could tell you that BEFORE you link any limbs together, each object must have it's final scale and rotations LOCKED in place. Right now, our cube (the body) is showing a scale of 4. We can't export this object or you will run into problems when you try and use it in DBC. BEFORE we export it, and before we attach any limbs, if this is this limbs final position and rotation at start, then commit the scale and rotation by pressing CTRL + A and clicking on apply scale and rotation in the dialog box. You should see the scale set to 1.0 in the object properties box.

This is very important to do for every limb you make before linking them and before exporting the object.

3. Tap the A key until no objects are selected.

4. Press SPACE and add another cube.

5. Press S, type X, type 3, and press ENTER. This will scale the box along the X axis to 6 units long. If the object properties box isn't visible, press N. You should see that the dimensions for X are 6 and the scale for X is 3. Commit the scale by using CTRL + A.

6. Press G to enter Grab Mode and move the mouse so that the long cube (upper arm) is on the outside right edge of the main cube - just touching. We want to move the pivot of this arm as if it were a shoulder.

Left click where the main cubes right outer edge and the upper arm's left outer edge touch. The 3d cursor (bullseye) should appear at this location. Center it in the area as best you can just by eyeballing it for now. Then click on Object > Transform > Center Cursor. The dot in the middle of the arm should have moved to the edge position where the 3d cursor is positioned. This is now the point where the upper arm will rotate relative to the body.

7. To make things easy, we'll just duplicate the upper arm. Press SHIFT + D and move the mouse to the right and a duplicate copy of the upper arm should move with it. Position this as the lower arm so that the two cubes meet where an elbow would be. Since you duplicated the upper arm, the pivot should already be set for this object.

8. Now we link em up! Right click on the lower arm (it should already be highlighted) hold the SHIFT KEY, and right click on the upper arm. It should highlight a light shade of purple or pink. Press CTRL + P to make a parent. Click Make Parent when the dialog asks.

Tap A until nothing is selected. Now Right Click on the upper arm, hold SHIFT and right click on the body. Press CTRL + P and make the parent.

9. Switch to front view. We'll do simple animation. Press the DOWN ARROW until the frame is set to 1. You can look in the lower left hand corner at the number in the parenthesis. Press A so that all of the objects are selected. Press I and LEFT CLICK on LocRotScale to insert a keyframe. The starting keyframe (the neutral start position) for the entire animation. Press A again to deselect everything

Right click on the lower arm to highlight it. Press UP ARROW to advance the frame count to 11. You should see a little number in parenthesis in the lower left hand corner of the view area. Press R to enter rotation mode. Move the mouse so that the lower arm rotates about 90 degrees. Press I to insert a keyframe at frame 11 and LEFT CLICK on LocRotScale.

Right Click on the upper arm. Press R and rotate it up about 10 degrees. Press I and insert a key frame for this limb as well.

Now, tap the LEFT ARROW and the frame count should go down. You should see your arm animate towards the start position. If you tap the RIGHT ARROW, you will see the animation step up to and past frame 11. but you only defined the last keyframe to 11 so it won't do anything when you increase the frames past that.

Now, using that link I posted earlier, there should be instructions for loading in that exporter to export your wonderful new 3 limbed animated creation to an x file. I have to go for now, but see if reading through the link is enough to help you export your object.

Enjoy your day.
Hk47
10
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 8th Mar 2011 21:23
Thank you very much Latch and Seppgirty for the replies. I'm going to try this as soon as I can. Thanks again. I'll post back later about how well it worked.
seppgirty
FPSC Developer
10
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 9th Mar 2011 00:58
@ latch
Quote: "I wonder if you meant for DBC which is where each piece (limb) of a whole object is a separate mesh - unlike bone based animation where you have one figure and a skeleton that animates it."


yes, that is what i meant. hierarchical animation i thought that it was the same as inverse kinetics.now i'm trying to remember what forward kinetics is .........

gamer, lover, filmmaker
Hk47
10
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 12th Mar 2011 23:55
k, so I tested this out, and everything works except for the animations, as when I turn on the animation setting the model looks like it exploded.

I tried to get around this by importing the unanimated model into Lightning limbs, and it can animate the models limbs now can animate the models, the only problem is that I can't export them for some reason due to that the file is in binary format.

Any help with either of these problems would be appreciated, and thank you for your previous help.
Latch
13
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Mar 2011 01:00
Quote: "k, so I tested this out, and everything works except for the animations, as when I turn on the animation setting the model looks like it exploded."

What does this mean? What version of Blender are you using?

Are you saying:

* You can build the model and the animations successfully in Blender

* When you run the script within blender to export your model to Direct X format, there is a button to click that offers the option to include the animations with the exported model. Clicking on the animation selection button and saving the model as direct x seems to work fine from the Blender end.

* When loading the model into DBC and then playing the animation, the model contorts and explodes, or gets really weird looking

Is that what you mean?


Quote: "I tried to get around this by importing the unanimated model into Lightning limbs, and it can animate the models limbs now can animate the models, the only problem is that I can't export them for some reason due to that the file is in binary format."

You can't export them from lightning limbs after you've animated them in lightning limbs? The Blender file is binary or the lightning limbs file? I'm not sure I understand what you are trying to do. Lightning limbs saves it's own animation file I think - I'm not sure though, I haven't used it in a while. Check with Robert The Robot on this problem.

Enjoy your day.
Hk47
10
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 13th Mar 2011 02:18
Sorry about that, I probably should have been clearer about that in my reply.

What I meant about the animation is that I locked in the rotation and scale with Ctrl-A and made the limb relationships, but when I exported the mesh as an x file with the exporter (not the default one), and opened it in Dark Basic, it looked kind of like an explosion. However it works fine without the animation.

I'm not really sure what happened with lightning limbs. The animation and everything worked fine, i was just unable to export it as an x pile.
Latch
13
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Mar 2011 02:52
The process for making the animated character in blender is this:

Make the meshes that will be the separate parts of the character or object: arms legs, wheels, antenae, whatever.

Rotate, scale, and position the limbs whereever they are going to be for the first frame, (the start or neutral position of the character or object.) For humans,this is usually a 'T' pose. Set the pivot points for each limb.

Once the character is built, and every limb is in place, then use CTRL + A on each limb to lock in the scale and rotation.

Link up the limb hierarchy: select child with RIGHT CLICK , SHIFT RIGHT CLICK to select parent, then CTRL + P

After the hierarchy is built, then animate the character.

After the character is animated, export it.

Can you post a copy of an x file with animation that you created in blender? I could take a look at it and get an idea of the problem. Usually the symptoms that you are describing have to do with the frame hierarchy (limbs) and improper animation keys (exporters sometimes have an error in the output formatting)

Enjoy your day.
Hk47
10
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 14th Mar 2011 07:43
Ok, I think I figured out the problem. When I was animating the models, I made the Keyframes use Location, Rotation, & Scale. Since You can't apply the Location to a limb, it would add the Location twice, which caused it to look like an explosion. Thanks again for all of the help Latch.
Latch
13
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Mar 2011 22:47
Great! I'm glad you got it working. The only thing is, you should be able to use location adjustments as well. For example, say you had pistons going up and down, or if your character falls down or jumps up, or if you animated a bunch of stacked crates crashing to the ground, you would want to be able to alter the location.

So there must be something else that is a little quirky. Maybe the animation script has trouble with location positioning. Could you put together a simple object, it could be two connected cubes, and animate it using scale rotation and position? Then export it and post the x file?

Enjoy your day.

Login to post a reply

Server time is: 2019-08-17 14:44:52
Your offset time is: 2019-08-17 14:44:52