MCS-SDK  1.6.4
MORPH3D.M3DCharacterManager Class Reference

An M3DCharacterManager is a subclass of Unity's MonoBehavior and is automatically attached to MCS Figures when they are loaded into the scene. Every MCS figure will have its own instance of M3DCharacterManager. More...

Inherits MonoBehaviour.

Public Member Functions

delegate void PreLODChange (float level, SkinnedMeshRenderer activeFigure)
 
delegate void PostLODChange (float level, SkinnedMeshRenderer activeFigure, bool figureChanged)
 
Animator GetAnimatorManager ()
 Returns a reference to MCS Figure's Animator Component. More...
 
JCTTransition GetJctManager ()
 Returns a reference to the JCTTransition for this MCS Figure that this M3DCharacterManager is component of. More...
 
delegate void M3DCMBlendshapeValueChange ()
 Delegate and event for raising whenever a Blendshape value changes. More...
 
void OnPostJCT ()
 
void ShutJaw ()
 Forces the jaw bone to be shut, fires after animation and jct More...
 
void RemoveAllMorphs ()
 Clears all morphs from the figure and clothing More...
 
void SyncAllBlendShapes ()
 Syncs all blendshapes on the figure, clothing and hair. More...
 
Morph [] GetActiveBlendShapes ()
 Returns an Array of Morph objects who's value is non-zero. More...
 
bool SetBlendshapeValue (string morphName, float value)
 Auto attaches and drives a morph from a range of 0-100f where 0 is no morph and 100 is full morph More...
 
delegate void OnPostSetBlendshapeValueAsync ()
 Delegate type used as a callback in SetBlendshapeValueAsync More...
 
void SetBlendshapeValueAsync (string morphName, float value, OnPostSetBlendshapeValueAsync callback=null)
 Async method that automatically attaches and drives a morph from a range of 0-100f where 0 is no morph and 100 is full morph More...
 
void SyncMorphsToJCT (Morph[] morphs=null)
 Registers morph names and values with the JCT Manager More...
 
void ResetAllBlendshapes ()
 Finds all SMRs on figure and sets ALL blendshapes to 0, generally this is used to fix serialization issues and nothing more More...
 
void DetectAttachmentPoints ()
 Detects all CIattachmentpoints that are present and children of specific bones on the main skeleton of the figure. More...
 
void DetectAttachedClothing ()
 Detects all CIclothing that are present, visible and children of the root Character Manager game object When unattached clothing is found it is attached and registerd with the character manager. More...
 
void DetectAttachedProps ()
 Detects CIprops that are present, visible and children of registered attachment points. When detected the props are registered with the character manager. More...
 
void DetectAttachedHair ()
 Detects CIhair that is present, visible and a child of the root character manager game object. When detected the CIhair will be registered with the character manager. More...
 
CIclothing AttachCIClothing (CIclothing clothing, bool clone_item)
 Attachs and binds a CIclothing item to the figure. If used in the Editor, the attachment is permanent. If used at runtime, the changes are lost at termination. More...
 
CIhair AttachCIHair (CIhair hair, bool clone_item)
 Attachs and binds a CIhair item to the figure. If used in the Editor, the attachment is permanent. If used at runtime, the changes are lost at termination. More...
 
CIprop AttachCIProp (CIprop prop, bool clone_item)
 Attachs a CIprop to the figure. If used in the Editor, the attachment is permanent. If used at runtime, the changes are lost at termination. This is not the same as AttachmentPoints. More...
 
void SetLODLevel (float level)
 Sets the LOD level on all character associated sub-geometries. More...
 
void AddContentPack (ContentPack content_pack)
 Adds the given ContentPack to the ContentPackModel, and loads it onto the figure. More...
 
void AddContentPackToModel (ContentPack content_pack)
 Helper method for AddContentPack(). More...
 
void RemoveContentPackFromModel (GameObject obj, bool and_all_instances=false)
 Should be helper method for non-existant RemoveContentPack(). Should be internal or private. Should remove the content pack from the figure. Should also be renamed to the less confusing RemoveContentPackFromContentPackModel() More...
 
void RemoveAllContentPacks ()
 Unload and remove ALL content packs from the figure More...
 
bool HasContentPack (ContentPack cp)
 Returns true if a content pack is in the available list of the figure More...
 
void RemoveContentPack (ContentPack cp)
 Unload and remove the content pack from the figure More...
 
void SyncHairOverlays ()
 
void MarkHairAsDirty ()
 
List< ContentPackGetAllContentPacks ()
 Returns a list of all ContentPacks in the ContentPackModel. More...
 
GameObject LoadContentPackToFigure (ContentPack content_pack)
 Loads a given ContentPack onto the figure. More...
 
void UnloadContentPackFromFigure (ContentPack content_pack)
 Unloads the given ContentPack from the figure. More...
 
GameObject LoadClothingFromContentPackToFigure (CIclothing clothing)
 Adds a given CIclothing to the overall CostumeModel for this figure. If the CIclothing already exists in the CostumeModel, the GameObject returned is that of the existant CIclothing. More...
 
GameObject LoadHairFromContentPackToFigure (CIhair hair)
 Adds a given CIhair to the overall CostumeModel for this figure. If the CIhair already exists in the CostumeModel, the GameObject returned is that of the existant CIhair. More...
 
void ClearHeadOverlay ()
 Removes the hair cap mask texture More...
 
void InstallOverlay (Texture2D texture, Color color)
 Places an overlay with the given texture and color on the figure's head. Overlay for the head replaces the need for a separate skull cap. More...
 
Material GetHairMaterial ()
 The SkinnedMeshRenderers of an MCS Figure each have 3 material slots. More...
 
Material GetBodyMaterial ()
 The SkinnedMeshRenderers of an MCS Figure each have 3 material slots. More...
 
Material GetEyeAndLashMaterial ()
 The SkinnedMeshRenderers of an MCS Figure each have 3 material slots. More...
 
GameObject LoadPropFromContentPackToFigure (CIprop prop)
 Adds a given CIprop to the overall CostumeModel for this figure. If the CIprop already exists in the CostumeModel, the GameObject returned is that of the existant CIprop. More...
 
List< CIclothingGetAllClothing ()
 Returns a list of all CIclothings loaded into the character manager. More...
 
CIclothing GetClothingByID (string id)
 Returns a specific CIclothing loaded into the manager. More...
 
List< CIclothingGetVisibleClothing ()
 Returns a list of all CIclothing in the character manager that are visible. More...
 
void SetClothingVisibility (string id, bool visibility)
 Sets a CIclothing items visibility by name. More...
 
void ReloadHairFromFigure ()
 Using DetectAttachedHair(), reloads CIhair that are currently visible. More...
 
List< CIhairGetAllHair ()
 Returns a list of all CIhair currently loaded into the character manager. More...
 
CIhair GetHairByID (string hair_id)
 Gets a CIhair (currently loaded into the character manager), by name. More...
 
List< CIhairGetVisibleHair ()
 Returns a list of all CIhair items that are currently set to visible. More...
 
List< CIpropGetAllLoadedProps ()
 Sets the visibility on a CIhair item. More...
 
void DetachAndUnloadProp (CIprop prop, bool and_all_instances=false)
 Removes a specific prop from all attachment points and unloads it from the character manager. More...
 
CIprop GetLoadedPropByName (string name)
 Returns a CIprop item by name, if the item isn't loaded into the character manager returns a null. More...
 
List< CIpropGetAllAttachedProps ()
 Returns a list of all props currently attached via the attachment point system. Note, this method only returns attachment point props, to get a list of props loaded into the character manager use GetAllLoadedProps(). More...
 
CIattachmentPoint CreateAttachmentPointFromGameObject (GameObject target)
 If passed a game object this method adds and registers an attachment point. In order for this method to work correctly the attachment point will need to be a child of the MCS figures skeleton. More...
 
CIattachmentPoint CreateAttachmentPointOnBone (string bone_name, APLayout layout=null)
 Creates and registers an attachment point on a specific bone in an MCS figure. More...
 
void DeleteAttachmentPoint (string name)
 Removes a specific attachment point, by name, from the character manager. All props attached to the attachment point will be garbage collected. More...
 
CIattachmentPoint [] GetAllAttachmentPoints ()
 Returns an array of all CIattachmentPoints on a given character manager. More...
 
CIattachmentPoint GetAttachmentPointByName (string name)
 Returns a specific CIattachementPoint when requested by name. Null if the attachment point doesn't exist. More...
 
void AttachPropToAttachmentPoint (string propName, string attachmentPointName)
 Attachs a CIprop, by name, to an attachment point, also by name. More...
 
void DetachPropFromAttachmentPoint (string propName, string attachmentPointName)
 Removes CIprop, by name, from a specific attachment point, also by name. More...
 
Transform GetBoneByName (string name)
 Returns a bone from an MCS figure's skeleton. More...
 
string [] GetAllBonesNames ()
 Returns a string array with all bone names contained in the MCS figure's skeleton. More...
 
void ClearAlphaInjectionBuffers (bool fetch=true)
 Empties the MaterialBuffer in the AlphaInjectionManager More...
 
void SyncAlphaInjection ()
 Marks the current AlphaInjectionManager as dirty so that it will be re-rendered the next time it is processed. More...
 
void OnDestroy ()
 Called by the Unity Engine when the GameObject is destroyed. More...
 
void RemoveRogueContent ()
 Attempts to find items that are on the figure that should not be and will remove them More...
 
void ResyncBounds ()
 Forces an update on the current bounding boxes for SkinnedMeshRenderers. More...
 

Public Attributes

bool HasClonedMeshes = false
 True if there are cloned meshes for the JCT service. More...
 
float currentLODLevel = 1f
 The current LOD level expressed as a scalar value. More...
 
COSTUME_BOUNDS_UPDATE_FREQUENCY CostumeBoundsUpdateFrequency = COSTUME_BOUNDS_UPDATE_FREQUENCY.NEVER
 Determins how frequently, if ever, will we update the bounds of a costume item. Never by default. More...
 
bool ResetBlendshapesOnStart = true
 Do we reset morphs on start, if yes, it means all blendshapes on all SMR are zero'd out, this is needed for state serialization when you have 2 figures using the same fbx with different morphs NOTE: this should only be false for 2 reasons, 1: you don't want the performance cost of reseting these (not a high cost though), 2: you have custom blendshapes that aren't managed by MCS More...
 
bool ForceJawShut = false
 Should the jaw bone be forced shut, this is useful if you have animations that don't have a jaw bone and the mouth hangs open Generally speaking this should be set to false in most cases. More...
 

Static Public Attributes

static float Version = 1.6f
 The version number. More...
 
static int Major = 1
 
static int Minor = 6
 
static int Revision = 4
 

Protected Member Functions

void SyncCurrentLODLevel (float level=-1)
 Syncs attached CIClothing, CIProps and figure meshes with the current LOD level of the M3DCharacterManager. More...
 
void DestroyCP (Transform trans)
 Removes the given Transform from the scene graph and by extension the Figure and destroys the GameObject More...
 

Protected Attributes

Dictionary< string, float > CurrentJCTBlendshapes
 Dictionary of blendshape names and values that are attached and require JCT service. More...
 

Properties

string VersionInfo [get]
 A formatted string with the version number of this M3DCharacterManager. More...
 
bool isAwake [get]
 True if the Awake() method has been called by the Unity Engine. More...
 
CoreMorphs coreMorphs [get]
 Reference to the CoreMorphs for this M3DCharacterManager Use coreMorphs to gain access to individual Morphs on the figure. More...
 
AlphaInjectionManager alphaInjection [get]
 Internal. Accessor and initialiser for the reference to the AlphaInjectionManager for this figure. More...
 
Transform jawBone [get]
 

Events

PreLODChange OnPreLODChange
 Fired before SetLODLevel More...
 
PostLODChange OnPostLODChange
 Fired after SetLODLevel More...
 
M3DCMBlendshapeValueChange OnM3DCMBlendshapeValueChange
 Event broadcast whenever a Blendshape value on the figure has changed. More...
 

Detailed Description

An M3DCharacterManager is a subclass of Unity's MonoBehavior and is automatically attached to MCS Figures when they are loaded into the scene. Every MCS figure will have its own instance of M3DCharacterManager.

THe M3DCharacterManager provides access to the majority of the M3D API that game developers will need when working with MCS. To get a reference to the M3DCharacterManager on an MCS figure in a MonoBehaviour attached to an MCS Figure use Monobehaviours GetComponent method.

M3DCharacterManager m_CharacterManager = GetComponent<M3DCharacterManager>();

Member Function Documentation

◆ AddContentPack()

void MORPH3D.M3DCharacterManager.AddContentPack ( ContentPack  content_pack)

Adds the given ContentPack to the ContentPackModel, and loads it onto the figure.

Parameters
content_packContent pack.

THIS IS CONFUSING AND NEEDS TO BE ADDRESSED. There is no RemoveContentPack() function call.

◆ AddContentPackToModel()

void MORPH3D.M3DCharacterManager.AddContentPackToModel ( ContentPack  content_pack)

Helper method for AddContentPack().

Should be internal or private. Should also be renamed to the less confusing AddContentPackToContentPackModel() Use AddContentPack(ConetntPack content_pack) instead.

Parameters
content_packThe content pack to add to the ContentPackModel

◆ AttachCIClothing()

CIclothing MORPH3D.M3DCharacterManager.AttachCIClothing ( CIclothing  clothing,
bool  clone_item 
)

Attachs and binds a CIclothing item to the figure. If used in the Editor, the attachment is permanent. If used at runtime, the changes are lost at termination.

Returns
The CIclothing added. Original or clone as defined with the boolean flag clone_item.
Parameters
clothingClothing.
clone_itemIf set to true the CIclothing is cloned.

◆ AttachCIHair()

CIhair MORPH3D.M3DCharacterManager.AttachCIHair ( CIhair  hair,
bool  clone_item 
)

Attachs and binds a CIhair item to the figure. If used in the Editor, the attachment is permanent. If used at runtime, the changes are lost at termination.

Returns
The CIhair added. Original or clone as defined with the boolean flag clone_item.
Parameters
hairThe CIhair item to add.
clone_itemIf set to true the CIhair is cloned.

◆ AttachCIProp()

CIprop MORPH3D.M3DCharacterManager.AttachCIProp ( CIprop  prop,
bool  clone_item 
)

Attachs a CIprop to the figure. If used in the Editor, the attachment is permanent. If used at runtime, the changes are lost at termination. This is not the same as AttachmentPoints.

Returns
The CIprop added. Original or clone as defined with the boolean flag clone_item.
Parameters
propThe CIprop to add.
clone_itemIf set to true the CIprop is cloned.

◆ AttachPropToAttachmentPoint()

void MORPH3D.M3DCharacterManager.AttachPropToAttachmentPoint ( string  propName,
string  attachmentPointName 
)

Attachs a CIprop, by name, to an attachment point, also by name.

Parameters
propNameProperty name.
attachmentPointNameAttachment point name.

◆ ClearAlphaInjectionBuffers()

void MORPH3D.M3DCharacterManager.ClearAlphaInjectionBuffers ( bool  fetch = true)

Empties the MaterialBuffer in the AlphaInjectionManager

Parameters
fetch

It doesn't appear that ClearMaterialBuffers does anything anymore. Is this just here for legacy code? If so we should deprecate it.

◆ ClearHeadOverlay()

void MORPH3D.M3DCharacterManager.ClearHeadOverlay ( )

Removes the hair cap mask texture

◆ CreateAttachmentPointFromGameObject()

CIattachmentPoint MORPH3D.M3DCharacterManager.CreateAttachmentPointFromGameObject ( GameObject  target)

If passed a game object this method adds and registers an attachment point. In order for this method to work correctly the attachment point will need to be a child of the MCS figures skeleton.

Returns
The attachment point from game object.
Parameters
targetTarget.

◆ CreateAttachmentPointOnBone()

CIattachmentPoint MORPH3D.M3DCharacterManager.CreateAttachmentPointOnBone ( string  bone_name,
APLayout  layout = null 
)

Creates and registers an attachment point on a specific bone in an MCS figure.

Returns
The attachment point on bone.
Parameters
bone_nameBone_name.
layoutThe [Optional] Attachment Point Layout.

◆ DeleteAttachmentPoint()

void MORPH3D.M3DCharacterManager.DeleteAttachmentPoint ( string  name)

Removes a specific attachment point, by name, from the character manager. All props attached to the attachment point will be garbage collected.

Parameters
nameName.

◆ DestroyCP()

void MORPH3D.M3DCharacterManager.DestroyCP ( Transform  trans)
protected

Removes the given Transform from the scene graph and by extension the Figure and destroys the GameObject

For best results use UnloadContentPackFromFigure

Parameters
transThe transform of the GameObject to be removed.

◆ DetachAndUnloadProp()

void MORPH3D.M3DCharacterManager.DetachAndUnloadProp ( CIprop  prop,
bool  and_all_instances = false 
)

Removes a specific prop from all attachment points and unloads it from the character manager.

Parameters
propProperty.
and_all_instancesIf set to true and_all_instances.

◆ DetachPropFromAttachmentPoint()

void MORPH3D.M3DCharacterManager.DetachPropFromAttachmentPoint ( string  propName,
string  attachmentPointName 
)

Removes CIprop, by name, from a specific attachment point, also by name.

Parameters
propNameProperty name.
attachmentPointNameAttachment point name.

◆ DetectAttachedClothing()

void MORPH3D.M3DCharacterManager.DetectAttachedClothing ( )

Detects all CIclothing that are present, visible and children of the root Character Manager game object When unattached clothing is found it is attached and registerd with the character manager.

◆ DetectAttachedHair()

void MORPH3D.M3DCharacterManager.DetectAttachedHair ( )

Detects CIhair that is present, visible and a child of the root character manager game object. When detected the CIhair will be registered with the character manager.

◆ DetectAttachedProps()

void MORPH3D.M3DCharacterManager.DetectAttachedProps ( )

Detects CIprops that are present, visible and children of registered attachment points. When detected the props are registered with the character manager.

◆ DetectAttachmentPoints()

void MORPH3D.M3DCharacterManager.DetectAttachmentPoints ( )

Detects all CIattachmentpoints that are present and children of specific bones on the main skeleton of the figure.

◆ GetActiveBlendShapes()

Morph [] MORPH3D.M3DCharacterManager.GetActiveBlendShapes ( )

Returns an Array of Morph objects who's value is non-zero.

◆ GetAllAttachedProps()

List<CIprop> MORPH3D.M3DCharacterManager.GetAllAttachedProps ( )

Returns a list of all props currently attached via the attachment point system. Note, this method only returns attachment point props, to get a list of props loaded into the character manager use GetAllLoadedProps().

Returns
The all attached properties.

◆ GetAllAttachmentPoints()

CIattachmentPoint [] MORPH3D.M3DCharacterManager.GetAllAttachmentPoints ( )

Returns an array of all CIattachmentPoints on a given character manager.

Returns
The all attachment points.

◆ GetAllBonesNames()

string [] MORPH3D.M3DCharacterManager.GetAllBonesNames ( )

Returns a string array with all bone names contained in the MCS figure's skeleton.

Returns
The all bones names.

◆ GetAllClothing()

List<CIclothing> MORPH3D.M3DCharacterManager.GetAllClothing ( )

Returns a list of all CIclothings loaded into the character manager.

Returns
The all loaded clothing items.

◆ GetAllContentPacks()

List<ContentPack> MORPH3D.M3DCharacterManager.GetAllContentPacks ( )

Returns a list of all ContentPacks in the ContentPackModel.

Returns
List of type ContentPack.

◆ GetAllHair()

List<CIhair> MORPH3D.M3DCharacterManager.GetAllHair ( )

Returns a list of all CIhair currently loaded into the character manager.

Returns
The all hair items.

◆ GetAllLoadedProps()

List<CIprop> MORPH3D.M3DCharacterManager.GetAllLoadedProps ( )

Sets the visibility on a CIhair item.

Parameters
nameName.
new_visIf set to true new_vis.

Returns a list of all CIprops loaded into the character manager. Note, props attached to attachment points will not be included in this list (use GetAllAttachedProps() instead).

Returns
The all loaded properties.

◆ GetAnimatorManager()

Animator MORPH3D.M3DCharacterManager.GetAnimatorManager ( )

Returns a reference to MCS Figure's Animator Component.

◆ GetAttachmentPointByName()

CIattachmentPoint MORPH3D.M3DCharacterManager.GetAttachmentPointByName ( string  name)

Returns a specific CIattachementPoint when requested by name. Null if the attachment point doesn't exist.

Returns
The attachment point by name.
Parameters
nameName.

◆ GetBodyMaterial()

Material MORPH3D.M3DCharacterManager.GetBodyMaterial ( )

The SkinnedMeshRenderers of an MCS Figure each have 3 material slots.

Returns the current Material on the Body Material Slot from the current SkinnedMeshRenderer.

Returns

◆ GetBoneByName()

Transform MORPH3D.M3DCharacterManager.GetBoneByName ( string  name)

Returns a bone from an MCS figure's skeleton.

If the bone does not exist in the skeleton returns null. GetAllBoneNames can be used to verify the existance of a bone name in the skeleton.

Returns
The bone by name.
Parameters
nameName.

◆ GetClothingByID()

CIclothing MORPH3D.M3DCharacterManager.GetClothingByID ( string  id)

Returns a specific CIclothing loaded into the manager.

Returns
The clothing item by name.
Parameters
IDDisplay name.

◆ GetEyeAndLashMaterial()

Material MORPH3D.M3DCharacterManager.GetEyeAndLashMaterial ( )

The SkinnedMeshRenderers of an MCS Figure each have 3 material slots.

Returns the current Material on teh Eye and Lash Material Slot from the current SkinnedMeshRenderer.

Returns

◆ GetHairByID()

CIhair MORPH3D.M3DCharacterManager.GetHairByID ( string  hair_id)

Gets a CIhair (currently loaded into the character manager), by name.

Returns
The hair item by name.
Parameters
nameName.

◆ GetHairMaterial()

Material MORPH3D.M3DCharacterManager.GetHairMaterial ( )

The SkinnedMeshRenderers of an MCS Figure each have 3 material slots.

Returns the current Material on the Head Material Slot from the current SkinnedMeshRenderer.

Returns

◆ GetJctManager()

JCTTransition MORPH3D.M3DCharacterManager.GetJctManager ( )

Returns a reference to the JCTTransition for this MCS Figure that this M3DCharacterManager is component of.

◆ GetLoadedPropByName()

CIprop MORPH3D.M3DCharacterManager.GetLoadedPropByName ( string  name)

Returns a CIprop item by name, if the item isn't loaded into the character manager returns a null.

Returns
The loaded property by name.
Parameters
nameName.

◆ GetVisibleClothing()

List<CIclothing> MORPH3D.M3DCharacterManager.GetVisibleClothing ( )

Returns a list of all CIclothing in the character manager that are visible.

Returns
The visible clothing.

◆ GetVisibleHair()

List<CIhair> MORPH3D.M3DCharacterManager.GetVisibleHair ( )

Returns a list of all CIhair items that are currently set to visible.

Returns
The all visible hair.

◆ HasContentPack()

bool MORPH3D.M3DCharacterManager.HasContentPack ( ContentPack  cp)

Returns true if a content pack is in the available list of the figure

Parameters
cp

◆ InstallOverlay()

void MORPH3D.M3DCharacterManager.InstallOverlay ( Texture2D  texture,
Color  color 
)

Places an overlay with the given texture and color on the figure's head. Overlay for the head replaces the need for a separate skull cap.

Parameters
textureTexture for the overlay.
colorAdditive color for the overlay.

◆ LoadClothingFromContentPackToFigure()

GameObject MORPH3D.M3DCharacterManager.LoadClothingFromContentPackToFigure ( CIclothing  clothing)

Adds a given CIclothing to the overall CostumeModel for this figure. If the CIclothing already exists in the CostumeModel, the GameObject returned is that of the existant CIclothing.

Returns
The property from content pack to figure.
Parameters
propThe CIclothing to add.

◆ LoadContentPackToFigure()

GameObject MORPH3D.M3DCharacterManager.LoadContentPackToFigure ( ContentPack  content_pack)

Loads a given ContentPack onto the figure.

Returns
The root of the ContentPack as a GameObject
Parameters
content_packThe ContentPack to load.

◆ LoadHairFromContentPackToFigure()

GameObject MORPH3D.M3DCharacterManager.LoadHairFromContentPackToFigure ( CIhair  hair)

Adds a given CIhair to the overall CostumeModel for this figure. If the CIhair already exists in the CostumeModel, the GameObject returned is that of the existant CIhair.

Returns
The property from content pack to figure.
Parameters
propThe CIhair to add.

◆ LoadPropFromContentPackToFigure()

GameObject MORPH3D.M3DCharacterManager.LoadPropFromContentPackToFigure ( CIprop  prop)

Adds a given CIprop to the overall CostumeModel for this figure. If the CIprop already exists in the CostumeModel, the GameObject returned is that of the existant CIprop.

Returns
The property from content pack to figure.
Parameters
propThe CIprop to add.

◆ M3DCMBlendshapeValueChange()

delegate void MORPH3D.M3DCharacterManager.M3DCMBlendshapeValueChange ( )

Delegate and event for raising whenever a Blendshape value changes.

◆ OnDestroy()

void MORPH3D.M3DCharacterManager.OnDestroy ( )

Called by the Unity Engine when the GameObject is destroyed.

◆ OnPostSetBlendshapeValueAsync()

delegate void MORPH3D.M3DCharacterManager.OnPostSetBlendshapeValueAsync ( )

Delegate type used as a callback in SetBlendshapeValueAsync

◆ ReloadHairFromFigure()

void MORPH3D.M3DCharacterManager.ReloadHairFromFigure ( )

Using DetectAttachedHair(), reloads CIhair that are currently visible.

◆ RemoveAllContentPacks()

void MORPH3D.M3DCharacterManager.RemoveAllContentPacks ( )

Unload and remove ALL content packs from the figure

◆ RemoveAllMorphs()

void MORPH3D.M3DCharacterManager.RemoveAllMorphs ( )

Clears all morphs from the figure and clothing

◆ RemoveContentPack()

void MORPH3D.M3DCharacterManager.RemoveContentPack ( ContentPack  cp)

Unload and remove the content pack from the figure

Parameters
cp

◆ RemoveContentPackFromModel()

void MORPH3D.M3DCharacterManager.RemoveContentPackFromModel ( GameObject  obj,
bool  and_all_instances = false 
)

Should be helper method for non-existant RemoveContentPack(). Should be internal or private. Should remove the content pack from the figure. Should also be renamed to the less confusing RemoveContentPackFromContentPackModel()

Parameters
objObject.
and_all_instancesIf set to true all instances of the content pack are removed.

THIS IS CONFUSING AND NEEDS TO BE ADDRESSED. There is no RemoveContentPack() function call.

◆ RemoveRogueContent()

void MORPH3D.M3DCharacterManager.RemoveRogueContent ( )

Attempts to find items that are on the figure that should not be and will remove them

◆ ResetAllBlendshapes()

void MORPH3D.M3DCharacterManager.ResetAllBlendshapes ( )

Finds all SMRs on figure and sets ALL blendshapes to 0, generally this is used to fix serialization issues and nothing more

◆ ResyncBounds()

void MORPH3D.M3DCharacterManager.ResyncBounds ( )

Forces an update on the current bounding boxes for SkinnedMeshRenderers.

See also CostumeBoundsUpdateFrequency

◆ SetBlendshapeValue()

bool MORPH3D.M3DCharacterManager.SetBlendshapeValue ( string  morphName,
float  value 
)

Auto attaches and drives a morph from a range of 0-100f where 0 is no morph and 100 is full morph

Parameters
morphNameThe "localName" of a morph, eg: FBMHeavy
valueThe value between 0-100f
Returns
True on success, false on failure

◆ SetBlendshapeValueAsync()

void MORPH3D.M3DCharacterManager.SetBlendshapeValueAsync ( string  morphName,
float  value,
OnPostSetBlendshapeValueAsync  callback = null 
)

Async method that automatically attaches and drives a morph from a range of 0-100f where 0 is no morph and 100 is full morph

Parameters
morphNameThe "localName" of a morph eg. FBMHeavy
valueThe value of the morph 0 - 100f
callbackOptional call back method run when the Blendshape value has been set.

◆ SetClothingVisibility()

void MORPH3D.M3DCharacterManager.SetClothingVisibility ( string  id,
bool  visibility 
)

Sets a CIclothing items visibility by name.

Parameters
nameName.
visibilityIf set to true visibility.

◆ SetLODLevel()

void MORPH3D.M3DCharacterManager.SetLODLevel ( float  level)

Sets the LOD level on all character associated sub-geometries.

Parameters
levelThe scalar level.

◆ ShutJaw()

void MORPH3D.M3DCharacterManager.ShutJaw ( )

Forces the jaw bone to be shut, fires after animation and jct

◆ SyncAllBlendShapes()

void MORPH3D.M3DCharacterManager.SyncAllBlendShapes ( )

Syncs all blendshapes on the figure, clothing and hair.

◆ SyncAlphaInjection()

void MORPH3D.M3DCharacterManager.SyncAlphaInjection ( )

Marks the current AlphaInjectionManager as dirty so that it will be re-rendered the next time it is processed.

◆ SyncCurrentLODLevel()

void MORPH3D.M3DCharacterManager.SyncCurrentLODLevel ( float  level = -1)
protected

Syncs attached CIClothing, CIProps and figure meshes with the current LOD level of the M3DCharacterManager.

Parameters
level

◆ SyncMorphsToJCT()

void MORPH3D.M3DCharacterManager.SyncMorphsToJCT ( Morph []  morphs = null)

Registers morph names and values with the JCT Manager

Parameters
morphs\ Array of Morph objects to sync. If Null all morphs from coreMorphs are synced. null by default

◆ UnloadContentPackFromFigure()

void MORPH3D.M3DCharacterManager.UnloadContentPackFromFigure ( ContentPack  content_pack)

Unloads the given ContentPack from the figure.

Parameters
content_packContent pack.

Member Data Documentation

◆ CostumeBoundsUpdateFrequency

COSTUME_BOUNDS_UPDATE_FREQUENCY MORPH3D.M3DCharacterManager.CostumeBoundsUpdateFrequency = COSTUME_BOUNDS_UPDATE_FREQUENCY.NEVER

Determins how frequently, if ever, will we update the bounds of a costume item. Never by default.

◆ CurrentJCTBlendshapes

Dictionary<string, float> MORPH3D.M3DCharacterManager.CurrentJCTBlendshapes
protected

Dictionary of blendshape names and values that are attached and require JCT service.

◆ currentLODLevel

float MORPH3D.M3DCharacterManager.currentLODLevel = 1f

The current LOD level expressed as a scalar value.

◆ ForceJawShut

bool MORPH3D.M3DCharacterManager.ForceJawShut = false

Should the jaw bone be forced shut, this is useful if you have animations that don't have a jaw bone and the mouth hangs open Generally speaking this should be set to false in most cases.

◆ HasClonedMeshes

bool MORPH3D.M3DCharacterManager.HasClonedMeshes = false

True if there are cloned meshes for the JCT service.

◆ ResetBlendshapesOnStart

bool MORPH3D.M3DCharacterManager.ResetBlendshapesOnStart = true

Do we reset morphs on start, if yes, it means all blendshapes on all SMR are zero'd out, this is needed for state serialization when you have 2 figures using the same fbx with different morphs NOTE: this should only be false for 2 reasons, 1: you don't want the performance cost of reseting these (not a high cost though), 2: you have custom blendshapes that aren't managed by MCS

◆ Version

float MORPH3D.M3DCharacterManager.Version = 1.6f
static

The version number.

Property Documentation

◆ alphaInjection

AlphaInjectionManager MORPH3D.M3DCharacterManager.alphaInjection
get

Internal. Accessor and initialiser for the reference to the AlphaInjectionManager for this figure.

Returns a reference to the AlphaInjectionManager for this figure.

◆ coreMorphs

CoreMorphs MORPH3D.M3DCharacterManager.coreMorphs
get

Reference to the CoreMorphs for this M3DCharacterManager Use coreMorphs to gain access to individual Morphs on the figure.

◆ isAwake

bool MORPH3D.M3DCharacterManager.isAwake
get

True if the Awake() method has been called by the Unity Engine.

◆ VersionInfo

string MORPH3D.M3DCharacterManager.VersionInfo
get

A formatted string with the version number of this M3DCharacterManager.

The format of the is of the form: {Major}.{Minor}.{Revision}

Event Documentation

◆ OnM3DCMBlendshapeValueChange

M3DCMBlendshapeValueChange MORPH3D.M3DCharacterManager.OnM3DCMBlendshapeValueChange

Event broadcast whenever a Blendshape value on the figure has changed.

Subscribe to this event to find out whenever a Blendshape value has changed.

◆ OnPostLODChange

PostLODChange MORPH3D.M3DCharacterManager.OnPostLODChange

Fired after SetLODLevel

◆ OnPreLODChange

PreLODChange MORPH3D.M3DCharacterManager.OnPreLODChange

Fired before SetLODLevel


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