예제 #1
0
        public void Write(GrnNode matSecNode)
        {
            GrnNode matNode = new GrnNode(matSecNode, GrnNodeType.Material);

            matSecNode.AppendChild(matNode);
            GrnMaterialSimpleDiffuseTextureNode matDiffNode =
                new GrnMaterialSimpleDiffuseTextureNode(matNode);

            matDiffNode.TextureMapIndex = this.DiffuseTextureIndex + 1;
            matNode.AppendChild(matDiffNode);
            GrnDataExtensionReferenceNode refNode = new GrnDataExtensionReferenceNode(matNode);

            refNode.DataExtensionIndex = this.DataExtensionIndex + 1;
            matNode.AppendChild(refNode);
        }
예제 #2
0
        internal void Read(GrnNode material)
        {
            // -- Each material has diffuseTex (0, textureIndex(+1), 1), and dataExtRef
            GrnMaterialSimpleDiffuseTextureNode matDiffuse =
                material.FindNode <GrnMaterialSimpleDiffuseTextureNode>(
                    GrnNodeType.MaterialSimpleDiffuseTexture);

            if (matDiffuse != null)
            {
                this.DiffuseTextureIndex = matDiffuse.TextureMapIndex - 1;
            }

            this.DataExtensionIndex =
                material.FindNode <GrnDataExtensionReferenceNode>(
                    GrnNodeType.DataExtensionReference).DataExtensionIndex - 1;
        }