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

CompoundItem is the base class for all Items that are aggregates of element items (MeshItems, RigItems, MaterialItems). This class tracks and mainipulates it's component element items. It's responsible for LOD Groups, driving morphs, mapping bones to meshes. CompoundItems are the engine specific expression of information contained within PrimitiveSchematics. More...

Inheritance diagram for Astra.Asset.CompoundItem:

Public Member Functions

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)
 
virtual void DriveBlendshape (string _bsId, float _value)
 Set the blend value for a blendshape that is part of this CompoundItem More...
 
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 bool ApplyColor (Color color, int subMaterialSlot=0, int materialSlot=0)
 Sets the color tints for materials underneath the compound item 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...
 
virtual bool ClearColor (int subMaterialSlot=0, int materialSlot=-1)
 Clears the color assignment for this material More...
 
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...
 

Public Attributes

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

virtual void Awake ()
 
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 ()
 

Protected Attributes

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

Events

initcompleted InitCompleted
 

Additional Inherited Members

- 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]
 

Detailed Description

CompoundItem is the base class for all Items that are aggregates of element items (MeshItems, RigItems, MaterialItems). This class tracks and mainipulates it's component element items. It's responsible for LOD Groups, driving morphs, mapping bones to meshes. CompoundItems are the engine specific expression of information contained within PrimitiveSchematics.

Member Function Documentation

◆ ApplyColor()

virtual bool Astra.Asset.CompoundItem.ApplyColor ( Color  color,
int  subMaterialSlot = 0,
int  materialSlot = 0 
)
inlinevirtual

Sets the color tints for materials underneath the compound item 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

Implements Astra.Asset.IColorInterface.

Reimplemented in Astra.Asset.EyeItem, and Astra.Asset.FigureItem.

◆ ClearColor()

virtual bool Astra.Asset.CompoundItem.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<

Implements Astra.Asset.IColorInterface.

Reimplemented in Astra.Asset.EyeItem, and Astra.Asset.FigureItem.

◆ CopyMaterialIntoColorData()

bool Astra.Asset.CompoundItem.CopyMaterialIntoColorData ( int  subMaterialSlot = -1,
int  materialSlot = -1 
)
inline

Do not use. Necessary to be defined due to the IColorInterface

Implements Astra.Asset.IColorInterface.

◆ DiscoverMaterialAssignments()

virtual List< string > Astra.Asset.CompoundItem.DiscoverMaterialAssignments ( MeshItem  _mi)
inlinevirtual

Get the list of ids for MaterialItems attached to the given MeshItem

Parameters
_mi

◆ DriveBlendshape()

virtual void Astra.Asset.CompoundItem.DriveBlendshape ( string  _bsId,
float  _value 
)
inlinevirtual

Set the blend value for a blendshape that is part of this CompoundItem

Parameters
_bsIdID of the blendshape to drive
_valueValue to drive the blendshape to

Reimplemented in Astra.Asset.EyeItem.

◆ DriveRigTargets()

virtual void Astra.Asset.CompoundItem.DriveRigTargets ( PostDriveRigTargets  callback = null,
int  parentJobId = Job.kNoParentJobId 
)
inlinevirtual

Drive the Rig Targets

Parameters
callbackCallback called when operation is complete
parentJobIdParent job id, if any

◆ FindByGuid< T >()

T Astra.Asset.CompoundItem.FindByGuid< T > ( string  _gid)
inline

Finds an item in this CompoundItem with the given guid

Template Parameters
TType of item to look for
Parameters
_gidGuid of item to look for
Type Constraints
T :ItemBase 

◆ FindMaterialItemByMaterial()

virtual MaterialItem Astra.Asset.CompoundItem.FindMaterialItemByMaterial ( Material  _mat)
inlinevirtual

Finds the Material item instance for the given material

Parameters
_matMaterial to look for

◆ GetColor()

virtual ? Color Astra.Asset.CompoundItem.GetColor ( int  subMaterialSlot,
int  materialSlot 
)
inlinevirtual

Gets the first color for a IColorInterface in the compound item for the given slot

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

Implements Astra.Asset.IColorInterface.

Reimplemented in Astra.Asset.FigureItem.

◆ GetColorOptionCount()

virtual int Astra.Asset.CompoundItem.GetColorOptionCount ( int  subMaterialSlot)
inlinevirtual

Get the number of color options for the given sub material slot

Parameters
subMaterialSlotWhich sub material slot (0->3)

Implements Astra.Asset.IColorInterface.

Reimplemented in Astra.Asset.FigureItem.

◆ GetColorPaletteOptions()

virtual List< List< Color > > Astra.Asset.CompoundItem.GetColorPaletteOptions ( int  subMaterialSlot)
inlinevirtual

Get the color options for what can go into the given sub material slot

Parameters
subMaterialSlotWhich sub material slot (0->3)

Implements Astra.Asset.IColorInterface.

Reimplemented in Astra.Asset.FigureItem.

◆ GetMaterialCount()

virtual int Astra.Asset.CompoundItem.GetMaterialCount ( )
inlinevirtual

Retrieves the number of materials assigned to meshes on this CompoundItem

Implements Astra.Asset.IColorInterface.

Reimplemented in Astra.Asset.FigureItem.

◆ IsSceneSerialized()

bool Astra.Asset.CompoundItem.IsSceneSerialized ( )
inline

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

Returns
True if we've manipulated the object for scene saving, false otherwise

Implements Astra.Asset.ISceneSerializable.

◆ OnAfterSceneDeserialize()

void Astra.Asset.CompoundItem.OnAfterSceneDeserialize ( )
inline

Fired after a scene has loaded NOTE: this IS fired in both the Unity Editor and runtime builds

Implements Astra.Asset.ISceneSerializable.

◆ OnBeforeSceneSerialize()

void Astra.Asset.CompoundItem.OnBeforeSceneSerialize ( )
inline

Fired before a scene is saved in the Unity Editor NOTE: this is never fired in runtime builds

Implements Astra.Asset.ISceneSerializable.


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