parseModels method

dynamic parseModels(
  1. dynamic skeletons,
  2. dynamic geometryMap,
  3. dynamic materialMap
)

Implementation

parseModels(skeletons, geometryMap, materialMap) {
  var modelMap = new Map();
  var modelNodes = fbxTree.Objects["Model"];

  for (var nodeID in modelNodes.keys) {
    var id = parseInt(nodeID);
    var node = modelNodes[nodeID];
    var relationships = connections[id];

    var model =
        this.buildSkeleton(relationships, skeletons, id, node["attrName"]);

    if (model == null) {
      switch (node["attrType"]) {
        case 'Camera':
          model = this.createCamera(relationships);
          break;
        case 'Light':
          model = this.createLight(relationships);
          break;
        case 'Mesh':
          model = this.createMesh(relationships, geometryMap, materialMap);
          break;
        case 'NurbsCurve':
          model = this.createCurve(relationships, geometryMap);
          break;
        case 'LimbNode':
        case 'Root':
          model = new Bone();
          break;
        case 'Null':
        default:
          model = new Group();
          break;
      }

      model.name = node["attrName"] != null
          ? PropertyBinding.sanitizeNodeName(node["attrName"])
          : '';

      model.id = id;
    }

    this.getTransformData(model, node);
    modelMap[id] = model;
  }

  return modelMap;
}