示例#1
0
 private static IEnumerable <MaterialAlphaSnapshot> GetScalpMaterialReferences(DAZHairGroup hair)
 {
     return(hair.GetComponentsInChildren <DAZSkinWrap>()
            .SelectMany(m => m.GPUmaterials)
            .Distinct()
            .Select(m => new MaterialAlphaSnapshot
     {
         material = m,
         originalAlphaAdjust = m.GetFloat("_AlphaAdjust")
     }));
 }
示例#2
0
        private bool ConfigureSimpleHair()
        {
            var materialRefs = _hair.GetComponentsInChildren <DAZMesh>()
                               .SelectMany(m => m.materials)
                               .Distinct()
                               .Select(m => new MaterialAlphaSnapshot
            {
                material            = m,
                originalAlphaAdjust = m.GetFloat("_AlphaAdjust")
            })
                               .ToList();

            if (materialRefs.Count == 0)
            {
                return(false);
            }

            materialRefs.AddRange(GetScalpMaterialReferences(_hair));

            _materialRefs = materialRefs;

            return(true);
        }
        private int ConfigureSimpleHair(DAZHairGroup hair)
        {
            var materialRefs = hair.GetComponentsInChildren <DAZMesh>()
                               .SelectMany(m => m.materials)
                               .Distinct()
                               .Select(m => new MaterialReference
            {
                material            = m,
                originalAlphaAdjust = m.GetFloat("_AlphaAdjust")
            })
                               .ToList();

            if (materialRefs.Count == 0)
            {
                return(HandlerConfigurationResult.TryAgainLater);
            }

            materialRefs.AddRange(GetScalpMaterialReferences(hair));

            _materialRefs = materialRefs;

            return(HandlerConfigurationResult.Success);
        }