I’m trying to learn how to get a simple mesh and animation from Maya to Egg. The exported mesh egg file seems fine but the exported animation egg file is not playing.
I made 2 polygonal cubes with 3 joints/2 bones. I created a simple animation where I rotate the middle joint along the y-axis and then return the joint to its initial position. Animation plays fine in Maya. When I load the model egg file (as an Actor) and loop the animation, nothing is moving. I get the same result when I use pview. Pview plays the animation (I see the play bar go from frame 0 to 23) but the cubes do not move.
What am I doing wrong? All my files are under the same folder. My resulting eggs and python script is pasted below. Any help would be appreciated. Thanks.
I called this to export the meshes and here’s the result:
maya2egg2008 -v -a model -uo cm -trans all -cn cubes -o ‘C:/maya/cubes.egg’ ‘C:/maya/cubes.mb’
<CoordinateSystem> { Y-Up }
<Group> cubes {
<Dart> { 1 }
<Group> groundPlane_transform {
}
<Group> top_cube {
<VertexPool> top_cubeShape.verts {
<Vertex> 0 {
-0.5 0.0248081 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 1 {
0.5 0.0248081 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 2 {
0.5 1.02481 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 3 {
-0.5 1.02481 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 4 {
-0.5 1.02481 0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 5 {
0.5 1.02481 0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 6 {
0.5 1.02481 -0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 7 {
-0.5 1.02481 -0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 8 {
-0.5 1.02481 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 9 {
0.5 1.02481 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 10 {
0.5 0.0248081 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 11 {
-0.5 0.0248081 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 12 {
-0.5 0.0248081 -0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 13 {
0.5 0.0248081 -0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 14 {
0.5 0.0248081 0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 15 {
-0.5 0.0248081 0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 16 {
0.5 0.0248081 0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 17 {
0.5 0.0248081 -0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 18 {
0.5 1.02481 -0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 19 {
0.5 1.02481 0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 20 {
-0.5 0.0248081 -0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 21 {
-0.5 0.0248081 0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 22 {
-0.5 1.02481 0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 23 {
-0.5 1.02481 -0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
}
<Polygon> {
<Normal> { 0 0 1 }
<VertexRef> { 0 1 2 3 <Ref> { top_cubeShape.verts } }
}
<Polygon> {
<Normal> { 0 1 0 }
<VertexRef> { 4 5 6 7 <Ref> { top_cubeShape.verts } }
}
<Polygon> {
<Normal> { 0 0 -1 }
<VertexRef> { 8 9 10 11 <Ref> { top_cubeShape.verts } }
}
<Polygon> {
<Normal> { 0 -1 0 }
<VertexRef> { 12 13 14 15 <Ref> { top_cubeShape.verts } }
}
<Polygon> {
<Normal> { 1 0 0 }
<VertexRef> { 16 17 18 19 <Ref> { top_cubeShape.verts } }
}
<Polygon> {
<Normal> { -1 0 0 }
<VertexRef> { 20 21 22 23 <Ref> { top_cubeShape.verts } }
}
}
<Group> bottom_cube {
<VertexPool> bottom_cubeShape.verts {
<Vertex> 0 {
-0.5 1.11378 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 1 {
0.5 1.11378 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 2 {
0.5 2.11378 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 3 {
-0.5 2.11378 0.5
<Normal> { 0 0 1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 4 {
-0.5 2.11378 0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 5 {
0.5 2.11378 0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 6 {
0.5 2.11378 -0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 7 {
-0.5 2.11378 -0.5
<Normal> { 0 1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 8 {
-0.5 2.11378 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 9 {
0.5 2.11378 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 10 {
0.5 1.11378 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 11 {
-0.5 1.11378 -0.5
<Normal> { 0 0 -1 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 12 {
-0.5 1.11378 -0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 13 {
0.5 1.11378 -0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 14 {
0.5 1.11378 0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 15 {
-0.5 1.11378 0.5
<Normal> { 0 -1 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 16 {
0.5 1.11378 0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 17 {
0.5 1.11378 -0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 18 {
0.5 2.11378 -0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 19 {
0.5 2.11378 0.5
<Normal> { 1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 20 {
-0.5 1.11378 -0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 21 {
-0.5 1.11378 0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 22 {
-0.5 2.11378 0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
<Vertex> 23 {
-0.5 2.11378 -0.5
<Normal> { -1 0 0 }
<RGBA> { 0.5 0.5 0.5 1 }
}
}
<Polygon> {
<Normal> { 0 0 1 }
<VertexRef> { 0 1 2 3 <Ref> { bottom_cubeShape.verts } }
}
<Polygon> {
<Normal> { 0 1 0 }
<VertexRef> { 4 5 6 7 <Ref> { bottom_cubeShape.verts } }
}
<Polygon> {
<Normal> { 0 0 -1 }
<VertexRef> { 8 9 10 11 <Ref> { bottom_cubeShape.verts } }
}
<Polygon> {
<Normal> { 0 -1 0 }
<VertexRef> { 12 13 14 15 <Ref> { bottom_cubeShape.verts } }
}
<Polygon> {
<Normal> { 1 0 0 }
<VertexRef> { 16 17 18 19 <Ref> { bottom_cubeShape.verts } }
}
<Polygon> {
<Normal> { -1 0 0 }
<VertexRef> { 20 21 22 23 <Ref> { bottom_cubeShape.verts } }
}
}
<Joint> top_joint {
<Transform> {
<Matrix4> {
0 -0.999815 -0.0192272 0
0 0.0192272 -0.999815 0
1 0 0 0
0 2.09923 0.0302774 1
}
}
<Joint> middle_joint {
<Transform> {
<Matrix4> {
0.999815 -0.0192272 0 0
0.0192272 0.999815 0 0
0 0 1 0
1.04981 0 0 1
}
}
<Joint> bottom_joint {
<Transform> {
<Matrix4> {
0 0 1 0
-1 0 0 0
0 -1 0 0
1.02943 0 0 1
}
}
}
}
}
}
I called this to export the animation and here’s the result:
maya2egg2008 -v -a chan -uo cm -trans all -cn cubes -o ‘C:/maya/cubes_anim.egg’ ‘C:/maya/cubes.mb’
<CoordinateSystem> { Y-Up }
<Table> {
<Bundle> cubes {
<Table> "<skeleton>" {
<Table> top_joint {
<Xfm$Anim_S$> xform {
<Scalar> fps { 24 }
<Char*> order { srpht }
<S$Anim> h { <V> { 90 } }
<S$Anim> r { <V> { 88.8983 } }
<S$Anim> y { <V> { 2.09923 } }
<S$Anim> z { <V> { 0.0302774 } }
}
<Table> middle_joint {
<Xfm$Anim_S$> xform {
<Scalar> fps { 24 }
<Char*> order { srpht }
<S$Anim> h {
<V> {
0 3.59214 7.5624 11.8077 16.2249 20.711 25.1627 29.477
33.5508 37.2809 40.5642 43.2974 45.3774 46.7011 47.1652
46.0652 43.0241 38.4301 32.6716 26.1369 19.2143 12.2919
5.75776 0
}
}
<S$Anim> p {
<V> {
-0 0.0690342 0.145009 0.225466 0.307861 0.389664
0.468482 0.542172 0.608939 0.667381 0.716489 0.755583
0.784186 0.801852 0.807946 0.793419 0.75175 0.684827
0.594778 0.48537 0.362614 0.234572 0.11054 -0
}
}
<S$Anim> r {
<V> {
1.10171 1.09954 1.09212 1.07839 1.05782 1.0305 0.997148
0.959079 0.91814 0.876581 0.83692 0.801803 0.773851
0.755531 0.74901 0.764382 0.805398 0.86302 0.927376
0.989038 1.04033 1.07645 1.09615 1.10171
}
}
<S$Anim> x { <V> { 1.04981 } }
}
<Table> bottom_joint {
<Xfm$Anim_S$> xform {
<Scalar> fps { 24 }
<Char*> order { srpht }
<S$Anim> h { <V> { -90 } }
<S$Anim> p { <V> { 90 } }
<S$Anim> x { <V> { 1.02943 } }
}
}
}
}
}
<Table> morph {
}
}
}
This is my python script:
import direct.directbase.DirectStart
from direct.actor.Actor import Actor
base.setBackgroundColor(0, 0, 0)
base.disableMouse()
actor = Actor("cubes", {'move' : 'cubes_anim'})
actor.loop('move')
actor.reparentTo(render)
base.camera.setPos(1, -15, 1)
run()