internal RwMaterialListNode(RwNodeFactory.RwNodeHeader header, BinaryReader reader) : base(header) { mStructNode = RwNodeFactory.GetNode <RwMaterialListStructNode>(this, reader); mMaterials = new List <RwMaterial>(mStructNode.MaterialCount); for (int i = 0; i < mStructNode.MaterialCount; i++) { mMaterials.Add(RwNodeFactory.GetNode <RwMaterial>(this, reader)); } }
public RwMaterialListNode(IList <string> textureNames) : base(RwNodeId.RwMaterialListNode) { mMaterials = new List <RwMaterial>(textureNames.Count); for (int i = 0; i < textureNames.Count; i++) { mMaterials[i] = new RwMaterial(textureNames[i], this); } mStructNode = new RwMaterialListStructNode(this); }
public RwMaterialListNode(RwNode parent, Assimp.Material material) : base(RwNodeId.RwMaterialListNode, parent) { mMaterials = new List <RwMaterial>(); string textureName = null; if (material.HasTextureDiffuse) { textureName = Path.GetFileNameWithoutExtension(material.TextureDiffuse.FilePath); } mMaterials.Add(new RwMaterial(material.Name, textureName, this)); mStructNode = new RwMaterialListStructNode(this); }