Hi,
I imported an animated model that i exported from Maya using AWD Exporter. I can see the model and the animation however model slightly shifts up at every loop. Here is the code:
package
{
import away3d.animators.SkeletonAnimationSet;
import away3d.animators.SkeletonAnimationState;
import away3d.animators.SkeletonAnimator;
import away3d.animators.data.Skeleton;
import away3d.cameras.Camera3D;
import away3d.cameras.lenses.PerspectiveLens;
import away3d.containers.Scene3D;
import away3d.containers.View3D;
import away3d.entities.Mesh;
import away3d.events.LoaderEvent;
import away3d.library.AssetLibrary;
import away3d.library.AssetLibraryBundle;
import away3d.loaders.parsers.Parsers;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.geom.Vector3D;
import flash.net.URLRequest;
public class AnimationTest extends Sprite
{
private var bundleLoadCounter:int;
private var view:View3D;
public function AnimationTest()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
AssetLibrary.enableParsers( Parsers.ALL_BUNDLED );
var bundle:AssetLibraryBundle = AssetLibrary.getBundle("ninjaOutfit1");
bundle.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onBundleLoaded );
bundleLoadCounter = 2;
bundle.load( new URLRequest( "outfit.awd" ), null);
bundle.load( new URLRequest( "idle.awd" ), null);
}
public function onBundleLoaded( _e:LoaderEvent ):void
{
bundleLoadCounter--;
if( bundleLoadCounter != 0 )
{
return;
}
//// Setup Scene
var camera:Camera3D = new Camera3D();
var scene:Scene3D = new Scene3D();
view = new View3D();
view.backgroundColor = 0x7AA8E6;
view.antiAlias = 16;
view.scene = scene;
view.camera = camera;
camera.lens = new PerspectiveLens();
camera.lens.near = 10;
camera.lens.far = 500;
camera.x = 30;
camera.y = 30;
camera.z = -60;
camera.lookAt( new Vector3D() );
this.addChild( view );
this.addEventListener( Event.ENTER_FRAME, onEvent );
// Create object
var bundle:AssetLibraryBundle = AssetLibrary.getBundle("ninjaOutfit1");
var ninjaMesh:Mesh = Mesh( bundle.getAsset("ninja") );
var ninjaSkeleton:Skeleton = Skeleton( bundle.getAsset("skeleton") );
var ninjaAnimSet:SkeletonAnimationSet = new SkeletonAnimationSet( 4 );
var idleState:SkeletonAnimationState = SkeletonAnimationState( bundle.getAsset( "idle" ) );
idleState.looping = true;
ninjaAnimSet.addState("idle", idleState );
var visual:Mesh = Mesh( ninjaMesh.clone() );
var skelAnimator:SkeletonAnimator = new SkeletonAnimator( ninjaAnimSet, ninjaSkeleton );
visual.animator = skelAnimator;
visual.animator.play( "idle" );
scene.addChild( visual );
}
protected function onEvent(event:Event):void
{
view.render();
}
}
}
I commented out “applyRootDelta();” in SkeletalAnimator to see if it is the problem. Shifting stopped however no movement on the hips make it look floaty.
Is this a bug?