Hi all.
Yes, I remember, I spent some time on it to make use of Collada files
in Aay3d. It was not so simple.
Here is a description of the process
1. Using Blender 2.48, I prepare a model, creating a skeleton and its
animation.
2. I have not found a direct export in Collada format, which would be
correctly loaded in the Away, so
2.1 - export models in the FBX format with a Campbell Barton`s
script (I use version 0.1)
2.2 - with the utility FBX Converter from Autodesk (my version 2010)
I make a conversion obtained FBX to Collada
The resulting file has a few features that do not allow you to use it
with Away3d.
This are
1. - Polygons data recorded in the tag "<polygons>", not
"<triangles>"
2. - Dubbed the tag "<animation>"
The first problem is solved using a utility COLLADA Refinery. Here is
an example of its use in the command line.
java-jar "% COLLADA_REFINERY_LOCATION% \ refinery.jar"% *-i model.dae-
o model.dae-x polygons2triangles
The second problem I decide independently, with a simple text utility
that findes and replaces text patterns.
Note, that before converting polygons2triangles you need to make sure
that the file contains only one entry on the <polygons> in
"<library_geometries>", as COLLADA Refinery by default converts only
the first entry.
In my case polygons data recorded according to the material used -
ie
<polygons material="model_jpg-diffuse-Material" count="0">
<input semantic="VERTEX" offset="0" source="#hand-lib-
Vertex"/>
<input semantic="NORMAL" offset="1" source="#hand-lib-
Normal0"/>
<input semantic="TEXCOORD" offset="2" set="0" source="#hand-
lib-UV0"/>
</ Polygons>
and
<polygons material="material="Material"> "count =" 1000 ">
...
</ Polygons>
With text tool I delete a node with polygons with the count = 0.
Once again, the sequence of actions
1. Models and animations in Blender
2. FbxConverter.exe model.fbx model.dae / sffFBX / dffCOLLADA
3. check and delete a node "<polygons>" with zero number of polygons
4. Remove the sub-tag "<animations>"
5. java-jar "% COLLADA_REFINERY_LOCATION% \ refinery.jar"% *-i
model.dae-o model.dae-x polygons2triangles
After all this, get a file that can be used with Away.
However, in the current version Away will not play the animation,
recorded in the file.
Honestly, I don`t know how it happened, but in the method
buildAnimations (Collada.as file in the current trunk version - Line
407) when you specify the type of channel you need to change
---------------------
case "transform":
channel.type = ["transform"];
break;
---------------------
on
---------------------
case "transform":
case "matrix":
channel.type = ["transform"];
break;
---------------------
And now you can use your model in Collada format in Away3D by
completely standard way described in the examples
(Eg Advanced_MultiMario)
Thanks.
P.S. I'm sure there are many other, more correct and simple way to
achieve this result.