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

Component that is an endless mesh. More...

Inheritance diagram for MB3_MultiMeshBaker:
MB3_MeshBakerCommon MB3_MeshBakerRoot

Public Member Functions

override bool AddDeleteGameObjects (GameObject[] gos, GameObject[] deleteGOs, bool disableRendererInSource)
 Adds and deletes objects from the combined mesh. More...
 
override bool AddDeleteGameObjectsByID (GameObject[] gos, int[] deleteGOs, 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_MultiMeshCombiner _meshCombiner = new MB3_MultiMeshCombiner()
 

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 is an endless mesh.

You don't need to worry about the 65k limit when adding meshes. It is like a List of combined meshes. Internally it manages a collection of CombinedMeshes that are added and deleted as necessary.

Note that this implementation does not attempt to split meshes. Each mesh is added to one of the internal meshes as an atomic unit.

This class is a Component. It must be added to a GameObject to use it. It is a wrapper for MB2_Multi_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_MultiMeshBaker.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_MultiMeshBaker.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.

Member Data Documentation

MB3_MultiMeshCombiner MB3_MultiMeshBaker._meshCombiner = new MB3_MultiMeshCombiner()
protected

Property Documentation

override MB3_MeshCombiner MB3_MultiMeshBaker.meshCombiner
get

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