MeshBaker
DigitalOpus.MB.Core.MB3_MultiMeshCombiner Class Reference

This class is an endless mesh. More...

Inheritance diagram for DigitalOpus.MB.Core.MB3_MultiMeshCombiner:
DigitalOpus.MB.Core.MB3_MeshCombiner

Classes

class  CombinedMesh
 

Public Member Functions

override int GetNumObjectsInCombined ()
 
override int GetNumVerticesFor (GameObject go)
 
override int GetNumVerticesFor (int gameObjectID)
 
override List< GameObject > GetObjectsInCombined ()
 
override int GetLightmapIndex ()
 
override bool CombinedMeshContains (GameObject go)
 
override void Apply (MB3_MeshCombiner.GenerateUV2Delegate uv2GenerationMethod)
 
override 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)
 
override void UpdateSkinnedMeshApproximateBounds ()
 
override void UpdateSkinnedMeshApproximateBoundsFromBones ()
 
override void UpdateSkinnedMeshApproximateBoundsFromBounds ()
 Updates the skinned mesh approximate bounds from the bounds of the source objects. More...
 
override void UpdateGameObjects (GameObject[] gos, bool recalcBounds=true, bool updateVertices=true, bool updateNormals=true, bool updateTangents=true, bool updateUV=false, bool updateUV2=false, bool updateUV3=false, bool updateUV4=false, bool updateColors=false, bool updateSkinningInfo=false)
 Updates the data in the combined mesh for meshes that are already in the combined mesh. More...
 
override bool AddDeleteGameObjects (GameObject[] gos, GameObject[] deleteGOs, bool disableRendererInSource=true)
 
override bool AddDeleteGameObjectsByID (GameObject[] gos, int[] deleteGOinstanceIDs, bool disableRendererInSource=true)
 
override Dictionary< MBBlendShapeKey, MBBlendShapeValueBuildSourceBlendShapeToCombinedIndexMap ()
 
override void ClearBuffers ()
 
override void ClearMesh ()
 
override void DestroyMesh ()
 
override void DestroyMeshEditor (MB2_EditorMethodsInterface editorMethods)
 
override void CheckIntegrity ()
 
- Public Member Functions inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
delegate void GenerateUV2Delegate (Mesh m, float hardAngle, float packMargin)
 
virtual bool doUV2 ()
 
virtual void Apply ()
 Copies Mesh Baker internal data to the mesh. More...
 
abstract void Apply (GenerateUV2Delegate uv2GenerationMethod)
 Copies Mesh Baker internal data to the mesh. More...
 
abstract void Apply (bool triangles, bool vertices, bool normals, bool tangents, bool uvs, bool uv2, bool uv3, bool uv4, bool colors, bool bones=false, bool blendShapeFlag=false, GenerateUV2Delegate uv2GenerationMethod=null)
 Apply the specified triangles, vertices, normals, tangents, uvs, colors, uv1, uv2, bones and uv2GenerationMethod. More...
 

Public Attributes

Dictionary< int, CombinedMeshobj2MeshCombinerMap = new Dictionary<int, CombinedMesh>()
 
List< CombinedMeshmeshCombiners = new List<CombinedMesh>()
 
- Public Attributes inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
float uv2UnwrappingParamsHardAngle = 60f
 
float uv2UnwrappingParamsPackMargin = .005f
 

Properties

override MB2_LogLevel LOG_LEVEL [get, set]
 
override MB2_ValidationLevel validationLevel [get, set]
 
int maxVertsInMesh [get, set]
 
- Properties inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
static bool EVAL_VERSION [get]
 
virtual MB2_LogLevel LOG_LEVEL [get, set]
 
virtual MB2_ValidationLevel validationLevel [get, set]
 
string name [get, set]
 
virtual MB2_TextureBakeResults textureBakeResults [get, set]
 
virtual GameObject resultSceneObject [get, set]
 
virtual Renderer targetRenderer [get, set]
 
virtual MB_RenderType renderType [get, set]
 
virtual MB2_OutputOptions outputOption [get, set]
 
virtual MB2_LightmapOptions lightmapOption [get, set]
 
virtual bool doNorm [get, set]
 
virtual bool doTan [get, set]
 
virtual bool doCol [get, set]
 
virtual bool doUV [get, set]
 
virtual bool doUV1 [get, set]
 
virtual bool doUV3 [get, set]
 
virtual bool doUV4 [get, set]
 
virtual bool doBlendShapes [get, set]
 

Additional Inherited Members

- Static Public Member Functions inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
static void UpdateSkinnedMeshApproximateBoundsFromBonesStatic (Transform[] bs, SkinnedMeshRenderer smr)
 Updates the skinned mesh bounds by creating a bounding box that contains the bones (skeleton) of the source objects. More...
 
static void UpdateSkinnedMeshApproximateBoundsFromBoundsStatic (List< GameObject > objectsInCombined, SkinnedMeshRenderer smr)
 
- Protected Member Functions inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
virtual bool _CheckIfAllObjsToAddUseSameMaterialsAndCreateTemporaryTextrueBakeResult (GameObject[] gos)
 
- Protected Attributes inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
MBVersion _MBVersion
 
MB2_LogLevel _LOG_LEVEL = MB2_LogLevel.info
 
MB2_ValidationLevel _validationLevel = MB2_ValidationLevel.robust
 
string _name
 
MB2_TextureBakeResults _textureBakeResults
 
GameObject _resultSceneObject
 
UnityEngine.Renderer _targetRenderer
 
MB_RenderType _renderType
 
MB2_OutputOptions _outputOption
 
MB2_LightmapOptions _lightmapOption = MB2_LightmapOptions.ignore_UV2
 
bool _doNorm = true
 
bool _doTan = true
 
bool _doCol
 
bool _doUV = true
 
bool _doUV3
 
bool _doUV4
 
bool _doBlendShapes
 
bool _usingTemporaryTextureBakeResult
 

Detailed Description

This class 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 MB2_MeshComber objects to which meshes 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 not a Component so it can be instantiated and used like a regular C Sharp class.

Member Function Documentation

§ AddDeleteGameObjects()

override bool DigitalOpus.MB.Core.MB3_MultiMeshCombiner.AddDeleteGameObjects ( GameObject []  gos,
GameObject []  deleteGOs,
bool  disableRendererInSource = true 
)
virtual

§ AddDeleteGameObjectsByID()

override bool DigitalOpus.MB.Core.MB3_MultiMeshCombiner.AddDeleteGameObjectsByID ( GameObject []  gos,
int []  deleteGOinstanceIDs,
bool  disableRendererInSource = true 
)
virtual

§ Apply() [1/2]

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.Apply ( MB3_MeshCombiner.GenerateUV2Delegate  uv2GenerationMethod)

§ Apply() [2/2]

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.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 
)

§ BuildSourceBlendShapeToCombinedIndexMap()

override Dictionary<MBBlendShapeKey, MBBlendShapeValue> DigitalOpus.MB.Core.MB3_MultiMeshCombiner.BuildSourceBlendShapeToCombinedIndexMap ( )
virtual

§ CheckIntegrity()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.CheckIntegrity ( )
virtual

§ ClearBuffers()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.ClearBuffers ( )
virtual

§ ClearMesh()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.ClearMesh ( )
virtual

§ CombinedMeshContains()

override bool DigitalOpus.MB.Core.MB3_MultiMeshCombiner.CombinedMeshContains ( GameObject  go)
virtual

§ DestroyMesh()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.DestroyMesh ( )
virtual

§ DestroyMeshEditor()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.DestroyMeshEditor ( MB2_EditorMethodsInterface  editorMethods)
virtual

§ GetLightmapIndex()

override int DigitalOpus.MB.Core.MB3_MultiMeshCombiner.GetLightmapIndex ( )
virtual

§ GetNumObjectsInCombined()

override int DigitalOpus.MB.Core.MB3_MultiMeshCombiner.GetNumObjectsInCombined ( )
virtual

§ GetNumVerticesFor() [1/2]

override int DigitalOpus.MB.Core.MB3_MultiMeshCombiner.GetNumVerticesFor ( GameObject  go)
virtual

§ GetNumVerticesFor() [2/2]

override int DigitalOpus.MB.Core.MB3_MultiMeshCombiner.GetNumVerticesFor ( int  gameObjectID)
virtual

§ GetObjectsInCombined()

override List<GameObject> DigitalOpus.MB.Core.MB3_MultiMeshCombiner.GetObjectsInCombined ( )
virtual

§ UpdateGameObjects()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.UpdateGameObjects ( GameObject []  gos,
bool  recalcBounds = true,
bool  updateVertices = true,
bool  updateNormals = true,
bool  updateTangents = true,
bool  updateUV = false,
bool  updateUV2 = false,
bool  updateUV3 = false,
bool  updateUV4 = false,
bool  updateColors = false,
bool  updateSkinningInfo = false 
)
virtual

Updates the data in the combined mesh for meshes that are already in the combined mesh.

This is faster than adding and removing a mesh and has a much lower memory footprint. This method can only be used if the meshes being updated have the same layout(number of vertices, triangles, submeshes). This is faster than removing and re-adding For efficiency update as few channels as possible. Apply must be called to apply the changes to the combined mesh

Implements DigitalOpus.MB.Core.MB3_MeshCombiner.

§ UpdateSkinnedMeshApproximateBounds()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.UpdateSkinnedMeshApproximateBounds ( )
virtual

§ UpdateSkinnedMeshApproximateBoundsFromBones()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.UpdateSkinnedMeshApproximateBoundsFromBones ( )
virtual

§ UpdateSkinnedMeshApproximateBoundsFromBounds()

override void DigitalOpus.MB.Core.MB3_MultiMeshCombiner.UpdateSkinnedMeshApproximateBoundsFromBounds ( )
virtual

Updates the skinned mesh approximate bounds from the bounds of the source objects.

Implements DigitalOpus.MB.Core.MB3_MeshCombiner.

Member Data Documentation

§ meshCombiners

List<CombinedMesh> DigitalOpus.MB.Core.MB3_MultiMeshCombiner.meshCombiners = new List<CombinedMesh>()

§ obj2MeshCombinerMap

Dictionary<int,CombinedMesh> DigitalOpus.MB.Core.MB3_MultiMeshCombiner.obj2MeshCombinerMap = new Dictionary<int, CombinedMesh>()

Property Documentation

§ LOG_LEVEL

override MB2_LogLevel DigitalOpus.MB.Core.MB3_MultiMeshCombiner.LOG_LEVEL
getset

§ maxVertsInMesh

int DigitalOpus.MB.Core.MB3_MultiMeshCombiner.maxVertsInMesh
getset

§ validationLevel

override MB2_ValidationLevel DigitalOpus.MB.Core.MB3_MultiMeshCombiner.validationLevel
getset

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