Astra Unity 2.6.6
Astra Unity Plugin
Astra.Asset.EyeItem Class Reference

Represents the eyes of the AvatarItem, which can have color applied More...

Inheritance diagram for Astra.Asset.EyeItem:

Public Member Functions

delegate int OnFindEyesMaterialSlotHandler ()
 Used in OnFindEyesMaterialSlot as the function signature, you should return -1 if you can't find the material slot otherwise a value 0 or greater. More...
 
delegate bool OnApplyEyeModifierHandler (EyeModifierRecord emr, EyeItem ei)
 Used when apply modifiers giving you a chance to change the behaviour More...
 
override void DriveBlendshape (string _bdId, float _value)
 Do not use. EyeItems do not have blendshapes to drive More...
 
override void DriveRigTargets (CompoundItem.PostDriveRigTargets callback=null, int parentJobId=Job.kNoParentJobId)
 Do not use. EyeItems have rig targets driven by the figure's rig
 
bool SupportsEyeFeature (EyeFeature feature)
 Informs you if the material supplied supports an eye feature property such as "IrisColor". These property names come from the Asset.EyeModifierRecord. More...
 
EyeModifierRecord GetEyeModifier ()
 Scans the eye materials for known properties, this works off specific shaders such as the "Astra/Eyes" shader and generates a record containing understood properties such as "IrisColor" or "PupilDilation", not all properties are understood or represented by different shaders. Currently this function works off internal shaders made by Tafi. More...
 
void SetEyeModifier (EyeModifierRecord emr, bool applyNow=true)
 Stores a modifier record into the EyeItem and optionall applies it More...
 
override bool ApplyColor (Color color, int subMaterialSlot=0, int materialSlot=-1)
 Sets the color tint(s) for the eyes Defaults to the material found that contains the Astra/Eyes shader Defaults to the first color, if using Astra/Eyes slot 0 is _ColorPrimary and slot 1 is _ColorSecondary If you want to use a custom shader call your slots _Color[0->N] for color tint options More...
 
override bool ClearColor (int subMaterialSlot=0, int materialSlot=-1)
 Clears the color assignment for this material More...
 
- Public Member Functions inherited from Astra.Asset.CompoundItem
string GetHELRegionGroup ()
 Get the region that this asset is assigned to
 
delegate void initcompleted (string _guid)
 
void Show ()
 
void Hide ()
 
virtual MaterialItem FindMaterialItemByMaterial (Material _mat)
 Finds the Material item instance for the given material More...
 
virtual List< string > DiscoverMaterialAssignments (MeshItem _mi)
 Get the list of ids for MaterialItems attached to the given MeshItem More...
 
FindByGuid< T > (string _gid)
 Finds an item in this CompoundItem with the given guid More...
 
virtual void CleanDictionaries ()
 Clear all item tracking dictionaries
 
delegate void OnPostDriveBlendshape (string instanceId)
 
delegate void PostDriveRigTargets (RigManager.MorphedRig morphedRig=null)
 
virtual void DriveRigTargets (PostDriveRigTargets callback=null, int parentJobId=Job.kNoParentJobId)
 Drive the Rig Targets More...
 
delegate void PostGenerateNewMorphedRigs (RigManager.MorphedRig morphedRig)
 
virtual ? Color GetColor (int subMaterialSlot, int materialSlot)
 Gets the first color for a IColorInterface in the compound item for the given slot More...
 
bool CopyMaterialIntoColorData (int subMaterialSlot=-1, int materialSlot=-1)
 Do not use. Necessary to be defined due to the IColorInterface More...
 
virtual List< List< Color > > GetColorPaletteOptions (int subMaterialSlot)
 Get the color options for what can go into the given sub material slot More...
 
virtual int GetColorOptionCount (int subMaterialSlot)
 Get the number of color options for the given sub material slot More...
 
virtual int GetMaterialCount ()
 Retrieves the number of materials assigned to meshes on this CompoundItem More...
 
void MarkAIMasksDirty ()
 Signals that the alpha injection masks have changed. If this component has an target mesh with _AlphaTex slots it will trigger a recompute of those masks for the next frame
 
void OnBeforeSceneSerialize ()
 Fired before a scene is saved in the Unity Editor NOTE: this is never fired in runtime builds More...
 
void OnAfterSceneDeserialize ()
 Fired after a scene has loaded NOTE: this IS fired in both the Unity Editor and runtime builds More...
 
bool IsSceneSerialized ()
 Tells the system if the object has been serialized or not. This should report True if and only if OnBeforeSceneSerialize was triggered and serialized and it has not yet been deserialized More...
 
- Public Member Functions inherited from Astra.Asset.ItemBase
virtual CompoundItem FindParentCompound ()
 Find the parent CompoundItem which this Item is attached to, if it exists, otherwise null
 
virtual AvatarItem FindAvatarItem ()
 Returns the AvatarItem this item is attached to (if found, note may return null)
 
virtual RigItem FindRigItem ()
 Finds the current RigItem associated on this Avatar Hierarchy More...
 

Static Public Member Functions

static bool SupportsEyeFeature (EyeFeature feature, Shader s)
 Informs you if the material supplied supports an eye feature property such as "IrisColor". These property names come from the Asset.EyeModifierRecord More...
 
static string GetEyeFeaturePropertyNameFromShader (EyeFeature feature, Shader s)
 Locates the shader property name for a specific Asset.EyeFeature. If the shader isn't supported of the feature is not found returns null. More...
 

Public Attributes

McsSdk20.Primitives.SchematicType ProtoType = SchematicType.EyeItem
 
List< EyeModifierRecordModifiers = new List<EyeModifierRecord>()
 
- Public Attributes inherited from Astra.Asset.CompoundItem
ItemDict Meshes = new ItemDict()
 Dictionary of Meshes that are part of this CompoundItem
 
ItemDict Rigs = new ItemDict()
 Dictionary of Rigs that are part of this CompoundItem
 
ItemDict Materials = new ItemDict()
 Dictionary of Materials that are part of this CompoundItem
 
ItemDict MaterialVariations = new ItemDict()
 Dictionary of Material Variations that are part of this CompoundItem
 
ItemDict Textures = new ItemDict()
 Dictionary of Textures that are part of this CompoundItem
 
SerializableDictionarySS SubmeshToMaterialMap = new SerializableDictionarySS()
 Maps materials to their target submeshes
 
SerializableDictionarySDecal DecalLoadJobResults = new SerializableDictionarySDecal()
 These decals should be driven when attached to something and/or loaded, they are not representative of the DecalItems attached to a mesh, for that see MeshItem which are the targets of DecalItems
 
LODGroup LODController
 
AvatarItem avatar
 
bool CullingLOD
 
float CullingThreshhold
 
SchematicType protoType
 
bool mappable
 
List< string > HELRegions = new List<string>()
 
int HELZBias = 0
 
List< string > Tags = new List<string>()
 

Protected Member Functions

override void Awake ()
 
int FindEyesMaterialSlot ()
 
- Protected Member Functions inherited from Astra.Asset.CompoundItem
virtual void OnDestroy ()
 
void GenerateNewMorphedRigs (RigItem[] rigItems, Dictionary< string, float > weights, List< PrimitiveMorphable > primitiveMorphables, List< PrimitiveRig > primitiveRigs, PostGenerateNewMorphedRigs callback=null, int parentJobId=Job.kNoParentJobId)
 
- Protected Member Functions inherited from Astra.Asset.ItemBase
void TrackId (string id)
 
void UntrackIds ()
 

Properties

override McsSdk20.Primitives.AstraPrimitiveType PrimitiveType [get]
 
override McsSdk20.Primitives.SchematicType SchematicType [get]
 
MeshItem LeftMesh [getset]
 Returns the mesh for the left eye
 
MeshItem RightMesh [getset]
 Returns the mesh for the right eye
 
bool DirtyMorph [getset]
 
- Properties inherited from Astra.Asset.ItemBase
virtual McsSdk20.Primitives.AstraPrimitiveType PrimitiveType [get]
 Retrieve the primitive type for this item
 
virtual McsSdk20.Primitives.SchematicType SchematicType [get]
 Retrieve the schematic type for this item
 
string AstraGuid [getset]
 Guid for this item to identify it in the Astra Service
 
string AstraName [getset]
 Display name for this item
 
string AstraInstanceId [getset]
 Guid representing an instance of this item
 
- Properties inherited from Astra.Asset.IAstraBaseInterface
string AstraGuid [getset]
 
string AstraName [getset]
 
string AstraInstanceId [getset]
 

Events

static OnFindEyesMaterialSlotHandler OnFindEyesMaterialSlot
 This event is fired when ApplyColor or ClearColor is called and gives your function defined by OnFindEyesMaterialSlotHandler a chance to locate the slot containing a material in the EyeItems first mesh for use in tinting the eye colors, returning -1 means you did not find it, otherwise it should be the slot of the mesh renderer's slot for the material.
 
static OnApplyEyeModifierHandler OnApplyEyeModifier
 This event allows you to override the behaviour when a modifier record is applied to the material. It is fired before Astra applies changes to the material
 
- Events inherited from Astra.Asset.CompoundItem
initcompleted InitCompleted
 

Additional Inherited Members

- Protected Attributes inherited from Astra.Asset.CompoundItem
bool _isSceneSerialized = false
 
- Protected Attributes inherited from Astra.Asset.ItemBase
List< string > _trackingIds = null
 

Detailed Description

Represents the eyes of the AvatarItem, which can have color applied

Member Function Documentation

◆ ApplyColor()

override bool Astra.Asset.EyeItem.ApplyColor ( Color  color,
int  subMaterialSlot = 0,
int  materialSlot = -1 
)
inlinevirtual

Sets the color tint(s) for the eyes Defaults to the material found that contains the Astra/Eyes shader Defaults to the first color, if using Astra/Eyes slot 0 is _ColorPrimary and slot 1 is _ColorSecondary If you want to use a custom shader call your slots _Color[0->N] for color tint options

Parameters
colorThe color you want to tint, blends on alpha channel
subMaterialSlotWhich sub material slot (0->3)
materialSlotWhich submesh material slot, defaults to 0

Reimplemented from Astra.Asset.CompoundItem.

◆ Awake()

override void Astra.Asset.EyeItem.Awake ( )
inlineprotectedvirtual

Reimplemented from Astra.Asset.CompoundItem.

◆ ClearColor()

override bool Astra.Asset.EyeItem.ClearColor ( int  subMaterialSlot = 0,
int  materialSlot = -1 
)
inlinevirtual

Clears the color assignment for this material

Parameters
subMaterialSlotWhich sub material slot (0->3)
materialSlotWhich submesh material slot, defaults to 0<

Reimplemented from Astra.Asset.CompoundItem.

◆ DriveBlendshape()

override void Astra.Asset.EyeItem.DriveBlendshape ( string  _bdId,
float  _value 
)
inlinevirtual

Do not use. EyeItems do not have blendshapes to drive

Reimplemented from Astra.Asset.CompoundItem.

◆ GetEyeFeaturePropertyNameFromShader()

static string Astra.Asset.EyeItem.GetEyeFeaturePropertyNameFromShader ( EyeFeature  feature,
Shader  s 
)
inlinestatic

Locates the shader property name for a specific Asset.EyeFeature. If the shader isn't supported of the feature is not found returns null.

Parameters
featureThe feature you want to query for such as Asset.EyeFeature.IrisColor
sThe shader you are querying against
Returns
A string with the property name such as "_Color0" if found, null otherwise


◆ GetEyeModifier()

EyeModifierRecord Astra.Asset.EyeItem.GetEyeModifier ( )
inline

Scans the eye materials for known properties, this works off specific shaders such as the "Astra/Eyes" shader and generates a record containing understood properties such as "IrisColor" or "PupilDilation", not all properties are understood or represented by different shaders. Currently this function works off internal shaders made by Tafi.

Returns
EyeModifierRecord contains a set of known properties such as IrisColor which can be used for serialization/inspection/etc

You can make use of this function if you want to know specific traits of the eyes such as IrisColor without needing to directly inspect the material yourself, this is useful for yielding a known standard set of parameters

◆ OnApplyEyeModifierHandler()

delegate bool Astra.Asset.EyeItem.OnApplyEyeModifierHandler ( EyeModifierRecord  emr,
EyeItem  ei 
)

Used when apply modifiers giving you a chance to change the behaviour

Parameters
emrThe modifier record containing values like color properties
eiThe EyeItem this is being applied to, you are responsible for locating the mesh and materials yourself
Returns
Returning false means Astra should not continue trying to process the modifier, true means Astra will

◆ OnFindEyesMaterialSlotHandler()

delegate int Astra.Asset.EyeItem.OnFindEyesMaterialSlotHandler ( )

Used in OnFindEyesMaterialSlot as the function signature, you should return -1 if you can't find the material slot otherwise a value 0 or greater.

Returns

◆ SetEyeModifier()

void Astra.Asset.EyeItem.SetEyeModifier ( EyeModifierRecord  emr,
bool  applyNow = true 
)
inline

Stores a modifier record into the EyeItem and optionall applies it

Parameters
emrThe custom modifier record you want to record
applyNowIf true (default) will auto apply the modifier immediately

◆ SupportsEyeFeature() [1/2]

bool Astra.Asset.EyeItem.SupportsEyeFeature ( EyeFeature  feature)
inline

Informs you if the material supplied supports an eye feature property such as "IrisColor". These property names come from the Asset.EyeModifierRecord.

Parameters
featureThe feature you want to query for such as Asset.EyeFeature.IrisColor
Returns
True if supported, false otherwise

Currently only the left eye is queried, this assumes you are using the same shader for both eyes

◆ SupportsEyeFeature() [2/2]

static bool Astra.Asset.EyeItem.SupportsEyeFeature ( EyeFeature  feature,
Shader  s 
)
inlinestatic

Informs you if the material supplied supports an eye feature property such as "IrisColor". These property names come from the Asset.EyeModifierRecord

Parameters
featureThe feature you want to query for such as Asset.EyeFeature.IrisColor
sThe shader you are querying against
Returns
True if supported, false otherwise

The documentation for this class was generated from the following file: