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); }
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; }