There are several useful functions within an XFur Studio Instance that will allow you to further control the way the fur works as well as what you can do with your characters. As we have explained before, Fur Profile Assets are a great way to share and copy the settings and parameters from the fur of a character’s material. Internally, these properties are stored in a class of type XFurTemplate.
The XFurStudioInstance component offers you functions to get and set these XFurTemplates on a per-material basis:
GetFurData
Retrieves the settings and properties of a fur material in use by this instance as an XFur Template. All properties are copied.
//"index" - The index of the material from which we will retrieve the properties
//"furTemplate" - The template from where the properties will be copied
public void GetFurData( int index, out XFurTemplate furTemplate )
SetFurData
Assigns an XFur Template with fur properties to the given material in this instance.
//"index" - The index of the material to set
//"furTemplate" - The template from where the properties will be copied
//"replaceColorMap" - Whether the fur color map should be set or left unchanged
//"replaceDataMaps" - Whether the fur data maps should be set or left unchanged
//"replaceColorMix" - Whether the fur color variation map should be set or left unchanged
//"replaceStrandsMap" - Whether the fur strands asset should be set or left unchanged
public void SetFurData( int index, XFurTemplate furTemplate, bool replaceColorMap = false,
bool replaceDataMaps = false, bool replaceColorMix = false, bool replaceStrandsMap = false )
SetFurDataFull
Assigns an XFur Template with fur properties to the given material in this instance. All properties and settings are overwritten.
//"index" - The index of the material to set
//"furTemplate" - The template from where the properties will be copied
public void SetFurDataFull( int index, XFurTemplate furTemplate )
Whenever fur properties are modified through code these changes are not applied nor visible immediately. If the XFurStudioInstance has its autoUpdateMaterials variable set to true (the default behavior) the changes will be visible in an instant. However, if this variable is set to false or if you want to see the changes immediately you must push these changes and perform a manual update.
UpdateFurMaterials
Applies all changes to the fur properties across all materials and forcefully updates any modules that work on the render loop.
//"forceUpdate" - Whether to force the update regardless of the autoUpdateMaterials settings
public void UpdateFurMaterials( bool forceUpdate = false )
Below you can also find a list of all the public variables available in XFurStudioInstance that you can access and modify at runtime.
Variable Type | Variable Name | Variable’s Purpose |
---|---|---|
XFurRenderingMode | RenderingMode | The rendering method to be used on this XFur Instance |
bool | FullForwardMode | Enables / disables full forward lighting compatibility (point lights) mode |
bool | AutoUpdateMaterials | Whether the fur properties will be updated and applied automatically |
float | UpdateFrequency | The interval of time (seconds) between each automatic materials update |
XFurTemplate[] | FurDataProfiles | The Fur Template profiles assigned to each material (Read Only) |
XF3_Random | RandomizationModule | The randomization module assigned to this instance (Read Only) |
XF3_LOD | LODModule | The dynamic lod module assigned to this instance (Read Only) |
XF3_Physics | PhysicsModule | The physics module assigned to this instance (Read Only) |
XF3_VFX | VFXModule | The vfx / weather module assigned to this instance (Read Only) |
XF3_Decals | DecalsModule | The decals module assigned to this instance (Read Only) |
XF3_WindZone | WindZone | A global wind zone affecting all XFur Studio Instances (static) |