MeshBaker
DigitalOpus.MB.Core.MB3_MeshCombinerSingle Class Reference

Manages a single combined mesh.This class is the core of the mesh combining API. More...

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

Classes

struct  BoneAndBindpose
 
class  MB_DynamicGameObject
 
class  MBBlendShape
 
class  MBBlendShapeFrame
 
class  MeshChannels
 
class  MeshChannelsCache
 

Public Member Functions

override int GetNumObjectsInCombined ()
 
override List< GameObject > GetObjectsInCombined ()
 
Mesh GetMesh ()
 
Transform [] GetBones ()
 
override int GetLightmapIndex ()
 
override int GetNumVerticesFor (GameObject go)
 
override int GetNumVerticesFor (int instanceID)
 
override Dictionary< MBBlendShapeKey, MBBlendShapeValueBuildSourceBlendShapeToCombinedIndexMap ()
 
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 Apply (GenerateUV2Delegate uv2GenerationMethod)
 Copies Mesh Baker internal data to the mesh. More...
 
virtual void ApplyShowHide ()
 
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, GenerateUV2Delegate uv2GenerationMethod=null)
 Apply the specified triangles, vertices, normals, tangents, uvs, colors, uv1, uv2, bones and uv2GenerationMethod. More...
 
int [][] GetSubmeshTrisWithShowHideApplied ()
 
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...
 
bool ShowHideGameObjects (GameObject[] toShow, GameObject[] toHide)
 
override bool AddDeleteGameObjects (GameObject[] gos, GameObject[] deleteGOs, bool disableRendererInSource=true)
 
override bool AddDeleteGameObjectsByID (GameObject[] gos, int[] deleteGOinstanceIDs, bool disableRendererInSource)
 
override bool CombinedMeshContains (GameObject go)
 
override void ClearBuffers ()
 
override void ClearMesh ()
 
override void DestroyMesh ()
 
override void DestroyMeshEditor (MB2_EditorMethodsInterface editorMethods)
 
bool ValidateTargRendererAndMeshAndResultSceneObj ()
 
void BuildSceneMeshObject (GameObject[] gos=null, bool createNewChild=false)
 
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...
 

Static Public Member Functions

static Renderer BuildSceneHierarch (MB3_MeshCombinerSingle mom, GameObject root, Mesh m, bool createNewChild=false, GameObject[] objsToBeAdded=null)
 
- 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 Attributes

List< GameObject > objectsInCombinedMesh = new List<GameObject>()
 
- 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
 

Properties

override MB2_TextureBakeResults textureBakeResults [set]
 
override MB_RenderType renderType [set]
 
override GameObject resultSceneObject [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

- Public Attributes inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
float uv2UnwrappingParamsHardAngle = 60f
 
float uv2UnwrappingParamsPackMargin = .005f
 
- Protected Member Functions inherited from DigitalOpus.MB.Core.MB3_MeshCombiner
virtual bool _CheckIfAllObjsToAddUseSameMaterialsAndCreateTemporaryTextrueBakeResult (GameObject[] gos)
 

Detailed Description

Manages a single combined mesh.This class is the core of the mesh combining API.

It is not a component so it can be can be instantiated and used like a normal c sharp class.

Member Function Documentation

§ AddDeleteGameObjects()

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

§ AddDeleteGameObjectsByID()

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

§ Apply() [1/2]

override void DigitalOpus.MB.Core.MB3_MeshCombinerSingle.Apply ( GenerateUV2Delegate  uv2GenerationMethod)
virtual

Copies Mesh Baker internal data to the mesh.

Parameters
uv2GenerationMethodUv2 generation method. This is normally editor class method Unwrapping.GenerateSecondaryUVSet

Implements DigitalOpus.MB.Core.MB3_MeshCombiner.

§ Apply() [2/2]

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

Apply the specified triangles, vertices, normals, tangents, uvs, colors, uv1, uv2, bones and uv2GenerationMethod.

Parameters
trianglesTriangles.
verticesVertices.
normalsNormals.
tangentsTangents.
uvsUvs.
colorsColors.
uv3Uv3.
uv4Uv4.
uv2Uv2.
bonesBones.
uv2GenerationMethodUv2 generation method. This is normally method Unwrapping.GenerateSecondaryUVSet. This should be null when calling Apply at runtime.

Implements DigitalOpus.MB.Core.MB3_MeshCombiner.

§ ApplyShowHide()

virtual void DigitalOpus.MB.Core.MB3_MeshCombinerSingle.ApplyShowHide ( )
virtual

§ BuildSceneHierarch()

static Renderer DigitalOpus.MB.Core.MB3_MeshCombinerSingle.BuildSceneHierarch ( MB3_MeshCombinerSingle  mom,
GameObject  root,
Mesh  m,
bool  createNewChild = false,
GameObject []  objsToBeAdded = null 
)
static

§ BuildSceneMeshObject()

void DigitalOpus.MB.Core.MB3_MeshCombinerSingle.BuildSceneMeshObject ( GameObject []  gos = null,
bool  createNewChild = false 
)

§ BuildSourceBlendShapeToCombinedIndexMap()

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

§ CheckIntegrity()

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

§ ClearBuffers()

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

§ ClearMesh()

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

§ CombinedMeshContains()

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

§ DestroyMesh()

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

§ DestroyMeshEditor()

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

§ GetBones()

Transform [] DigitalOpus.MB.Core.MB3_MeshCombinerSingle.GetBones ( )

§ GetLightmapIndex()

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

§ GetMesh()

Mesh DigitalOpus.MB.Core.MB3_MeshCombinerSingle.GetMesh ( )

§ GetNumObjectsInCombined()

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

§ GetNumVerticesFor() [1/2]

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

§ GetNumVerticesFor() [2/2]

override int DigitalOpus.MB.Core.MB3_MeshCombinerSingle.GetNumVerticesFor ( int  instanceID)
virtual

§ GetObjectsInCombined()

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

§ GetSubmeshTrisWithShowHideApplied()

int [][] DigitalOpus.MB.Core.MB3_MeshCombinerSingle.GetSubmeshTrisWithShowHideApplied ( )

§ ShowHideGameObjects()

bool DigitalOpus.MB.Core.MB3_MeshCombinerSingle.ShowHideGameObjects ( GameObject []  toShow,
GameObject []  toHide 
)

§ UpdateGameObjects()

override void DigitalOpus.MB.Core.MB3_MeshCombinerSingle.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_MeshCombinerSingle.UpdateSkinnedMeshApproximateBounds ( )
virtual

§ UpdateSkinnedMeshApproximateBoundsFromBones()

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

§ UpdateSkinnedMeshApproximateBoundsFromBounds()

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

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

Implements DigitalOpus.MB.Core.MB3_MeshCombiner.

§ ValidateTargRendererAndMeshAndResultSceneObj()

bool DigitalOpus.MB.Core.MB3_MeshCombinerSingle.ValidateTargRendererAndMeshAndResultSceneObj ( )

Member Data Documentation

§ objectsInCombinedMesh

List<GameObject> DigitalOpus.MB.Core.MB3_MeshCombinerSingle.objectsInCombinedMesh = new List<GameObject>()
protected

Property Documentation

§ renderType

override MB_RenderType DigitalOpus.MB.Core.MB3_MeshCombinerSingle.renderType
set

§ resultSceneObject

override GameObject DigitalOpus.MB.Core.MB3_MeshCombinerSingle.resultSceneObject
set

§ textureBakeResults

override MB2_TextureBakeResults DigitalOpus.MB.Core.MB3_MeshCombinerSingle.textureBakeResults
set

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