MeshBaker
Public Member Functions | Protected Attributes | Properties | List of all members
MB3_MeshBaker Class Reference

Component that manages a single combined mesh. More...

Inheritance diagram for MB3_MeshBaker:
MB3_MeshBakerCommon MB3_MeshBakerRoot

Public Member Functions

void BuildSceneMeshObject ()
 
virtual bool ShowHide (GameObject[] gos, GameObject[] deleteGOs)
 
virtual void ApplyShowHide ()
 
override bool AddDeleteGameObjects (GameObject[] gos, GameObject[] deleteGOs, bool disableRendererInSource)
 Adds and deletes objects from the combined mesh. More...
 
override bool AddDeleteGameObjectsByID (GameObject[] gos, int[] deleteGOinstanceIDs, bool disableRendererInSource)
 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...
 
- Public Member Functions inherited from MB3_MeshBakerCommon
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...
 
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 colors, bool uv1, bool uv2, bool bones=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 ()
 

Protected Attributes

MB3_MeshCombinerSingle _meshCombiner = new MB3_MeshCombinerSingle()
 

Properties

override MB3_MeshCombiner meshCombiner [get]
 
- Properties inherited from MB3_MeshBakerCommon
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)
 
- Public Attributes inherited from MB3_MeshBakerCommon
List< GameObject > objsToMesh
 
bool useObjsToMeshFromTexBaker = true
 
bool clearBuffersAfterBake = true
 
string bakeAssetsInPlaceFolderPath
 
GameObject resultPrefab
 
- Protected Member Functions inherited from MB3_MeshBakerCommon
virtual bool _ValidateForUpdateSkinnedMeshBounds ()
 

Detailed Description

Component that manages a single combined mesh.

This class is a Component. It must be added to a GameObject to use it. It is a wrapper for MB2_MeshCombiner which contains the same functionality but is not a component so it can be instantiated like a normal class.

Member Function Documentation

override bool MB3_MeshBaker.AddDeleteGameObjects ( GameObject[]  gos,
GameObject[]  deleteGOs,
bool  disableRendererInSource 
)
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.

Implements MB3_MeshBakerCommon.

override bool MB3_MeshBaker.AddDeleteGameObjectsByID ( GameObject[]  gos,
int[]  deleteGOinstanceIDs,
bool  disableRendererInSource 
)
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

Implements MB3_MeshBakerCommon.

virtual void MB3_MeshBaker.ApplyShowHide ( )
virtual
void MB3_MeshBaker.BuildSceneMeshObject ( )
virtual bool MB3_MeshBaker.ShowHide ( GameObject[]  gos,
GameObject[]  deleteGOs 
)
virtual

Member Data Documentation

MB3_MeshCombinerSingle MB3_MeshBaker._meshCombiner = new MB3_MeshCombinerSingle()
protected

Property Documentation

override MB3_MeshCombiner MB3_MeshBaker.meshCombiner
get

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