MeshBaker
MB3_TextureBaker Class Reference

Component that handles baking materials into a combined material. More...

Inheritance diagram for MB3_TextureBaker:
MB3_MeshBakerRoot

Classes

class  CreateAtlasesCoroutineResult
 

Public Member Functions

override List< GameObject > GetObjectsToCombine ()
 
MB_AtlasesAndRects [] CreateAtlases ()
 
delegate void OnCombinedTexturesCoroutineSuccess ()
 
delegate void OnCombinedTexturesCoroutineFail ()
 
IEnumerator CreateAtlasesCoroutine (ProgressUpdateDelegate progressInfo, CreateAtlasesCoroutineResult coroutineResult, bool saveAtlasesAsAssets=false, MB2_EditorMethodsInterface editorMethods=null, float maxTimePerFrame=.01f)
 
MB_AtlasesAndRects [] CreateAtlases (ProgressUpdateDelegate progressInfo, bool saveAtlasesAsAssets=false, MB2_EditorMethodsInterface editorMethods=null)
 Creates the atlases. More...
 

Static Public Member Functions

static void ConfigureNewMaterialToMatchOld (Material newMat, Material original)
 
- 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

MB2_LogLevel LOG_LEVEL = MB2_LogLevel.info
 
MB_MultiMaterial [] resultMaterials = new MB_MultiMaterial[0]
 
List< GameObject > objsToMesh
 
OnCombinedTexturesCoroutineSuccess onBuiltAtlasesSuccess
 
OnCombinedTexturesCoroutineFail onBuiltAtlasesFail
 
MB_AtlasesAndRects [] OnCombinedTexturesCoroutineAtlasesAndRects
 

Protected Attributes

MB2_TextureBakeResults _textureBakeResults
 
int _atlasPadding = 1
 
int _maxAtlasSize = 4096
 
bool _resizePowerOfTwoTextures = false
 
bool _fixOutOfBoundsUVs = false
 
int _maxTilingBakeSize = 1024
 
MB2_PackingAlgorithmEnum _packingAlgorithm = MB2_PackingAlgorithmEnum.MeshBakerTexturePacker
 
bool _meshBakerTexturePackerForcePowerOfTwo = true
 
List< ShaderTextureProperty_customShaderProperties = new List<ShaderTextureProperty>()
 
List< string > _customShaderPropNames_Depricated = new List<string>()
 
bool _doMultiMaterial
 
Material _resultMaterial
 
bool _considerNonTextureProperties = true
 
bool _doSuggestTreatment = true
 

Properties

override MB2_TextureBakeResults textureBakeResults [get, set]
 
virtual int atlasPadding [get, set]
 
virtual int maxAtlasSize [get, set]
 
virtual bool resizePowerOfTwoTextures [get, set]
 
virtual bool fixOutOfBoundsUVs [get, set]
 
virtual int maxTilingBakeSize [get, set]
 
virtual MB2_PackingAlgorithmEnum packingAlgorithm [get, set]
 
bool meshBakerTexturePackerForcePowerOfTwo [get, set]
 
virtual List< ShaderTexturePropertycustomShaderProperties [get, set]
 
virtual List< string > customShaderPropNames [get, set]
 
virtual bool doMultiMaterial [get, set]
 
virtual Material resultMaterial [get, set]
 
bool considerNonTextureProperties [get, set]
 
bool doSuggestTreatment [get, set]
 
- Properties inherited from MB3_MeshBakerRoot
abstract MB2_TextureBakeResults textureBakeResults [get, set]
 

Detailed Description

Component that handles baking materials into a combined material.

The result of the material baking process is a MB2_TextureBakeResults object, which becomes the input for the mesh baking.

This class uses the MB_TextureCombiner to do the combining.

This class is a Component (MonoBehavior) so it is serialized and found using GetComponent. If you want to access the texture baking functionality without creating a Component then use MB_TextureCombiner directly.

Member Function Documentation

§ ConfigureNewMaterialToMatchOld()

static void MB3_TextureBaker.ConfigureNewMaterialToMatchOld ( Material  newMat,
Material  original 
)
static

§ CreateAtlases() [1/2]

MB_AtlasesAndRects [] MB3_TextureBaker.CreateAtlases ( )

§ CreateAtlases() [2/2]

MB_AtlasesAndRects [] MB3_TextureBaker.CreateAtlases ( ProgressUpdateDelegate  progressInfo,
bool  saveAtlasesAsAssets = false,
MB2_EditorMethodsInterface  editorMethods = null 
)

Creates the atlases.

Returns
The atlases.
Parameters
progressInfoProgress info is a delegate function that displays a progress dialog. Can be null
saveAtlasesAsAssetsif true atlases are saved as assets in the project folder. Othersise they are instances in memory
editorMethodsTexture format tracker. Contains editor functionality such as save assets. Can be null.

§ CreateAtlasesCoroutine()

IEnumerator MB3_TextureBaker.CreateAtlasesCoroutine ( ProgressUpdateDelegate  progressInfo,
CreateAtlasesCoroutineResult  coroutineResult,
bool  saveAtlasesAsAssets = false,
MB2_EditorMethodsInterface  editorMethods = null,
float  maxTimePerFrame = .01f 
)

§ GetObjectsToCombine()

override List<GameObject> MB3_TextureBaker.GetObjectsToCombine ( )
virtual

Reimplemented from MB3_MeshBakerRoot.

§ OnCombinedTexturesCoroutineFail()

delegate void MB3_TextureBaker.OnCombinedTexturesCoroutineFail ( )

§ OnCombinedTexturesCoroutineSuccess()

delegate void MB3_TextureBaker.OnCombinedTexturesCoroutineSuccess ( )

Member Data Documentation

§ _atlasPadding

int MB3_TextureBaker._atlasPadding = 1
protected

§ _considerNonTextureProperties

bool MB3_TextureBaker._considerNonTextureProperties = true
protected

§ _customShaderProperties

List<ShaderTextureProperty> MB3_TextureBaker._customShaderProperties = new List<ShaderTextureProperty>()
protected

§ _customShaderPropNames_Depricated

List<string> MB3_TextureBaker._customShaderPropNames_Depricated = new List<string>()
protected

§ _doMultiMaterial

bool MB3_TextureBaker._doMultiMaterial
protected

§ _doSuggestTreatment

bool MB3_TextureBaker._doSuggestTreatment = true
protected

§ _fixOutOfBoundsUVs

bool MB3_TextureBaker._fixOutOfBoundsUVs = false
protected

§ _maxAtlasSize

int MB3_TextureBaker._maxAtlasSize = 4096
protected

§ _maxTilingBakeSize

int MB3_TextureBaker._maxTilingBakeSize = 1024
protected

§ _meshBakerTexturePackerForcePowerOfTwo

bool MB3_TextureBaker._meshBakerTexturePackerForcePowerOfTwo = true
protected

§ _packingAlgorithm

MB2_PackingAlgorithmEnum MB3_TextureBaker._packingAlgorithm = MB2_PackingAlgorithmEnum.MeshBakerTexturePacker
protected

§ _resizePowerOfTwoTextures

bool MB3_TextureBaker._resizePowerOfTwoTextures = false
protected

§ _resultMaterial

Material MB3_TextureBaker._resultMaterial
protected

§ _textureBakeResults

MB2_TextureBakeResults MB3_TextureBaker._textureBakeResults
protected

§ LOG_LEVEL

MB2_LogLevel MB3_TextureBaker.LOG_LEVEL = MB2_LogLevel.info

§ objsToMesh

List<GameObject> MB3_TextureBaker.objsToMesh

§ onBuiltAtlasesFail

OnCombinedTexturesCoroutineFail MB3_TextureBaker.onBuiltAtlasesFail

§ onBuiltAtlasesSuccess

OnCombinedTexturesCoroutineSuccess MB3_TextureBaker.onBuiltAtlasesSuccess

§ OnCombinedTexturesCoroutineAtlasesAndRects

MB_AtlasesAndRects [] MB3_TextureBaker.OnCombinedTexturesCoroutineAtlasesAndRects

§ resultMaterials

MB_MultiMaterial [] MB3_TextureBaker.resultMaterials = new MB_MultiMaterial[0]

Property Documentation

§ atlasPadding

virtual int MB3_TextureBaker.atlasPadding
getset

§ considerNonTextureProperties

bool MB3_TextureBaker.considerNonTextureProperties
getset

§ customShaderProperties

virtual List<ShaderTextureProperty> MB3_TextureBaker.customShaderProperties
getset

§ customShaderPropNames

virtual List<string> MB3_TextureBaker.customShaderPropNames
getset

§ doMultiMaterial

virtual bool MB3_TextureBaker.doMultiMaterial
getset

§ doSuggestTreatment

bool MB3_TextureBaker.doSuggestTreatment
getset

§ fixOutOfBoundsUVs

virtual bool MB3_TextureBaker.fixOutOfBoundsUVs
getset

§ maxAtlasSize

virtual int MB3_TextureBaker.maxAtlasSize
getset

§ maxTilingBakeSize

virtual int MB3_TextureBaker.maxTilingBakeSize
getset

§ meshBakerTexturePackerForcePowerOfTwo

bool MB3_TextureBaker.meshBakerTexturePackerForcePowerOfTwo
getset

§ packingAlgorithm

virtual MB2_PackingAlgorithmEnum MB3_TextureBaker.packingAlgorithm
getset

§ resizePowerOfTwoTextures

virtual bool MB3_TextureBaker.resizePowerOfTwoTextures
getset

§ resultMaterial

virtual Material MB3_TextureBaker.resultMaterial
getset

§ textureBakeResults

override MB2_TextureBakeResults MB3_TextureBaker.textureBakeResults
getset

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