collisionNode and Animation

I’ve run around a strange issue when converting meshes from maya2008.

Since I started to used animation, I’ve added a change in my script:

maya2egg2008 -keep-uvs -noexist -tbnall -o "%s" "%s"' %(str(output), str(input))


maya2egg2008 -a both -keep-uvs -noexist -tbnall -o "%s" "%s"' %(str(output), str(input))

so far so good.
With a mesh that got collision Solid ( tagged with the mel script) and no animation, the two command created nearly the same mesh:
the only difference seems to be

<Table> {
  <Bundle> tree_with_collision {
    <Table> "<skeleton>" {
    <Table> morph {

at the end of one file.

No problems here.

But when I load the model, the two start to get really different:

>>> node = loader.loadModel('tree_with_collision.egg')
:egg2pg(warning): AnimBundle tree_with_collision does not specify a frame rate.
ModelRoot tree_with_collision.egg
    Character tree_with_collision
      GeomNode  (3 geoms: S:(ColorAttrib TextureAttrib))
    AnimBundleNode tree_with_collision
>>> node2 = loader.loadModel('tree_with_collision2.egg')
ModelRoot tree_with_collision2.egg
    GeomNode Feuillage01 (1 geoms: S:(TextureAttrib))
    GeomNode pCube1 (1 geoms: S:(TextureAttrib))
    GeomNode pCube2 (1 geoms: S:(TextureAttrib))
    GeomNode pCube3 (1 geoms: S:(TextureAttrib))
    GeomNode pCube4 (1 geoms: S:(TextureAttrib))
    GeomNode pCube5 (1 geoms: S:(TextureAttrib))
    CollisionNode pCube6 (6 solids) (hidden)
    CollisionNode pCylinder1 (1 solids) (hidden)
    CollisionNode pSphere2 (1 solids) (hidden)

And that starts to be a problem, because I use those collisions !
I am missing something or is it a bug ?

Yes, if you add “-a both” or “-a model” to your maya2egg line, you are generating an animatable model, which is a very, very different thing from a static model.

First, an animatable model is optimized for animation, so if you load your static environments with this flag, it will cause performance issues.

Second, an animatable model does not support collision geometry, as you have discovered.

You should add “-a both” only to those models that actually use animation.


thank for the respond. I should have know.