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 / Blender animation export...

Author
Message
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 9th Oct 2009 02:02
(I made an account -just- to ask this question.)

So, I picked up DBC again a week or so ago, and, surprisingly, I didn't run into too much trouble at first. I followed the super amazing 'monster hunt' tutorial on here, to help me get back into DBC, and, as I completed it, I quickly ran into a major problem...

I needed models for the characters and player hands/weapons. As I hate using other people's work, and, conveniently, I can model and texture pretty decently, I brought up blender and fixed up some stuff to use with DBC. I grabbed the blender -> DBC .X plugin and noticed it didn't support bone animation, so I scratched it and re-did the whole thing by animating parented objects, as I figured limbs worked. So then, all happy, I launch the exporter, export my animated model into a .x file and load up DBC... and... I get this.

Okay. That's not exactly what I expected. Sure, it animates, bobbing up and down slowly in the idle animation, but it's all over the place and doesn't look much like hands at all. The soft faces didn't carry over either.

Render + screenshot in blender of the hands, as they were supposed to show up. (Throwing the holding sword anim in the exporter crashes DBC when I load it...?)

So, what should I do? Is Blender animation just completely out of question? Or should I attach my .blend models? I've been going at this for two full days now and I swear if I don't get around it I'll end up thrashing my computer out the window...

~~~
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Oct 2009 06:05
Quote: "blender -> DBC .X plugin "

Where did you get this plugin?

Enjoy your day.
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 9th Oct 2009 11:59 Edited at: 9th Oct 2009 13:20
It's yours!

At least, you're credited for it, and from browsing the forums I do think you're the right person.

Also, I tryed exporting to .3ds, but, since blender doesn't support 3ds animation, that didn't get me anywhere; I then tryed the default blender directx plugin, and it gave me a static mesh that just rotated itself to the side when I used loop object. Then I tryed your plugin, and, well, the results didn't really get me anywhere. I tryed Lighting Limbs also, but, as my limbs' rotation points or whatever aren't properly set, it just scattered my pieces all over the place, and as I couldn't rotate the camera, it just utterly confused me and I decided to leave it at that. I also tryed getting Anim8tor as I read about it on here, but, I couldn't figure anything out in it (though, to be really honest I didn't try very hard), and I ended up scrapping it as I figured that blender animations surely had some way to work. I then thought of exporting every frame into .objs using Blender's animated obj plugin then converting them into .xes and using append object, but, I realized that was a really stupid idea that was surely not the simplest.

~~~
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 9th Oct 2009 12:03 Edited at: 9th Oct 2009 13:18
Btw, just as a note; (I'd edit my post but that whole post approbation thing doesn't really allow me)

I tryed your plugin with my parented limbs, normally. All limbs ( including parents ) are animated. Then I figured that my be the problem, so I added a tiny cube and parented both arms to it (to no avail). I also tryed animating completely unparented mesh, and it just crashed DBC. So.... I'm not sure where to go from here. I mean I've tryed everything I could think of or look up on the internet (and there's really not enough ressources for this).

~~~
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Oct 2009 21:53 Edited at: 9th Oct 2009 21:56
Quote: "It's yours!

At least, you're credited for it, and from browsing the forums I do think you're the right person."

Is it version 1.00 or 1.01? Did you get it from one of my old blender to dbc websites from 2006? If the answer to any of those questions is yes, then that script is buggy. In 3 years since I posted it, about 4 people reported any problems with it so I assumed there was no real interest in it. I haven't updated the websites (I only ever think of it if someone posts a similar question to what you've done here).

There is an updated working version, but I haven't released it to the general public. I'm not sure that I will. Until I decide on what I'll do with the script, here are a couple of alternatives:

If you are willing to, post your limbed, animated blender model and I'll run it through the latest version of my script to see if the script is indeed bug-free and I'll post back an .X version.

Download Truspace for free and use hierarchical animation (not skeletal) and export it to .X

Using Blender and Lightning Lights follow this rather elaborate work around: Fixing Limb Pivots It's based on orignally creating the model in Anim8or but ultimately imports that into Blender. So, just start from having the model in Blender - that should be about 28 posts into the thread (of course you can read the whole thread for the back ground of what's happening).

Enjoy your day.
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 9th Oct 2009 23:16 Edited at: 10th Oct 2009 23:28
Oh, I'll let you see if the script works right first, then I'll try the rest if there's no luck!

.Rar file with the idle hands .blend + texture in a .tga

~~~
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Oct 2009 12:08 Edited at: 12th Oct 2009 12:02
If you are worried about your model, you can remove the link from your post. Let me know when you've downloaded my attachment and I will remove it from this post also if you desire.

Ok, there are a few things going on. Very nice model by the way! When using limb animation (hierarchical animation) and setting it up for export, there are a few things you have to do. I noticed that the things I'll mention were missing from your blender model.

1. Whenever you finish designing and placing a limb mesh for it's initial (start position), you have to make sure the frame number is set to 1 and all scaling and rotations are committed. To do this, press the down arrow key until the little number in the lower left reads 1 then right click on the limb (it will highlight purple) and press CTRL+A . Agree to apply rotation and scale to the mesh. All initial rotations have to be set to zero in this manner or else these rotation will influence all the others to follow including linked limbs.

In the case of your model, it looks like you duplicated 1 arm and mirrored it to make another arm. In this case, CTRL+A to apply the scale will adjust it so that the scale doesn't read as -1 (the mirror of the other arm). Again, all this is important for export. If it remained -1 then the arm turns inside out or see through on export.

Do this step for each limb as you create it BEFORE linking and parent child relationships.

2. Before linking and parent child relationships, make sure the pivot point is set properly for each limb. For example, in the case of the arm, the pivot would be up near the shoulder or elbow - the rotation joint of the appendage. Hands would have their pivot set at the wrist just below the meat of the palm. A thumb or finger would have it's pivot set at it's base where it touches the palm. These are things you may not have to worry about with skeletal animation because that's all about vertices weighted and linked to bones. With limb animationm you have to setup the entire limb with the correct joint rotation point because of the absence of an influencing bone. If you read through Fixing pivot points, there's detailed instruction on how to set the pivot points in blender.

After this, then create your parent-child relationships and do your animation.

I modified your blender file a bit with these changes for most of the limbs. I only did 1 set of fingers though, so one hand isn't finished in terms of setting up the correct pivot points. It is saved as WitchArmsASAidling_2.blend. I also included an X file that seems to have exported just fine with the built in direct X editor. However, you'd have to use something like Lightning Limbs to animate it. My exporter works as well with the animation, but I'm still mulling over whether or not to release that to the public.

The main problem was how your limbs were linked (pivot points) and the fact that your initial scale and rotations weren't committed. When a model is exported from blender, and transformation matrix is output with each limb. These contain the intial rotation information, scale, and location of each limb. However, the initial mesh vertices are already positioned based on how you designed the model in blender, so it ends up beign overkill with the transformation matrices trying to scale, rotate, and position the whole mesh - that is why the scale and rotation have to be applied (and essentially set the initial transformation matrix to zero). What you'll see if the scale and rotation are not set is the limbs scattered all over the place in the export because everything is basically doubled.

Anyway, take a look at the blend file and the x file I'm including. I didn't mess with any of the texturing so the object is not textured.

Enjoy your day.
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 10th Oct 2009 23:22
Oh yeah... I probably forgot to apply the rotation/location/scale changes before animating :S that makes sense, now I think of it.

And to fix the arm appearing inside out, I just recalculated normals to inside, which worked fine.

And as for animating in lighting limbs, I guess it would be an option... Though I can't really manage to work with it at all. It just feels really stiff compared to blender's animation methods!

If you don't want to release your plugin, could I send you the fixed .blend models and have you export them to .xes and send me back? Or will the previous version of your plugin also work fine?

Anyways, I'm going to get to work and fix up all my animations now. This is really great, I was afraid I might've hit a wall in DBC development. Thanks!

~~~
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 10th Oct 2009 23:24
Oh and, sure, go ahead and remove the link. I don't really mind my model being available to anyone, it's nothing special anyways, but why not remove it since it's not in use anymore?

~~~
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 11th Oct 2009 01:41
Mh... I did all that, and ran into another issue (though it has nothing to do with the exporter or whatever).

What happens is, whatever I do (whether or not I apply the settings to it), the second arm always behaves the same as the first arm. So if I create a keyframe, go to frame ten and return to my first frame, the second arm will be positionned at the same place than the first one, and the hand (and the descending childs) will be moved with the right offset for them to be where the second arm should be, had it not moved to the first one, except on the opposite side.

It looks about the same as what happened the first time, where each child would double the offset it's supposed to have increasingly with each step, though, this time I DID apply the rotation and scale properly. I can animate the other arm fine, but if I duplicate it and mirror it, then it screws up. If I go back, fix the arm and insert a keyframe, then the other one screws up in the same way... What am I missing?

Also, I didn't keep the original left arm from my blend file. What I did was delete the left arm, clear parenting on the right arm, fix the pivots, apply rotation and scale, duplicate, mirror, apply rotation and scale to the new arm and then setup parents.

~~~
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Oct 2009 12:01
You have to do the mirroring/duplicating and application of the scale and rotation to each mesh BEFORE you do any parent linking or animation on ANY arm. Depending on your initial setup of blender, certain things may or may not be copied when you duplicate a mesh.

I'm no expert on Blender and all I can say is what I've done that works for me. The steps I would do are:

Make sure the frame is set to 1 and always at 1 for the rest of the steps
1. Create the right arm - fix the rotation and scale (CTRL+A).
2. Duplicate it and mirror it to become the left arm
3. Apply the scale and rotation (CTRL+A) to the left arm
4. Set the pivots of each arm to their respective base.
5. Create the right hand (not fingers)
6. Duplicate and mirror it (the hand)
7. Apply scale and rotation
8. Fix the pivot point to the wrist of each hand
9 and etc - repeat for each finger.

Then after the models are created, rotation is zeroed and all the pivots are set, now link the parent child relationships.

After the parent child relationships are set, you are now ready to animate.

These are the steps I would follow for the animation:
1. Press A to select all of the meshes (arms, hands and fingers)
2. Make sure the frame is set to 1 and press the I to open the Keyframe setting menu
3. Choose LocRotScale to set the initial pose of all of the limbs to their default position. Press A again to deselect everything
4. Use the arrow keys to increase the frame (maybe to 10 or something)
5. Right click on a limb (the left arm for example)
6. Press R to enter rotate mode. Hold CTRL and move the mouse to rotate the arm in even increments of 5 degrees.
7. When satisfied, press I again and set LocRot .
8. Either keep advancing the frame and setting the animation for this limb, or set the frame back to 1 and Right click on a new limb
9. Advance the frame number for this limb and apply a rotation. Then press I again to set LocRot
10. Keep repeating this process for all of the limbs.

I've attached a simple blender file animation of two rough (just boxes) arms that I used these exact steps on. It's only a 21 frame animation but it shows independent movement of each limb.

Enjoy your day.

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Oct 2009 23:36
I just realized something. There are two mirror functions in Blender. One is in the Object menu and can mirror the orientation of an object. The other is a modifier that will duplicate mirrored vertices on both sides of an object. If you use the miodifier, the result will all be one object.

If you duplicate the object first, then use the Object menu mirror function, you will have2 separate objects that are mirrored. This is what I thought you were doing - but reading back, you may have been using the modifier.

Enjoy your day.
Eliseee
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 13th Nov 2009 12:29
Oh my god, my computer broke and I couldn't get on it for ages, lol. Thanks alot for the help! I'll see what I can do with blender and all. Again, thanks!

~~~

Login to post a reply

Server time is: 2024-03-28 15:56:28
Your offset time is: 2024-03-28 15:56:28