Exemple #1
0
        private bool loadMATA(BinaryReader reader, odfFileSection fileSec)
        {
            ObjectName     name        = new ObjectName(reader.ReadBytes(64));
            ObjectID       id          = new ObjectID(reader.ReadBytes(4));
            int            numMatLists = reader.ReadInt32();
            odfMATASection mataSec     = new odfMATASection(id, numMatLists);

            mataSec.Name = name;
            for (int i = 0; i < numMatLists; i++)
            {
                id = new ObjectID(reader.ReadBytes(4));
                float           unk1    = reader.ReadSingle();
                int             numSets = reader.ReadInt32();
                odfMaterialList matList = new odfMaterialList(numSets);
                matList.MaterialId = id;
                matList.Unknown1   = unk1;
                matList.Unknown2   = reader.ReadInt32();
                if (!loadMaterialPropertySets(reader, numSets, matList))
                {
                    return(false);
                }

                mataSec.AddChild(matList);
            }

            fileSec.Section = mataSec;
            MataSection     = mataSec;
            return(true);
        }
Exemple #2
0
 public static odfMaterialList FindMaterialList(ObjectID matId, odfMATASection mataSection)
 {
     for (int i = 0; i < mataSection.Count; i++)
     {
         if (mataSection[i].MaterialId == matId)
         {
             return(mataSection[i]);
         }
     }
     return(null);
 }