It works!

Thanks a lot for your help. The key was not the export step but the
scaling:
>             modelContainer.scale(100);

I suppose my model was so small that it was almost invisible.

Thanks a lot for your help!

Emmanuel

On Oct 26, 11:44 am, John Brookes <[email protected]> wrote:
> Your model loads but the animation exports are wrong
> Your ColladaMax Export Options:
> ExportNormals=1;ExportEPolyAsTriangles=1;ExportXRefs=0;ExportSelected=1;ExportTangents=0;ExportAnimations=0;SampleAnim=1;ExportAnimClip=1;BakeMatrices=0;ExportRelativePaths=1;AnimStart=0;AnimEnd=0.666667;
> Not sure on max but think you need to set ExportAnimations and BakeMatrices
>
> Loaded your model with this, once you get the animation exports right you
> should be able to uncomment the animation
> ############
> package
> {
>     import away3d.animators.BonesAnimator;
>     import away3d.cameras.Camera3D;
>     import away3d.containers.ObjectContainer3D;
>     import away3d.containers.Scene3D;
>     import away3d.containers.View3D;
>     import away3d.core.utils.Debug;
>     import away3d.events.Loader3DEvent;
>     import away3d.loaders.Collada;
>     import away3d.loaders.Loader3D;
>     import away3d.loaders.utils.AnimationLibrary;
>     import flash.display.Sprite;
>     import flash.events.Event;
>     import flash.geom.Vector3D;
>
>     public class MainAnimTest extends Sprite
>     {
>         private var camera:Camera3D;
>         private var view:View3D;
>         private var scene:Scene3D;
>         private var _loader:Loader3D;
>         private var loader:Loader3D;
>
>         public function MainAnimTest():void
>         {
>             if (stage) init();
>             else addEventListener(Event.ADDED_TO_STAGE, init);
>         }
>
>         private function init(e:Event = null):void
>         {
>             removeEventListener(Event.ADDED_TO_STAGE, init);
>             // entry point
>
>             //Debug.active = true;
>
>             initEngine();
>             initObjects();
>             initListeners();
>
>         }
>
>         private function initEngine():void
>         {
>             scene = new Scene3D();
>             camera = new Camera3D();
>             camera.z = -1000;
>
>             view = new View3D();
>             view.camera = camera;
>             view.scene = scene;
>
>             addChild(view);
>
>             //addChild(new AwayStats(view));
>
>         }
>
>         private function initObjects():void
>         {
>
>             loader = new Loader3D();
>             loader = Collada.load('../src/del/Boy.DAE'); //<--change to
> right path
>             loader.addOnSuccess(collladaLoadSuccess);
>
>             scene.addChild(loader);
>         }
>
>         private function collladaLoadSuccess(e:Loader3DEvent):void
>         {
>             var modelContainer:ObjectContainer3D = loader.handle as
> ObjectContainer3D;
>             modelContainer.scale(100);
>             modelContainer.y = -200;
>
>             //this would play the animation but you need to set the export
> setting in max
>             //sorry dont have max at hand to say what they should be
>             //look for export animations and maybe bake transforms
>             /*
>             var animationLibrary:AnimationLibrary =
> modelContainer.animationLibrary;
>             var animation:BonesAnimator =
> animationLibrary.getAnimation("default").animator as BonesAnimator;
>             animation.play();
>             */
>         }
>
>         private function initListeners():void
>         {
>             addEventListener(Event.ENTER_FRAME, onEnterFrame);
>             stage.addEventListener(Event.RESIZE, onResize);
>             onResize();
>
>         }
>
>         /*
>          * RenderLoop
>          */
>         private function onEnterFrame(event:Event):void
>         {
>             //render scene
>             view.render();
>         }
>
>         /**
>          * stage listener for resize events
>          */
>         private function onResize(event:Event = null):void
>         {
>             view.x = stage.stageWidth / 2;
>             view.y = stage.stageHeight / 2;
>         }
>     }
>
> }
>
> ############

Reply via email to