private void AddNode(AssimpNode an, TreeNode tn) { for (int i = 0; i < an.Children.Count; i++) { var node = new AssimpTreeNode(an.Children[i]); this.AddNode(an.Children[i], node); tn.Nodes.Add(node); } }
private void RebuildTreeview(AssimpScene scene) { this.tv.Nodes.Clear(); TreeNode meshes = new TreeNode("Meshes"); this.tv.Nodes.Add(meshes); for (int i = 0; i < scene.MeshCount; i++) { var mesh = scene.Meshes[i]; TreeNode node = new TreeNode("Mesh " + i.ToString() + " (" + mesh.Indices.Count + ")"); if (mesh.Indices.Count == 0) { node.BackColor = Color.Red; } else if (mesh.UvChannelCount == 0 || !mesh.HasNormals) { node.BackColor = Color.Yellow; StringBuilder tooltip = new StringBuilder(); if (mesh.UvChannelCount == 0) { tooltip.AppendLine("No UV channel"); } if (!mesh.HasNormals) { tooltip.AppendLine("No Normals detected"); } node.ToolTipText = tooltip.ToString(); } meshes.Nodes.Add(node); } var root = new AssimpTreeNode(scene.RootNode); this.tv.Nodes.Add(root); this.AddNode(scene.RootNode, root); }
private void RebuildTreeview(AssimpScene scene) { this.tv.Nodes.Clear(); TreeNode meshes = new TreeNode("Meshes"); this.tv.Nodes.Add(meshes); for (int i = 0 ;i < scene.MeshCount; i++) { var mesh = scene.Meshes[i]; TreeNode node = new TreeNode("Mesh " + i.ToString() + " (" + mesh.Indices.Count + ")"); if (mesh.Indices.Count == 0) { node.BackColor = Color.Red; } else if (mesh.UvChannelCount == 0 || !mesh.HasNormals) { node.BackColor = Color.Yellow; StringBuilder tooltip = new StringBuilder(); if (mesh.UvChannelCount == 0) { tooltip.AppendLine("No UV channel"); } if(!mesh.HasNormals) { tooltip.AppendLine("No Normals detected"); } node.ToolTipText = tooltip.ToString(); } meshes.Nodes.Add(node); } var root = new AssimpTreeNode(scene.RootNode); this.tv.Nodes.Add(root); this.AddNode(scene.RootNode, root); }