AdvancedDissolveKeywords class methods help working with dissolve keywords.
SetKeyword
static public void SetKeyword(Material material,
AdvancedDissolve.Keyword keyword,
bool enable)
static public void SetKeyword(Material material[],
AdvancedDissolve.Keyword keyword,
bool enable)
Sets Advanced Dissolve keyword for selected material(s).
// Example of enabling State keyword:
AdvancedDissolveKeywords.SetKeyword(material, AdvancedDissolveKeywords.State.Enabled, true);
// Example of disabling State keyword (turns off Advanced Dissolve effect):
AdvancedDissolveKeywords.SetKeyword(material, AdvancedDissolveKeywords.State.Enabled, false);
// Example of enabling Two Custom Maps for Standard Cutout:
AdvancedDissolveKeywords.SetKeyword(material, AdvancedDissolveKeywords.CutoutStandardSource.TwoCustomMaps, true);
// Example of enabling 4 Spheres for Geometric cutout:
AdvancedDissolveKeywords.SetKeyword(material, AdvancedDissolveKeywords.CutoutGeometricType.Sphere, true);
AdvancedDissolveKeywords.SetKeyword(material, AdvancedDissolveKeywords.CutoutGeometricCount.Four, true);
GetKeyword
static public void GetKeyword(Material material,
AdvancedDissolve.Keyword keyword)
Retrieves state of the Advanced Dissolve keyword from material.
Reload
static public void Reload(Material material)
Reloads Advanced Dissolve keywords based on there values saved inside material. This may be necessary when changing shaders or copy/paste material properties or presets.
RemoveAll
static public void RemoveAll(Material material, bool ignoreState)
Removes (disables) all Advanced Dissolve keywords from material. If ignoreState is set to true, Advanced Dissolves State keyword remains intact.
AdvancedDissolveProperties
This class exposes all Advanced Dissolve properties from material editor, allowing their control from custom scripts.
UpdateLocalProperty
static public void UpdateLocalProperty(Material material,
Property property,
object value)
Value – Property value in float, int, color, texture etc. format.
// Example of updating Clip value in the Standard Cutout group:
AdvancedDissolveProperties.Cutout.Standard.UpdateLocalProperty(material, AdvancedDissolveProperties.Cutout.Standard.Property.Clip, #value# );
// Example of updating Color value in the Edge Base group:
AdvancedDissolveProperties.Edge.Base.UpdateLocalProperty(material, AdvancedDissolveProperties.Edge.Base.Property.Color, #color# );
// Example of updating Color Intensity value in the Edge Additional Color group:
AdvancedDissolveProperties.Edge.AdditionalColor.UpdateLocalProperty(material, AdvancedDissolveProperties.Edge.AdditionalColor.Property.ColorIntensity, #value# );
In all three examples above method names have the following structure:
AdvancedDissolveProperties.Section.Group.Scope()
Section – Shader section name same as in the material editor. Can be Cutout or Edge.
Group – Group name in the selected section. For Cutout section it can be: Standard or Geometric. For Edge section it can be: Base, AdditionalColor, UVDistortion or GlobalIllumination.
Scope – If updating material’s local property this is UpdateLocalProperty. In the case of updating global property it is UpdateGlobalProperty.
UpdateGlobalProperty
static public void UpdateGlobalProperty(GlobalControlID ID,
Property property,
object value)
Updates global property.
ID – AdvancedDissolveKeywords.GlobalControlID enum.
Value – Property value in float, int, color, texture etc. format.
// Example of updating Clip value in the Standard Cutout group for materials with global ID One.
AdvancedDissolveProperties.Cutout.Standard.UpdateGloabalProperty(AdvancedDissolveKeywords.GlobalControlID.One, AdvancedDissolveProperties.Cutout.Standard.Property.Clip, #value# );