|
@@ -9,7 +9,7 @@ class Library {
|
|
var invConnect : IntHash<Array<Int>>;
|
|
var invConnect : IntHash<Array<Int>>;
|
|
|
|
|
|
public function new() {
|
|
public function new() {
|
|
- root = { name : "root", props : [], childs : [] };
|
|
|
|
|
|
+ root = { name : "Root", props : [], childs : [] };
|
|
reset();
|
|
reset();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -20,12 +20,14 @@ class Library {
|
|
}
|
|
}
|
|
|
|
|
|
public function loadTextFile( data : String ) {
|
|
public function loadTextFile( data : String ) {
|
|
- for( n in Parser.parse(data) )
|
|
|
|
- init(n);
|
|
|
|
|
|
+ load(Parser.parse(data));
|
|
}
|
|
}
|
|
|
|
|
|
- public function load( x : Iterable<FbxNode> ) {
|
|
|
|
- for ( r in x ) init( r );
|
|
|
|
|
|
+ public function load( root : FbxNode ) {
|
|
|
|
+ reset();
|
|
|
|
+ this.root = root;
|
|
|
|
+ for( c in root.childs )
|
|
|
|
+ init(c);
|
|
}
|
|
}
|
|
|
|
|
|
function init( n : FbxNode ) {
|
|
function init( n : FbxNode ) {
|
|
@@ -57,9 +59,7 @@ class Library {
|
|
case "Objects":
|
|
case "Objects":
|
|
for( c in n.childs )
|
|
for( c in n.childs )
|
|
ids.set(c.getId(), c);
|
|
ids.set(c.getId(), c);
|
|
- root.childs.push(n);
|
|
|
|
default:
|
|
default:
|
|
- root.childs.push(n);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105,12 +105,4 @@ class Library {
|
|
return root;
|
|
return root;
|
|
}
|
|
}
|
|
|
|
|
|
- public function setRoot(root) {
|
|
|
|
- this.root = root;
|
|
|
|
- reset();
|
|
|
|
- var old = root.childs;
|
|
|
|
- root.childs = [];
|
|
|
|
- load(old);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|