General information animations and Collada. Long post warning, jump to bottom part for summary

Software: Away3D 3.x

bakajin, Newbie
Posted: 09 September 2011 12:55 PM   Total Posts: 24

Hi,

I’m loading up a collada file generated by Softimage.
After much faffing about (This is my first Away3d project, previously i have worked with papervision3D) I got the model and texture loaded up fine.

Now i am moving on to the animation. Sadly it seems that there is very little animation reference out there. Everything is about bones. I am just doing simple translation / rotation animation, and some shape (morph) animation.

I ‘m trying to figure out what classes to use and how to set up my scene so the parser doesnt fail. Shape animation seems a no no. Also, the debug info seems off:

!——————- Begin Parse Collada——————-
!——————- Begin Parse Scene——————-
+ Parse Node : prop-noShape : prop-noShape
+ Parse Node : paper-mesh : paper-mesh
!——————- End Parse Scene——————-
! Animation Clips Exist : false
!——————- Begin Parse Animation——————-
+ Parse Animation : rotations
+ Parse Animation : translations
!——————- End Parse Animation——————-
+ Parse Geometry : geometries_0
+ Parse MeshMaterialData
! channelType : translationZ
OUTPUT:6
! channelType : rotation_z
OUTPUT:8
! channelType : rotation_x
OUTPUT:9
! channelType : rotation_y
OUTPUT:9
! channelType : translationY
OUTPUT:8
! channelType : translationX
OUTPUT:6
+ Build Material : PaperMat
+ Material Type : colorMaterial
+ Build Container : prop-noShape
+ Build Mesh : paper-mesh
+ BonesAnimator
+ BonesAnimator
+ BonesAnimator

There are no bones, the info reads false on clips but then does list the exact clip names as animations. Also i don’t really get what is meant or how to use channels listed here.

Last but not least I’m guessing i should read in separate shape keys and supply those to the morpher class. Ideally though it would be nice to contain it in one DAE scene file and take the relative meshes and or animation from there instead of a whole list of DAE files for one asset.

In short what i ‘m asking is any pointers or info on normal SRT animation from colladas and or info about the Morpher or VertexAnimation classes

Oh and thanks for any info and putting up with the n00b questions,

regards,

Baka

   

Avatar
Alexander Seifert, Moderator
Posted: 10 September 2011 03:35 PM   Total Posts: 129   [ # 1 ]

I’d be interested in more information on the VertexAnimation class as well! =)

Thanks!
Alex

 Signature 
signature_image

http://www.deltastrike.org

   

bakajin, Newbie
Posted: 14 September 2011 12:41 PM   Total Posts: 24   [ # 2 ]

Exactly,

from what i can find tutorialwise it is the easiest way to handle different (plotted) animations from a DAE file (or other imported format maybe).

So far i am not having to much success, sadly.

A DAE from softimage seems to fail its parsing on:

<library_visual_scenes>
  <visual_scene id=“visual_scenes_0” name=“visual_scenes_0”>
  <node id=“prop” name=“prop”>
  <translate sid=“translation”>0.000000 72.887459 0.000000</translate>
  <rotate sid=“rotation_z”>0.000000 0.000000 1.000000 0.000000</rotate>
  <rotate sid=“rotation_y”>0.000000 1.000000 0.000000 0.000000</rotate>
  <rotate sid=“rotation_x”>1.000000 0.000000 0.000000 0.000000</rotate>
  <scale sid=“scale”>1.000000 1.000000 1.000000</scale>
  <node id=“paper-mesh” name=“paper-mesh”>
    <translate sid=“translation”>-0.000586 -63.659527 -8.797646</translate>
    <rotate sid=“rotation_z”>0.000000 0.000000 1.000000 -3.996002</rotate>
    <rotate sid=“rotation_y”>0.000000 1.000000 0.000000 0.607094</rotate>
    <rotate sid=“rotation_x”>1.000000 0.000000 0.000000 -4.578351</rotate>
    <scale sid=“scale”>12.800000 1.000000 10.240000</scale>
//fails on this node
    <instance_controller url=”#controllers_0”>
    <bind_material>
    <technique_common>
      <instance_material symbol=“PaperMat” target=”#PaperMat”></instance_material>
    </technique_common>
    </bind_material>
    </instance_controller>
//end fail
  </node>
  </node>
  </visual_scene>
</library_visual_scenes>

When i replace it with the node from my working (no shape/morphs animation) it works immediately.
The id controllers_0 refers to the nodes relating to shape animation and in a specific node contains vertex positions arrays.
Why the parser fails here is the part i don’t get. It should be able just to ignore the controllers_0 nodes to just generate the mesh with uvs and material/texture.

Any clues would be most helpful

   

bakajin, Newbie
Posted: 14 September 2011 01:08 PM   Total Posts: 24   [ # 3 ]

Ok after some more researching it seems to lie in /loader/Colllada.as around line 617.

stating:

case “instance_controller”:
   
    //add materials to materialLibrary
    for each (instance_material in childNode..instance_material)
    parseMaterial(instance_material.@symbol, getId(instance_material.@target));
   
    ctrlr = collada[“library_controllers”].controller.(@id == getId(childNode.@url))[0];
    geo = collada[“library_geometries”].geometry.(@id == getId(ctrlr[“skin”][0].@source))[0];
   
              (_objectData as MeshData).geometry = geometryLibrary.addGeometry(geo.@id, geo, ctrlr);
   
    (_objectData as MeshData).skeleton = getId(childNode[“skeleton”]);
  break;

it looks like it is assuming skin animation and or hopping from lib controllers to lib geometries.
This doesnt reflect my DAE.

Sorry for the thread bumping, i am just hoping for some insights to further my research here.
Also this might be helpful to others in some way…

Baka

   

bakajin, Newbie
Posted: 14 September 2011 02:58 PM   Total Posts: 24   [ # 4 ]

Ok,

bear with me some more.
The collada parser assumes skinning and bones when it encounters a library_controllers node.

I guess due to the fact that skinning/enveloping is essentially also shape/morph animation (vertex positions and weighting) softimage (and maybe other 3d applications) writes shape/morph animation to the library_controllers aswell.

To fix, as a first step, the parsing failure, i added a check to Collada.as (see lines 617 & 784) to check if the library_controllers contains a “morph” node, otherwise it can just continue parsing it assuming “skin” node.

so around line 617:
                if(ctrlr[“morph”])
and line 784:
                if(geometryData.ctrlXML[“morph”])


now “all” i have to figure out it how to use the morph and its referenced geometries as vertex animation. Shouldn’t be to hard i hope (it seems to just list an array of geometries from the library_geometries as a reference for the shape/morph frames).

I guess this should be listed as a bug in the collada parser?

Baka

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X