예제 #1
0
        private void CreateNodes(TreeNode node, Node sceneNode)
        {
            foreach (Node childNode in sceneNode.ChildNodes)
            {
                if (ABUtils.IsHidden(childNode))
                {
                    continue;
                }
                TreeNode childTree = new SceneNodeWrapper(childNode, Img_Node);
                CreateNodes(childTree, childNode);
                node.Nodes.Add(childTree);
            }

            //create entity nodes
            foreach (Entity entity in sceneNode.Entities)
            {
                if (ABUtils.IsHidden(entity))
                {
                    continue;
                }
                int img = Img_Geometry;
                if (entity is Camera)
                {
                    img = Img_Camera;
                }
                else if (entity is Light)
                {
                    img = Img_Light;
                }
                node.Nodes.Add(new SceneNodeWrapper(entity, img));
            }
            //create material nodes
            foreach (Material mat in sceneNode.Materials)
            {
                if (mat == null)
                {
                    continue;
                }
                var matNode = new SceneNodeWrapper(mat, Img_Material);
                CreateTextureNode(matNode, mat, Material.MapDiffuse);
                CreateTextureNode(matNode, mat, Material.MapAmbient);
                CreateTextureNode(matNode, mat, Material.MapEmissive);
                CreateTextureNode(matNode, mat, Material.MapNormal);
                CreateTextureNode(matNode, mat, "Occlusion");
                CreateTextureNode(matNode, mat, "MetallicRoughness");
                node.Nodes.Add(matNode);
            }
        }
예제 #2
0
        private void CreateNodes(TreeNode node, Node sceneNode)
        {
            foreach (Node childNode in sceneNode.ChildNodes)
            {
                if (ABUtils.IsHidden(childNode))
                {
                    continue;
                }
                TreeNode childTree = new SceneNodeWrapper(childNode, Img_Node);
                CreateNodes(childTree, childNode);
                node.Nodes.Add(childTree);
            }

            //create entity nodes
            foreach (Entity entity in sceneNode.Entities)
            {
                if (ABUtils.IsHidden(entity))
                {
                    continue;
                }
                int img = Img_Geometry;
                if (entity is Camera)
                {
                    img = Img_Camera;
                }
                else if (entity is Light)
                {
                    img = Img_Light;
                }
                node.Nodes.Add(new SceneNodeWrapper(entity, img));
            }
            //create material nodes
            foreach (Material mat in sceneNode.Materials)
            {
                node.Nodes.Add(new SceneNodeWrapper(mat, Img_Material));
            }
        }