parsePoseNodes method

dynamic parsePoseNodes()

Implementation

parsePoseNodes() {
  var bindMatrices = {};

  if (fbxTree.Objects.keys.contains("Pose")) {
    var BindPoseNode = fbxTree.Objects["Pose"];

    for (var nodeID in BindPoseNode.keys) {
      if (BindPoseNode[nodeID]["attrType"] == 'BindPose' &&
          BindPoseNode[nodeID]["NbPoseNodes"] > 0) {
        var poseNodes = BindPoseNode[nodeID]["PoseNode"];

        if (poseNodes is List) {
          poseNodes.forEach((poseNode) {
            bindMatrices[poseNode["Node"]] =
                new Matrix4().fromArray(poseNode["Matrix"]["a"]);
          });
        } else {
          bindMatrices[poseNodes["Node"]] =
              new Matrix4().fromArray(poseNodes["Matrix"]["a"]);
        }
      }
    }
  }

  return bindMatrices;
}