private AnimatedMeshListTreeNode createMOSNode(string name, MOS mos, MOMDocument entity) { AnimatedMeshListTreeNode rootNode = new AnimatedMeshListTreeNode(name, entity.Models.ObjectMeshes, entity, 0, _animationController, contextMenu: new ContextMenu( new Dictionary <string, Action> { { "Export as MOS", () => { _exportController.OpenDialog( filePath => { _exportController.ExportOriginal(mos, filePath); }, ".mos"); } } })); for (int i = 0; i < mos.NumberOfTODs; i++) { AnimatedMeshListTreeNode animationNode = new AnimatedMeshListTreeNode($"Animation {i}", entity.Models.ObjectMeshes, entity, i, _animationController); rootNode.AddNode(animationNode); } return(rootNode); }
private MeshListTreeNode createMOMNode(string name, MOMDocument momDoc) { MeshListTreeNode rootNode = new MeshListTreeNode(name, momDoc.Models.ObjectMeshes, contextMenu: new ContextMenu( new Dictionary <string, Action> { { "Export as MOM", () => { _exportController.OpenDialog( filePath => { _exportController.ExportOriginal(momDoc.Document, filePath); }, ".mom"); } } })); MeshListTreeNode modelsNode = createTMDNode("Models", momDoc.Models); rootNode.AddNode(modelsNode); AnimatedMeshListTreeNode animationsNode = createMOSNode("Animations", momDoc.Document.MOS, momDoc); rootNode.AddNode(animationsNode); return(rootNode); }
public AnimatedMeshListTreeNode(string text, List <IRenderable> meshes, MOMDocument entity, int animation, IAnimationController animationController, IEnumerable <TreeNode> children = null, Action <TreeNode> onSelect = null, ContextMenu contextMenu = null) : base(text, meshes, children, onSelect, contextMenu) { _animation = animation; _animationController = animationController; _entity = entity; }
public void LoadMOM(string momPath) { Logger.Log()(LogLevel.INFO, $"Loading MOM from: {momPath}"); MOM mom; using (BinaryReader br = new BinaryReader(File.Open(momPath, FileMode.Open))) { mom = new MOM(br); } Logger.Log()(LogLevel.INFO, "Successfully loaded MOM"); MOMDocument document = CreateDocument(mom); _treeController.PopulateTreeWithDocument(document, Path.GetFileName(momPath)); }