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

AvatarItem is a collection of compound items that represents a character or actor in the application space. It holds reference to a single instance to a figure (adding a new figure will evict) the current figure. Avatars are loading using the Astra.Core.Avatar class. As changes are made to the Avatar, the changes can be saved to the Astra service via the SaveAvatar method. More...

Inheritance diagram for Astra.Asset.AvatarItem:

Public Member Functions

ApiJobNoResult ApplyAsset (CatalogEntry catalogEntry)
 Used to apply an asset to an avatar, whether it is a morph, a clothing item, or a figure. More...
 
ApiJobNoResult ApplyAssets (List< CatalogEntry > catalogEntries)
 Used to apply a set of assets to an avatar More...
 
void RemoveAsset (CatalogEntry catalogEntry)
 Used to remove an asset such as a ClothItem from an avatar. More...
 
void RemoveAsset (string guid)
 Used to remove an asset such as a ClothItem from an avatar. More...
 
ApiJobNoResult RemoveAllItems ()
 Removes all compound items except figures (so just hair, cloth, etc), decals, and morphs from the current avatar. More...
 
ApiJobNoResult SaveAvatar ()
 Saves the Avatar by serializing into an recipe and stores both locally and remotely. You can then use the GUID later to load the saved Avatar upon success. More...
 
string GetRecipe ()
 Retrieves a JSON encoded avatar recipe this is the same recipe stored in SaveAvatar but does not save the avatar More...
 
void RemoveAstraComponents ()
 Removes astra components off the avatar and it's child objects. This is useful if you plan to export Astra somewhere where the components will not be used/referenced, ie: you're moving the avatar to another system that doesn't use Astra and need the references removed.
 
ItemBase GetItemFromGuid (string guid)
 Retrieves the ItemBase for the given asset if the asset is attached to the Avatar. More...
 
void SetEyeModifier (EyeModifierRecord emr)
 Stores and applies the EyeModifierRecord for this AvatarItem, which can be used to adjust eye parameters, does nothing if there is no EyeItem found More...
 
EyeModifierRecord GetEyeModifier ()
 Retrieves the EyeModifierRecord for this AvatarItem, which can be used to adjust eye parameters. More...
 
AvatarLoadJob LoadFromGuid (string guid)
 A convenience function that loads the avatar provided by guid into the current avatar NOTE: this functinos the same as using Loader.LoadAvatar More...
 
bool Compatible (CompoundItem compoundItem)
 Tells you if a CompoundItem is compatible with this AvatarItem 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

Texture2D Thumbnail
 Retrieves the texture which is a thumbnail of this Avatar
 

Properties

override McsSdk20.Primitives.AstraPrimitiveType PrimitiveType [get]
 
override McsSdk20.Primitives.SchematicType SchematicType [get]
 
BodyManager BodyManager [get]
 
AnimationManager AnimationManager [get]
 
CompoundManager CompoundManager [get]
 
MorphableManager MorphableManager [get]
 
DecalManager DecalManager [get]
 
MaterialManager MaterialManager [get]
 
AlphaMaskManager AlphaMaskManager [get]
 
- 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]
 

Additional Inherited Members

- Protected Member Functions inherited from Astra.Asset.ItemBase
void TrackId (string id)
 
void UntrackIds ()
 
- Protected Attributes inherited from Astra.Asset.ItemBase
List< string > _trackingIds = null
 

Detailed Description

AvatarItem is a collection of compound items that represents a character or actor in the application space. It holds reference to a single instance to a figure (adding a new figure will evict) the current figure. Avatars are loading using the Astra.Core.Avatar class. As changes are made to the Avatar, the changes can be saved to the Astra service via the SaveAvatar method.

Member Function Documentation

◆ ApplyAsset()

ApiJobNoResult Astra.Asset.AvatarItem.ApplyAsset ( CatalogEntry  catalogEntry)
inline

Used to apply an asset to an avatar, whether it is a morph, a clothing item, or a figure.

Parameters
catalogEntryCatalogEntry for the asset being applied

◆ ApplyAssets()

ApiJobNoResult Astra.Asset.AvatarItem.ApplyAssets ( List< CatalogEntry catalogEntries)
inline

Used to apply a set of assets to an avatar

Parameters
catalogEntriesList of CatalogEntries for assets to apply
Returns

◆ Compatible()

bool Astra.Asset.AvatarItem.Compatible ( CompoundItem  compoundItem)
inline

Tells you if a CompoundItem is compatible with this AvatarItem

Parameters
compoundItemThe loaded item being queried
Returns
True if compatible, false otherwise

Implements Astra.Asset.IAstraItemCompatabilityInterface.

◆ GetEyeModifier()

EyeModifierRecord Astra.Asset.AvatarItem.GetEyeModifier ( )
inline

Retrieves the EyeModifierRecord for this AvatarItem, which can be used to adjust eye parameters.

Returns
The EyeModifierRecord if it exists, null otherwise

◆ GetItemFromGuid()

ItemBase Astra.Asset.AvatarItem.GetItemFromGuid ( string  guid)
inline

Retrieves the ItemBase for the given asset if the asset is attached to the Avatar.

Parameters
guidThe Guid of the asset you're looking for
Returns

◆ GetRecipe()

string Astra.Asset.AvatarItem.GetRecipe ( )
inline

Retrieves a JSON encoded avatar recipe this is the same recipe stored in SaveAvatar but does not save the avatar

Returns
A JSON encoded string containing avatar recipe information

◆ LoadFromGuid()

AvatarLoadJob Astra.Asset.AvatarItem.LoadFromGuid ( string  guid)
inline

A convenience function that loads the avatar provided by guid into the current avatar NOTE: this functinos the same as using Loader.LoadAvatar

Parameters
guidThe guid you want to load
Returns
A job you can listen to for state/success/data/etc

◆ RemoveAllItems()

ApiJobNoResult Astra.Asset.AvatarItem.RemoveAllItems ( )
inline

Removes all compound items except figures (so just hair, cloth, etc), decals, and morphs from the current avatar.

This will reset any applied items on the avatar as well as simply removing the components.

◆ RemoveAsset() [1/2]

void Astra.Asset.AvatarItem.RemoveAsset ( CatalogEntry  catalogEntry)
inline

Used to remove an asset such as a ClothItem from an avatar.

Parameters
catalogEntryCatalogEntry for the asset being removed

◆ RemoveAsset() [2/2]

void Astra.Asset.AvatarItem.RemoveAsset ( string  guid)
inline

Used to remove an asset such as a ClothItem from an avatar.

Parameters
guidThe asset GUID you're attempting to remove

◆ SaveAvatar()

ApiJobNoResult Astra.Asset.AvatarItem.SaveAvatar ( )
inline

Saves the Avatar by serializing into an recipe and stores both locally and remotely. You can then use the GUID later to load the saved Avatar upon success.

Returns
A job which you can wait upon for completion for success or failure, if a failure occurs please check the native logs

◆ SetEyeModifier()

void Astra.Asset.AvatarItem.SetEyeModifier ( EyeModifierRecord  emr)
inline

Stores and applies the EyeModifierRecord for this AvatarItem, which can be used to adjust eye parameters, does nothing if there is no EyeItem found

Parameters
eyeModifierThe EyeModifierRecord to use

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