C# Класс OpenMetaverse.AppearanceManager

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
BAKED_TEXTURE_HASH UUID[]
BakeIndexToTextureIndex byte[]
DEFAULT_AVATAR_TEXTURE UUID
WEARABLE_BAKE_MAP WearableType[][]

Открытые методы

Метод Описание
AddAttachments ( List attachments, bool removeExistingFirst ) : void

Adds a list of attachments to our agent

AddToOutfit ( InventoryItem wearableItem ) : void

Add a wearable to the current outfit and set appearance

AddToOutfit ( List wearableItems ) : void

Add a list of wearables to the current outfit and set appearance

AppearanceManager ( GridClient client ) : System

Default constructor

Attach ( InventoryItem item, AttachmentPoint attachPoint ) : void

Attach an item to our agent at a specific attach point

Attach ( UUID itemID, UUID ownerID, string name, string description, Permissions perms, uint itemFlags, AttachmentPoint attachPoint ) : void

Attach an item to our agent specifying attachment details

BakeTypeToAgentTextureIndex ( BakeType index ) : AvatarTextureIndex

Converts a BakeType to the corresponding baked texture slot in AvatarTextureIndex

BakeTypeToTextures ( BakeType bakeType ) : List

Converts a BakeType to a list of the texture slots that make up that bake

Detach ( InventoryItem item ) : void

Detach an item from our agent using an OpenMetaverse.InventoryItem object

Detach ( UUID itemID ) : void

Detach an item from our agent

GetWearableAsset ( WearableType type ) : UUID

Returns the AssetID of the asset that is currently being worn in a given WearableType slot

GetWearables ( ) : WearableData>.Dictionary

Returns a copy of the agents currently worn wearables

Avoid calling this function multiple times as it will make a copy of all of the wearable data each time

IsItemWorn ( InventoryItem item ) : WearableType

Checks if an inventory item is currently being worn

MorphLayerForBakeType ( BakeType bakeType ) : AvatarTextureIndex

Gives the layer number that is used for morph mask

RemoveFromOutfit ( InventoryItem wearableItem ) : void

Remove a wearable from the current outfit and set appearance

RemoveFromOutfit ( List wearableItems ) : void

Removes a list of wearables from the current outfit and set appearance

ReplaceOutfit ( List wearableItems ) : void

Replace the current outfit with a list of wearables and set appearance

RequestAgentWearables ( ) : void

Ask the server what textures our agent is currently wearing

RequestCachedBakes ( ) : void

Build hashes out of the texture assetIDs for each baking layer to ask the simulator whether it has cached copies of each baked texture

RequestSetAppearance ( ) : void

Starts the appearance setting thread

RequestSetAppearance ( bool forceRebake ) : void

Starts the appearance setting thread

WearOutfit ( List wearables, bool replaceItems ) : void

Calls either ReplaceOutfit or AddToOutfit depending on the value of replaceItems

WearableTypeToAssetType ( WearableType type ) : AssetType

Converts a WearableType to a bodypart or clothing WearableType

Защищенные методы

Метод Описание
AgentCachedTextureResponseHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
AgentWearablesUpdateHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
OnAgentCachedBakes ( AgentCachedBakesReplyEventArgs e ) : void

Raises the CachedBakesReply event

OnAgentWearables ( AgentWearablesReplyEventArgs e ) : void

Raises the AgentWearablesReply event

OnAppearanceSet ( AppearanceSetEventArgs e ) : void

Raises the AppearanceSet event

OnRebakeAvatar ( RebakeAvatarTexturesEventArgs e ) : void

Raises the RebakeAvatarRequested event

RebakeAvatarTexturesHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Приватные методы

Метод Описание
AddTextureDownload ( AvatarTextureIndex index, List textures ) : void

Helper method to lookup the TextureID for a single layer and add it to a list if it is not already present

CreateBake ( BakeType bakeType ) : bool

Blocking method to create and upload a baked texture for a single bake layer

CreateBakes ( ) : bool

Blocking method to create and upload baked textures for all of the missing bakes

DecodeWearableParams ( WearableData wearable ) : void

Populates textures and visual params from a decoded asset

DelayedRequestSetAppearance ( ) : void
DownloadTextures ( List bakeLayers ) : void

Blocking method to download all of the textures needed for baking the given bake layers

No return value is given because the baking will happen whether or not all textures are successfully downloaded

DownloadWearables ( ) : bool

Blocking method to download and parse currently worn wearable assets

GetAgentWearables ( ) : bool

Blocking method to populate the Wearables dictionary

GetCachedBakes ( ) : bool

Blocking method to populate the Textures array with cached bakes

GetColorFromParams ( List param ) : Color4

Calculates base color/tint for a specific wearable based on its params

GetFolderWearables ( UUID folder, List &wearables, List &attachments ) : bool
GetFolderWearables ( string folderPath, List &wearables, List &attachments ) : bool
GetTextureDownloadList ( BakeType bakeType ) : List

Get a list of all of the textures that need to be downloaded for a single bake layer

MakeParamValues ( ) : float>.Dictionary

Creates a dictionary of visual param values from the downloaded wearables

Network_OnDisconnected ( object sender, OpenMetaverse.DisconnectedEventArgs e ) : void
Network_OnEventQueueRunning ( object sender, OpenMetaverse.EventQueueRunningEventArgs e ) : void
RebakeScheduleTimerTick ( Object state ) : void
ReplaceOutfit ( List wearableItems ) : void

Replaces the Wearables collection with a list of new wearable items

RequestAgentSetAppearance ( ) : void

Create an AgentSetAppearance packet from Wearables data and the Textures array and send it

SendAgentIsNowWearing ( ) : void

Inform the sim which wearables are part of our current outfit

SetPreviousAppearance ( ) : void
SetPreviousAppearance ( bool allowBake ) : void
UploadBake ( byte textureData ) : UUID

Blocking method to upload a baked texture

Описание методов

AddAttachments() публичный Метод

Adds a list of attachments to our agent
public AddAttachments ( List attachments, bool removeExistingFirst ) : void
attachments List A List containing the attachments to add
removeExistingFirst bool If true, tells simulator to remove existing attachment /// first
Результат void

AddToOutfit() публичный Метод

Add a wearable to the current outfit and set appearance
public AddToOutfit ( InventoryItem wearableItem ) : void
wearableItem InventoryItem Wearable to be added to the outfit
Результат void

AddToOutfit() публичный Метод

Add a list of wearables to the current outfit and set appearance
public AddToOutfit ( List wearableItems ) : void
wearableItems List List of wearable inventory items to /// be added to the outfit
Результат void

AgentCachedTextureResponseHandler() защищенный Метод

protected AgentCachedTextureResponseHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object
e OpenMetaverse.PacketReceivedEventArgs
Результат void

AgentWearablesUpdateHandler() защищенный Метод

protected AgentWearablesUpdateHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object
e OpenMetaverse.PacketReceivedEventArgs
Результат void

AppearanceManager() публичный Метод

Default constructor
public AppearanceManager ( GridClient client ) : System
client GridClient A reference to our agent
Результат System

Attach() публичный Метод

Attach an item to our agent at a specific attach point
public Attach ( InventoryItem item, AttachmentPoint attachPoint ) : void
item InventoryItem A to attach
attachPoint AttachmentPoint the on the avatar /// to attach the item to
Результат void

Attach() публичный Метод

Attach an item to our agent specifying attachment details
public Attach ( UUID itemID, UUID ownerID, string name, string description, Permissions perms, uint itemFlags, AttachmentPoint attachPoint ) : void
itemID UUID The of the item to attach
ownerID UUID The attachments owner
name string The name of the attachment
description string The description of the attahment
perms Permissions The to apply when attached
itemFlags uint The of the attachment
attachPoint AttachmentPoint The on the agent /// to attach the item to
Результат void

BakeTypeToAgentTextureIndex() публичный статический Метод

Converts a BakeType to the corresponding baked texture slot in AvatarTextureIndex
public static BakeTypeToAgentTextureIndex ( BakeType index ) : AvatarTextureIndex
index BakeType A BakeType
Результат AvatarTextureIndex

BakeTypeToTextures() публичный статический Метод

Converts a BakeType to a list of the texture slots that make up that bake
public static BakeTypeToTextures ( BakeType bakeType ) : List
bakeType BakeType A BakeType
Результат List

Detach() публичный Метод

Detach an item from our agent using an OpenMetaverse.InventoryItem object
public Detach ( InventoryItem item ) : void
item InventoryItem An object
Результат void

Detach() публичный Метод

Detach an item from our agent
public Detach ( UUID itemID ) : void
itemID UUID The inventory itemID of the item to detach
Результат void

GetWearableAsset() публичный Метод

Returns the AssetID of the asset that is currently being worn in a given WearableType slot
public GetWearableAsset ( WearableType type ) : UUID
type WearableType WearableType slot to get the AssetID for
Результат UUID

GetWearables() публичный Метод

Returns a copy of the agents currently worn wearables
Avoid calling this function multiple times as it will make a copy of all of the wearable data each time
public GetWearables ( ) : WearableData>.Dictionary
Результат WearableData>.Dictionary

IsItemWorn() публичный Метод

Checks if an inventory item is currently being worn
public IsItemWorn ( InventoryItem item ) : WearableType
item InventoryItem The inventory item to check against the agent /// wearables
Результат WearableType

MorphLayerForBakeType() публичный статический Метод

Gives the layer number that is used for morph mask
public static MorphLayerForBakeType ( BakeType bakeType ) : AvatarTextureIndex
bakeType BakeType >A BakeType
Результат AvatarTextureIndex

OnAgentCachedBakes() защищенный Метод

Raises the CachedBakesReply event
protected OnAgentCachedBakes ( AgentCachedBakesReplyEventArgs e ) : void
e AgentCachedBakesReplyEventArgs An AgentCachedBakesReplyEventArgs object containing the /// data returned from the data server AgentCachedTextureResponse
Результат void

OnAgentWearables() защищенный Метод

Raises the AgentWearablesReply event
protected OnAgentWearables ( AgentWearablesReplyEventArgs e ) : void
e AgentWearablesReplyEventArgs An AgentWearablesReplyEventArgs object containing the /// data returned from the data server
Результат void

OnAppearanceSet() защищенный Метод

Raises the AppearanceSet event
protected OnAppearanceSet ( AppearanceSetEventArgs e ) : void
e AppearanceSetEventArgs An AppearanceSetEventArgs object indicating if the operatin was successfull
Результат void

OnRebakeAvatar() защищенный Метод

Raises the RebakeAvatarRequested event
protected OnRebakeAvatar ( RebakeAvatarTexturesEventArgs e ) : void
e RebakeAvatarTexturesEventArgs An RebakeAvatarTexturesEventArgs object containing the /// data returned from the data server
Результат void

RebakeAvatarTexturesHandler() защищенный Метод

protected RebakeAvatarTexturesHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object
e OpenMetaverse.PacketReceivedEventArgs
Результат void

RemoveFromOutfit() публичный Метод

Remove a wearable from the current outfit and set appearance
public RemoveFromOutfit ( InventoryItem wearableItem ) : void
wearableItem InventoryItem Wearable to be removed from the outfit
Результат void

RemoveFromOutfit() публичный Метод

Removes a list of wearables from the current outfit and set appearance
public RemoveFromOutfit ( List wearableItems ) : void
wearableItems List List of wearable inventory items to /// be removed from the outfit
Результат void

ReplaceOutfit() публичный Метод

Replace the current outfit with a list of wearables and set appearance
public ReplaceOutfit ( List wearableItems ) : void
wearableItems List List of wearable inventory items that /// define a new outfit
Результат void

RequestAgentWearables() публичный Метод

Ask the server what textures our agent is currently wearing
public RequestAgentWearables ( ) : void
Результат void

RequestCachedBakes() публичный Метод

Build hashes out of the texture assetIDs for each baking layer to ask the simulator whether it has cached copies of each baked texture
public RequestCachedBakes ( ) : void
Результат void

RequestSetAppearance() публичный Метод

Starts the appearance setting thread
public RequestSetAppearance ( ) : void
Результат void

RequestSetAppearance() публичный Метод

Starts the appearance setting thread
public RequestSetAppearance ( bool forceRebake ) : void
forceRebake bool True to force rebaking, otherwise false
Результат void

WearOutfit() публичный Метод

Calls either ReplaceOutfit or AddToOutfit depending on the value of replaceItems
public WearOutfit ( List wearables, bool replaceItems ) : void
wearables List List of wearable inventory items to add /// to the outfit or become a new outfit
replaceItems bool True to replace existing items with the /// new list of items, false to add these items to the existing outfit
Результат void

WearableTypeToAssetType() публичный статический Метод

Converts a WearableType to a bodypart or clothing WearableType
public static WearableTypeToAssetType ( WearableType type ) : AssetType
type WearableType A WearableType
Результат AssetType

Описание свойств

BAKED_TEXTURE_HASH публичное статическое свойство

Magic values to finalize the cache check hashes for each bake
public static UUID[] BAKED_TEXTURE_HASH
Результат UUID[]

BakeIndexToTextureIndex публичное статическое свойство

Mapping between BakeType and AvatarTextureIndex
public static byte[] BakeIndexToTextureIndex
Результат byte[]

DEFAULT_AVATAR_TEXTURE публичное статическое свойство

Default avatar texture, used to detect when a custom texture is not set for a face
public static UUID DEFAULT_AVATAR_TEXTURE
Результат UUID

WEARABLE_BAKE_MAP публичное статическое свойство

Map of what wearables are included in each bake
public static WearableType[][] WEARABLE_BAKE_MAP
Результат WearableType[][]