Hi Kevin,
I've been using the amazing Prefab quite a bit lately to do lots of
little things
Really happy to read that you use Prefab.
Make sure you check the update btn often, I'm busy with it atm and
upload updates almost dayly.
I haven't been able to export an AS3 with animation as of yet.
Thats correct. Prefab doesn't support mesh animation export at the
moment.
It will, you can bet on that, and probably way more than you espect...
For now, to export to as3, you will have to use away3D and do it by code
just load the md2, once loaded, add the following line
lets say your md2instance is mymd2
(mymd2 as Mesh).asAS3Class("MyClassName", "mypackagename", true, true);
in F9 just after the swf is compiled, open a texteditor and paste. The
class string was set into your clipboard
in F10, since it requires user interaction to allow clipboard fill
var myclass:String = (mymd2 as Mesh).asAS3Class("MyClassName",
"mypackagename", true, true);
then print that string using debug trace or fill a textfield.
The output works only for a mesh. You will not be able to export more
than one per class like all other exports
In your project, addchild the imported class, and play the md2 like
you use to.
Later on, animation support will be added to other exporters as well,
if you look at code level, you will see that
the code is already implemented but commented or desabled for now.
This way you should be able to export a whole scenery or whatever you
want, and if mesh animation is detected, it will export it as well.
Once done, the Mesh method, asAS3Class, will be removed.
Fabrice
On Nov 28, 2009, at 11:36 PM, Kevin CFY wrote:
Hey all,
I've been using the amazing Prefab quite a bit lately to do lots of
little things such as normal maps, scaling, and exporting static
models. However, I haven't been able to export an AS3 with animation
as of yet.
I've got an MD2 model with animation which was built in Blender by a
3d artist. The MD2 loads into Away3D fine, and loads into prefab ok as
well. But when I try and export it to an AS3 Away3D class, and load it
into Away3D i get this error (my class name is Rock):
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at away3d.core.base::VertexPosition/adjust()
at away3d.core.base::Frame/adjust()
at Rock/setMeshAnim()
at Rock/buildMeshes()
at Rock()
if I comment out this line:
if(ref.meshanimated) setMeshAnim(this, ref, oList.length);
I can get the model to load, but of course, it doesn't animate. Anyone
have any idea why?
Kevin.