Help exporting an animation with Yabee.

Return to Pipeline

Help exporting an animation with Yabee.

Postby Niriel » Wed May 09, 2012 7:49 am

I may be a bit thick, but I just don't understand how to export animations from blender with Yabee. I read the Yabee thread, but it's not very organized and I just don't get it.

I have something simple (I think): a door that opens.
Image
Click for high-res, so that you can see how I named my anims/actions and all.

Can I export this anim to egg? How?

I do see "animation only" and "separate animation files" in the options of Yabee but I don't know how to use them. Also, what should I put in the "Animation" listbox?
User avatar
Niriel
 
Posts: 62
Joined: Sun Apr 29, 2012 6:10 am
Location: Groningen, Netherlands

Re: Help exporting an animation with Yabee.

Postby ThomasEgi » Wed May 09, 2012 10:22 am

Niriel wrote:
Can I export this anim to egg? How?


no you cant.

yabee, just like the old chicken exporter, requires you to have all animation done with armatures, or shapekeys.

that is due to panda's egg format which doesn't store animated node-transforms.

add an armature , add 2 bones to it, assign each door to a bone (using an armature modifier), animate the bones, and then you should be able to export an animated door.
User avatar
ThomasEgi
 
Posts: 2149
Joined: Fri Jul 28, 2006 10:43 am
Location: Germany,Koblenz

Postby Niriel » Wed May 09, 2012 12:51 pm

Thanks! Working on that now :).
User avatar
Niriel
 
Posts: 62
Joined: Sun Apr 29, 2012 6:10 am
Location: Groningen, Netherlands

Postby Nemesis#13 » Wed May 09, 2012 4:10 pm

If you get into problems, feel free to upload your blend and we'll take a look at it.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby Niriel » Wed May 09, 2012 4:27 pm

Thank you, I'll take that offer :D.

I am having some troubles indeed: the door doesn't show in my world. I'm using an Actor to display it, I can see the walking panda from the tutorial, but not my door next to it.
  • I added an armature with two bones, one for each half-door.
  • I made the half-doors children of the bones with a constraint.
  • In pose mode, I created two keyframes for each bone: closed and open. When I play the animation in blender it looks nice.
  • I exported the half-doors and the armature with yabee. I have a "door.egg" with a couple of joints plus the door meshes, and a "door_open.egg" with tables containing the interpolated angles for the 20 frames of the animation.

My door doesn't have a material yet, and usually it shows in pure white. But when I load it as an Actor, it doesn't show at all.

Here's the blend file:
https://www.box.com/s/8a67545072f1870eb576
It may have lost its materials since I link them from a library, but the rest should work.

What did I break again?
User avatar
Niriel
 
Posts: 62
Joined: Sun Apr 29, 2012 6:10 am
Location: Groningen, Netherlands

Postby Nemesis#13 » Wed May 09, 2012 5:37 pm

I think I found the error.
Try to use an armature modifier instead of a constraint.

For testing I suggest pview:
Code: Select all
pview -lc door.egg -a door_open.egg

The -l makes pview pop up immadiately and load your model afterwards. -c is same as pressing c in pview - it puts your model in the center of view. The -a flag allows you to specify an animation file.

To actually see it shaded, press "l" (small L) in pview.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby Niriel » Thu May 10, 2012 3:51 am

Yes! We're getting somewhere. It's better, but it's still wrong.

Good news: pview does show me my two half doors opening, woo!
Bad news: when I press the pause button, then only one of the two doors stops and the other keep opening forever. Furthermore, the title written above the controls reads "door_left". It makes sense because the play/pause buttons control the left door, but what about the disobedient right one?
Image

Bad news 2: In game, the behavior is different. I see the right door only. It is properly animated though, like the panda I threw there for comparison.
Image

Here's the blender file, version 2: https://www.box.com/s/0cb4011c45bcc3f9a8c8
Image

The egg file shows two groups, one per door. Each door has joints for the two bones, but only one of these has vertices. The file looks quite good actually: it's very symmetrical so I'm surprised not to see both doors working the same way.

Is it behaving weirdly because I use two different meshes? Is it a case of multi-part actor?
User avatar
Niriel
 
Posts: 62
Joined: Sun Apr 29, 2012 6:10 am
Location: Groningen, Netherlands

Postby Nemesis#13 » Thu May 10, 2012 6:19 am

Yes, usually you'd use a single object with two meshes inside. For the issue with parts not being visible: are you sure you selected everything in your scene before exporting?
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby Niriel » Thu May 10, 2012 8:30 am

I did select everything. I suspect this was because I had several objects while Panda expects only one.

I don't know how to make several meshes inside a single object. However, I got things to work by Joining my two doors. I have only one mesh, but by affecting each half-mesh to its own vertex group, the export almost worked. I still had to hack into the egg to delete joints that were present twice, but it works now.

I'll look into having two meshes into one object, because the way I'm doing it isn't super handy.

All of that will seem so obvious after the fact...
User avatar
Niriel
 
Posts: 62
Joined: Sun Apr 29, 2012 6:10 am
Location: Groningen, Netherlands

Postby Niriel » Wed May 16, 2012 12:09 pm

For the record, I managed. Just quoting myself to make it more visible to the future visitors:
Niriel wrote:I got things to work by Joining my two doors. I have only one mesh, but by affecting each half-mesh to its own vertex group, the export almost worked. I still had to hack into the egg to delete joints that were present twice, but it works now.

I don't know why Yabee exported four joints. Maybe because there are two vertex-groups, and two joints, therefore 2x2=4? I had two identical "door_left" joints and two identical "door_right" joints, so I just removed the duplicates with a text editor.

Important note:
When I joined my two doors into one single mesh, I first did it with the doors in closed position. That created problems: Panda realized that some vertices were at the same place, and it simplified the geometry, fusing the two half-doors together. Because of that, opening the doors resulted in a rubbery surface stretching from one door to the other as they opened. Yuk.

To solve that problem, I made the rest (default) position of the door opened: panda can not simplify that geometry since there is no overlap between the two doors.
User avatar
Niriel
 
Posts: 62
Joined: Sun Apr 29, 2012 6:10 am
Location: Groningen, Netherlands


Return to Pipeline

Who is online

Users browsing this forum: No registered users and 1 guest