MeshBaker
MB3_MeshBakerCommon Class Referenceabstract

Maps a list of source materials to a combined material. More...

Inheritance diagram for MB3_MeshBakerCommon:
MB3_MeshBakerRoot MB3_MeshBaker MB3_MultiMeshBaker

Public Member Functions

override List< GameObject > GetObjectsToCombine ()
 
void EnableDisableSourceObjectRenderers (bool show)
 
virtual void ClearMesh ()
 Clears the meshs and mesh related data but does not destroy it. More...
 
virtual void DestroyMesh ()
 Clears and desroys the mesh. More...
 
virtual void DestroyMeshEditor (MB2_EditorMethodsInterface editorMethods)
 
virtual int GetNumObjectsInCombined ()
 
virtual int GetNumVerticesFor (GameObject go)
 
MB3_TextureBaker GetTextureBaker ()
 Gets the texture baker on this component or its parent if it exists More...
 
abstract bool AddDeleteGameObjects (GameObject[] gos, GameObject[] deleteGOs, bool disableRendererInSource=true)
 Adds and deletes objects from the combined mesh. More...
 
abstract bool AddDeleteGameObjectsByID (GameObject[] gos, int[] deleteGOinstanceIDs, bool disableRendererInSource=true)
 This is the best version to use for deleting game objects since the source GameObjects may have been destroyed Internaly Mesh Baker only stores the instanceID for Game Objects, so objects can be removed after they have been destroyed More...
 
virtual void Apply (MB3_MeshCombiner.GenerateUV2Delegate uv2GenerationMethod=null)
 Apply changes to the mesh. More...
 
virtual void Apply (bool triangles, bool vertices, bool normals, bool tangents, bool uvs, bool uv2, bool uv3, bool uv4, bool colors, bool bones=false, bool blendShapesFlag=false, MB3_MeshCombiner.GenerateUV2Delegate uv2GenerationMethod=null)
 Applys the changes to flagged properties of the mesh. More...
 
virtual bool CombinedMeshContains (GameObject go)
 
virtual void UpdateGameObjects (GameObject[] gos, bool recalcBounds=true, bool updateVertices=true, bool updateNormals=true, bool updateTangents=true, bool updateUV=false, bool updateUV1=false, bool updateUV2=false, bool updateColors=false, bool updateSkinningInfo=false)
 
virtual void UpdateSkinnedMeshApproximateBounds ()
 
virtual void UpdateSkinnedMeshApproximateBoundsFromBones ()
 
virtual void UpdateSkinnedMeshApproximateBoundsFromBounds ()
 

Public Attributes

List< GameObject > objsToMesh
 
bool useObjsToMeshFromTexBaker = true
 
bool clearBuffersAfterBake = true
 
string bakeAssetsInPlaceFolderPath
 
GameObject resultPrefab
 

Protected Member Functions

virtual bool _ValidateForUpdateSkinnedMeshBounds ()
 

Properties

abstract MB3_MeshCombiner meshCombiner [get]
 
override MB2_TextureBakeResults textureBakeResults [get, set]
 
- Properties inherited from MB3_MeshBakerRoot
abstract MB2_TextureBakeResults textureBakeResults [get, set]
 

Additional Inherited Members

- Static Public Member Functions inherited from MB3_MeshBakerRoot
static bool DoCombinedValidate (MB3_MeshBakerRoot mom, MB_ObjsToCombineTypes objToCombineType, MB2_EditorMethodsInterface editorMethods, MB2_ValidationLevel validationLevel)
 

Detailed Description

Maps a list of source materials to a combined material.

Included in MB2_TextureBakeResults

Abstract root of the mesh combining classes

Member Function Documentation

§ _ValidateForUpdateSkinnedMeshBounds()

virtual bool MB3_MeshBakerCommon._ValidateForUpdateSkinnedMeshBounds ( )
protectedvirtual

§ AddDeleteGameObjects()

abstract bool MB3_MeshBakerCommon.AddDeleteGameObjects ( GameObject []  gos,
GameObject []  deleteGOs,
bool  disableRendererInSource = true 
)
pure virtual

Adds and deletes objects from the combined mesh.

gos and deleteGOs can be null. You need to call Apply or ApplyAll to see the changes. objects in gos must not include objects already in the combined mesh. objects in gos and deleteGOs must be the game objects with a Renderer component This method is slow, so should be called as infrequently as possible.

Returns
The first generated combined mesh
Parameters
gosgos. Array of objects to add to the combined mesh. Array can be null. Must not include objects already in the combined mesh. Array must contain game objects with a render component.
deleteGOsdeleteGOs. Array of objects to delete from the combined mesh. Array can be null.
disableRendererInSourceDisable renderer component on objects in gos after they have been added to the combined mesh.
fixOutOfBoundUVsWhether to fix out of bounds UVs in meshes as they are being added. This paramater should be set to the same as the combined material.

Implemented in MB3_MeshBaker, and MB3_MultiMeshBaker.

§ AddDeleteGameObjectsByID()

abstract bool MB3_MeshBakerCommon.AddDeleteGameObjectsByID ( GameObject []  gos,
int []  deleteGOinstanceIDs,
bool  disableRendererInSource = true 
)
pure virtual

This is the best version to use for deleting game objects since the source GameObjects may have been destroyed Internaly Mesh Baker only stores the instanceID for Game Objects, so objects can be removed after they have been destroyed

Implemented in MB3_MeshBaker, and MB3_MultiMeshBaker.

§ Apply() [1/2]

virtual void MB3_MeshBakerCommon.Apply ( MB3_MeshCombiner.GenerateUV2Delegate  uv2GenerationMethod = null)
virtual

Apply changes to the mesh.

All channels set in this instance will be set in the combined mesh.

§ Apply() [2/2]

virtual void MB3_MeshBakerCommon.Apply ( bool  triangles,
bool  vertices,
bool  normals,
bool  tangents,
bool  uvs,
bool  uv2,
bool  uv3,
bool  uv4,
bool  colors,
bool  bones = false,
bool  blendShapesFlag = false,
MB3_MeshCombiner.GenerateUV2Delegate  uv2GenerationMethod = null 
)
virtual

Applys the changes to flagged properties of the mesh.

This method is slow, and should only be called once per frame. The speed is directly proportional to the number of flags that are true. Only apply necessary properties.

§ ClearMesh()

virtual void MB3_MeshBakerCommon.ClearMesh ( )
virtual

Clears the meshs and mesh related data but does not destroy it.

§ CombinedMeshContains()

virtual bool MB3_MeshBakerCommon.CombinedMeshContains ( GameObject  go)
virtual

§ DestroyMesh()

virtual void MB3_MeshBakerCommon.DestroyMesh ( )
virtual

Clears and desroys the mesh.

Clears mesh related data.

§ DestroyMeshEditor()

virtual void MB3_MeshBakerCommon.DestroyMeshEditor ( MB2_EditorMethodsInterface  editorMethods)
virtual

§ EnableDisableSourceObjectRenderers()

void MB3_MeshBakerCommon.EnableDisableSourceObjectRenderers ( bool  show)

§ GetNumObjectsInCombined()

virtual int MB3_MeshBakerCommon.GetNumObjectsInCombined ( )
virtual

§ GetNumVerticesFor()

virtual int MB3_MeshBakerCommon.GetNumVerticesFor ( GameObject  go)
virtual

§ GetObjectsToCombine()

override List<GameObject> MB3_MeshBakerCommon.GetObjectsToCombine ( )
virtual

Reimplemented from MB3_MeshBakerRoot.

§ GetTextureBaker()

MB3_TextureBaker MB3_MeshBakerCommon.GetTextureBaker ( )

Gets the texture baker on this component or its parent if it exists

Returns
The texture baker.

§ UpdateGameObjects()

virtual void MB3_MeshBakerCommon.UpdateGameObjects ( GameObject []  gos,
bool  recalcBounds = true,
bool  updateVertices = true,
bool  updateNormals = true,
bool  updateTangents = true,
bool  updateUV = false,
bool  updateUV1 = false,
bool  updateUV2 = false,
bool  updateColors = false,
bool  updateSkinningInfo = false 
)
virtual

§ UpdateSkinnedMeshApproximateBounds()

virtual void MB3_MeshBakerCommon.UpdateSkinnedMeshApproximateBounds ( )
virtual

§ UpdateSkinnedMeshApproximateBoundsFromBones()

virtual void MB3_MeshBakerCommon.UpdateSkinnedMeshApproximateBoundsFromBones ( )
virtual

§ UpdateSkinnedMeshApproximateBoundsFromBounds()

virtual void MB3_MeshBakerCommon.UpdateSkinnedMeshApproximateBoundsFromBounds ( )
virtual

Member Data Documentation

§ bakeAssetsInPlaceFolderPath

string MB3_MeshBakerCommon.bakeAssetsInPlaceFolderPath

§ clearBuffersAfterBake

bool MB3_MeshBakerCommon.clearBuffersAfterBake = true

§ objsToMesh

List<GameObject> MB3_MeshBakerCommon.objsToMesh

§ resultPrefab

GameObject MB3_MeshBakerCommon.resultPrefab

§ useObjsToMeshFromTexBaker

bool MB3_MeshBakerCommon.useObjsToMeshFromTexBaker = true

Property Documentation

§ meshCombiner

abstract MB3_MeshCombiner MB3_MeshBakerCommon.meshCombiner
get

§ textureBakeResults

override MB2_TextureBakeResults MB3_MeshBakerCommon.textureBakeResults
getset

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