Exemple #1
0
        private void HandleNewModelToolStripMenuItemClick(object sender, EventArgs e)
        {
            var model = ModelConverterUtility.ConvertAssimpModel();

            if (model != null)
            {
                var node = DataViewNodeFactory.Create("Model", model);
                ModelEditorTreeView.SetTopNode(node);
                LastOpenedFilePath = null;
            }
        }
Exemple #2
0
        private void HandleAnimationLoadExternalToolStripMenuItemClick(object sender, EventArgs e)
        {
            var filePath = SelectFileToOpen(ModuleFilterGenerator.GenerateFilter(FormatModuleUsageFlags.Import, typeof(AnimationPack),
                                                                                 typeof(Animation)).Filter);

            if (filePath == null)
            {
                return;
            }

            if (!DataViewNodeFactory.TryCreate(filePath, out var node))
            {
                MessageBox.Show("Hee file could not be loaded, ho.", "Error", MessageBoxButtons.OK);
                return;
            }

            if (node.DataType == typeof(Animation))
            {
                ModelViewControl.Instance.LoadAnimation(( Animation )node.Data);
            }
            else if (node.DataType == typeof(AnimationPack))
            {
                var animationPack = ( AnimationPack )node.Data;
                var animation     = animationPack.Animations.FirstOrDefault();
                if (animation != null)
                {
                    ModelViewControl.Instance.LoadAnimation(animation);
                }
            }
            else
            {
                MessageBox.Show("Not a support animation file.", "Error", MessageBoxButtons.OK);
                return;
            }

            mAnimationListTreeView.SetTopNode(node);
        }