Exemple #1
0
        private void fileTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (fileTree.SelectedNode.Text.EndsWith("nuanmb") && modelViewport.ScriptNode != null)
            {
                modelViewport.ScriptNode.CurrentAnimationName = fileTree.SelectedNode.Text;
            }

            if (fileTree.SelectedNode is NutexNode texture)
            {
                ShowModelViewport();
                modelViewport.UpdateTexture(texture);
            }
            else if (fileTree.SelectedNode is IRenderableNode renderableNode)
            {
                ShowModelViewport();
                var node = (FileNode)fileTree.SelectedNode;
                modelViewport.AddRenderableNode(node.AbsolutePath, renderableNode);
                modelViewport.UpdateTexture(null);
            }
            else if (fileTree.SelectedNode is NuanimNode animation)
            {
                ShowModelViewport();
                modelViewport.RenderableAnimation = (Rendering.IRenderableAnimation)animation.GetRenderableNode();
                modelViewport.UpdateTexture(null);
            }

            modelViewport.RenderFrame();
        }
Exemple #2
0
        private void fileTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            // Reset collision color before rendering
            foreach (Collision coll in ParamNodeContainer.HitData)
            {
                coll.Color = Collision.DefaultColor;
            }

            if (fileTree.SelectedNode.Text.EndsWith("nuanmb") && modelViewport.ScriptNode != null)
            {
                modelViewport.ScriptNode.CurrentAnimationName = fileTree.SelectedNode.Text;
            }

            if (fileTree.SelectedNode is NutexNode texture)
            {
                modelViewport.UpdateTexture(texture);
            }
            else if (fileTree.SelectedNode is IRenderableNode renderableNode)
            {
                var node = (FileNode)fileTree.SelectedNode;
                modelViewport.AddRenderableNode(node.AbsolutePath, renderableNode);
                modelViewport.UpdateTexture(null);
            }
            else if (fileTree.SelectedNode is NuanimNode animation)
            {
                modelViewport.RenderableAnimation = (Rendering.IRenderableAnimation)animation.GetRenderableNode();
                modelViewport.UpdateTexture(null);
            }
        }
Exemple #3
0
        private void fileTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            // This condition needs to be first.
            if (fileTree.SelectedNode is NUTEX_Node texture)
            {
                ShowModelViewport();
                modelViewport.UpdateTexture(texture);
            }
            else if (fileTree.SelectedNode is IRenderableNode renderableNode)
            {
                ShowModelViewport();
                var node = (FileNode)fileTree.SelectedNode;
                modelViewport.AddRenderableNode(node.AbsolutePath, renderableNode);
                modelViewport.UpdateTexture(null);
            }
            else if (fileTree.SelectedNode is NUANIM_Node animation)
            {
                ShowModelViewport();
                modelViewport.RenderableAnimation = (Rendering.IRenderableAnimation)animation.GetRenderableNode();
                modelViewport.UpdateTexture(null);
            }

            modelViewport.RenderFrame();
        }