Cheers Fabrice!

I didn't know the asAS3Class() method existed - that's a fantastic
piece of functionality! It would be nice to keep it in there as a
backup even when PreFab gets all the bells and whistles I know you're
working on ;)

I've been testing it this morning and it works amazingly well. I had a
couple of memory issues compiling my app the first time round because
of the size of the class (Flash error 5003) which i was able to fix by
making amendments to my environment.plist file as detailed here:
http://code.allofus.com/2009/08/flash-error-5003-5005/

a last question:
Is there any way of centering the mesh (as with the
loader.centerMeshes() method) with the generated class? It's not a
major thing, since I tend to load within ObjectContainer3Ds anyway,
but it'd be good to know.

Looking forward to the new features in Prefab, I've read your hints on
what to expect and I'm pretty excited! Even as is there's no better
utility for the quick viewing and editing of assets.

Kevin.

On Sat, Nov 28, 2009 at 11:10 PM, Fabrice3D <[email protected]> wrote:
> 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.
>
>

Reply via email to