Ejemplo n.º 1
0
        private bool ProcessMorphBodyPartFile(string pText, List <string> pPuppetTextures, out List <BodyModelSumDecal> pDecals, out bool pExternDecalReferenced, out string pErrorText)
        {
            pDecals = null;
            pExternDecalReferenced = false;
            AssetFiles.BodyPartMorph bodyPart = AssetFiles.BodyPartMorph.LoadFromString(pText, out pErrorText);
            if (bodyPart == null)
            {
                return(false);
            }

            BodyPartName = bodyPart.name;
            Description  = bodyPart.description;
            HasMeshes    = (bodyPart.meshes != null) && (bodyPart.meshes.Length > 0);
            if ((bodyPart.morphTargets != null) && (bodyPart.morphTargets.Length > 0))
            {
                Morphable = true;
            }

            if ((bodyPart.tags != null) && (bodyPart.tags.Length > 0))
            {
                Tags = new List <string>();
                foreach (string tag in bodyPart.tags)
                {
                    Tags.Add(tag);
                }
            }

            if ((bodyPart.decals != null) && (bodyPart.decals.Length > 0))
            {
                pDecals = new List <BodyModelSumDecal>();
                foreach (mscopethingsBodyPart_MorphPartMaterial decalItem in bodyPart.decals)
                {
                    if (!CheckDecalFileExists(decalItem.maps, pPuppetTextures))
                    {
                        pExternDecalReferenced = true;
                        continue;
                    }

                    BodyModelSumDecal decal = new BodyModelSumDecal();
                    decal.DecalName = decalItem.name.Trim();
                    decal.Group     = GetDecalGroup(decalItem.parameters).Trim();
                    pDecals.Add(decal);
                }
            }

            if (!HasMeshes)
            {
                BodyPartType += " DECALS";
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool DecalAlreadyListed(BodyModelSumDecal pDecal)
        {
            if ((pDecal == null) || (Decals == null))
            {
                return(true);
            }

            foreach (BodyModelSumDecal listedDecal in Decals)
            {
                if (listedDecal.DecalName == pDecal.DecalName)
                {
                    return(true);
                }
            }

            return(false);
        }