@@ -730,6 +730,17 @@ class BaseLibrary {
return hasValue;
}
+ /**
+ Returns an array of names with all animations present in FBX file.
+ **/
+ public function getAnimationNames() : Array<String> {
+ var names = [];
+ for ( a in this.root.getAll("Objects.AnimationStack") ) {
+ names.push(a.getName());
+ }
+ return names;
+
public function loadAnimation( ?animName : String, ?root : FbxNode, ?lib : BaseLibrary ) : h3d.anim.Animation {
if( lib != null ) {
lib.defaultModelMatrixes = defaultModelMatrixes;
@@ -805,9 +805,11 @@ class HMDOut extends BaseLibrary {
addModels(includeGeometry);
- var anim = loadAnimation();
- if( anim != null )
+ var names = getAnimationNames();
+ for ( animName in names ) {
+ var anim = loadAnimation(animName);
d.animations.push(makeAnimation(anim));
d.data = dataOut.getBytes();
return d;