Hi,
I’ve already posted this in addition to another thread. But this is really a new question. I will update accordingly.
I am trying to get an animation pipeline set up.
To achieve this I am generating a series of keys as an obj file from softimage by using a pythonscript.
All the obj files are loading fine, all i do is parse the base file and using a namespace to load and then detect the shapes and adding them to the sequence (Using an xml ini).
First in an onAssetcompleteHandler I call:
if (event.asset.assetType == AssetType.MESH && event.asset.assetNamespace == "obj")
{
Model = event.asset as Mesh;
Model.material = material;
scene.addChild(Model);
if(interfaceData.mesh.frame) //does this model have shape/vertexanimation
{
ShapeAnimation = new VertexAnimator(Model.animationState as VertexAnimationState);
ShapeSequence = new VertexAnimationSequence(interfaceData.mesh.@animation.toString());
ShapeAnimation.addSequence(ShapeSequence);
}
Setting up the model and the animator / sequence
In the same handler i then call
if (event.asset.assetType == AssetType.MESH && event.asset.assetNamespace == "shp")
{
var shp : Geometry = event.asset as Geometry;
ShapeSequence.addFrame(shp, 1);
if(ShapeSequence.frames.length == new Number(interfaceData.mesh.@frames -1))
{
//got all the desired frames from the loader
ShapeAnimation.play(interfaceData.mesh.@animation.toString());
}
}
This unexpectedly generates the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.animators::VertexAnimator/updateAnimation()[\away3d\animators\VertexAnimator.as:65]
at away3d.animators::AnimatorBase/onEnterFrame()[\away3d\animators\AnimatorBase.as:118]
Referencing the VertexAnimator.as shows that this relates to poses, which seem to come from VertexAnimationState.
Anyone have any idea where I am going wrong.
I see nowhere I can add poses to the base model?
Thanks,
O