TriLib  1.9.0
TriLib Unity Package
TriLib.AssetLoaderOptions Class Reference

Represents a series of asset loading options. More...

Inheritance diagram for TriLib.AssetLoaderOptions:

Public Member Functions

void Deserialize (string json)
 Deserialize the specified JSON representation into this class. More...
 
string Serialize ()
 Serializes this instance to a JSON representation. More...
 

Static Public Member Functions

static AssetLoaderOptions CreateInstance ()
 Returns a new AssetLoaderOptions instance. More...
 

Public Attributes

bool AddAssetUnloader
 Turn on this field to add AssetUnloader behaviour to loaded UnityEngine.GameObject and automatically free resources when it's destroyed. More...
 
bool DontLoadAnimations
 Turn on this field to disable animations loading. More...
 
bool ForceAnimationComponents
 Turn on this field to force the animation components creation even when there are no animations on the source model. More...
 
bool DontApplyAnimations
 Turn on this field to disable applying loaded animations. More...
 
bool DontLoadLights = true
 Turn on this field to disable lights loading. More...
 
bool DontLoadCameras = true
 Turn on this field to disable cameras loading. More...
 
bool AutoPlayAnimations = true
 Turn on this field to automatically play the first loaded animation. More...
 
WrapMode AnimationWrapMode = WrapMode.Loop
 Use this field to change default animations wrap mode. More...
 
bool UseLegacyAnimations = true
 Turn on this field to use legacy UnityEngine.Animation component. More...
 
bool EnsureQuaternionContinuity = true
 Turn on this field to realigns quaternion keys to ensure shortest interpolation paths. More...
 
bool UseOriginalPositionRotationAndScale = false
 Turn on this field to use the original file orientation and rotation. That would fix issues with DAE files orientations, among others. More...
 
RuntimeAnimatorController AnimatorController
 If you don´t wish to use legacy animations, use this field to specify a UnityEngine.RuntimeAnimatorController. More...
 
Avatar Avatar
 If you don´t wish to use legacy animations, use this field to specify an existing UnityEngine.Avatar for using. More...
 
bool DontGenerateAvatar
 Turn on this field if you gonna generate your own UnityEngine.Avatar later. More...
 
bool DontLoadMetadata
 Turn on this field to disable metadata processing and metadata processing callback (AssetLoaderBase.OnMetadataProcessed). More...
 
bool DontAddMetadataCollection
 Turn on this field to don't add the AssimpMetadataCollection component to the loaded UnityEngine.GameObjects. More...
 
bool DontLoadMaterials
 Turn on this field to disable materials loading. More...
 
bool ApplyColorAlpha = true
 Turn off this field to disable alpha color value on loaded materials. More...
 
bool ApplyDiffuseColor = true
 Turn off this field to disable diffuse color on loaded materials. More...
 
bool ApplyEmissionColor = true
 Turn off this field to disable emission color on loaded materials. More...
 
bool ApplySpecularColor = true
 Turn off this field to disable specular color on loaded materials. More...
 
bool ApplyDiffuseTexture = true
 Turn off this field to disable diffuse texture on loaded materials. More...
 
bool ApplyEmissionTexture = true
 Turn off this field to disable emission texture on loaded materials. More...
 
bool ApplySpecularTexture = true
 Turn off this field to disable specular texture on loaded materials. More...
 
bool ApplyNormalTexture = true
 Turn off this field to disable normal texture on loaded materials. More...
 
bool ApplyDisplacementTexture = true
 Turn off this field to disable displacement texture on loaded materials. More...
 
bool ApplyOcclusionTexture = true
 Turn off this field to disable occlusion texture on loaded materials. More...
 
bool ApplyMetallicTexture = true
 Turn off this field to disable metallic texture on loaded materials. More...
 
bool ApplyNormalScale = true
 Turn off this field to disable normal scale on loaded materials. More...
 
bool ApplyGlossiness = true
 Turn off this field to disable glossiness on loaded materials. More...
 
bool ApplyGlossinessScale = true
 Turn off this field to disable glossiness scale on loaded materials. More...
 
bool LoadRawMaterialProperties
 Turn on this field to load additional material properties (located on loaded MaterialData collection). More...
 
bool DisableAlphaMaterials
 Turn on this field to disable transparent materials creation. More...
 
bool ApplyAlphaMaterials
 Turn on this field to automatically scan and apply alpha channel materials by checking textures per pixel (may decrease performance). More...
 
bool ScanForAlphaMaterials
 Turn on this field to automatically scan and apply alpha channel materials by checking textures per pixel (may decrease performance). More...
 
bool UseCutoutMaterials
 Turn on this field to use cutout materials instead of alpha-blended materials. More...
 
bool UseStandardSpecularMaterial
 Turn on this field to use the Unity default specular material. More...
 
MaterialShadingMode MaterialShadingMode
 Change this field to switch between Standard, Specular and Roughness setup materials. More...
 
MaterialTransparencyMode MaterialTransparencyMode
 Change this field to switch between Alpha, Cutout and Fade transparency mode on materials. More...
 
bool DontLoadMeshes
 Turn on this field to disable meshes loading. More...
 
bool DontLoadBlendShapes
 Turn on this field to disable blend-shapes loading. More...
 
bool DontLoadSkinning
 Turn on this field to disable skinning. More...
 
bool CombineMeshes = true
 Turn on this field to combine loaded meshes. More...
 
bool GenerateMeshColliders
 Turn on this field to enable mesh collider generation More...
 
bool ConvexMeshColliders
 Turn on this field to indicate that generated mesh collider will be convex. More...
 
Vector3 RotationAngles = new Vector3(0f, 180f, 0f)
 Use this field to override object rotation angles. More...
 
float Scale = 1f
 Use this field to override object scale. More...
 
AssimpPostProcessSteps PostProcessSteps = AssimpPostProcessSteps.FlipWindingOrder | AssimpPostProcessSteps.MakeLeftHanded | AssimpProcessPreset.TargetRealtimeMaxQuality
 Use this field to set-up advanced object loading options. AssimpPostProcessSteps More...
 
TextureCompression TextureCompression = TextureCompression.NormalQuality
 Use this field to set loaded textures compression level. More...
 
FilterMode TextureFilterMode = FilterMode.Bilinear
 Use this field to set the loaded textures filter mode. More...
 
bool GenerateMipMaps = true
 Enable this field to generate textures mipmaps. More...
 
List< AssetAdvancedConfigAdvancedConfigs
 Use this field to define asset loading advanced configs. More...
 

Detailed Description

Represents a series of asset loading options.

Member Function Documentation

◆ CreateInstance()

static AssetLoaderOptions TriLib.AssetLoaderOptions.CreateInstance ( )
static

Returns a new AssetLoaderOptions instance.

Returns
The instance.

◆ Deserialize()

void TriLib.AssetLoaderOptions.Deserialize ( string  json)

Deserialize the specified JSON representation into this class.

Parameters
jsonJson.

◆ Serialize()

string TriLib.AssetLoaderOptions.Serialize ( )

Serializes this instance to a JSON representation.

Member Data Documentation

◆ AddAssetUnloader

bool TriLib.AssetLoaderOptions.AddAssetUnloader

Turn on this field to add AssetUnloader behaviour to loaded UnityEngine.GameObject and automatically free resources when it's destroyed.

◆ AdvancedConfigs

List<AssetAdvancedConfig> TriLib.AssetLoaderOptions.AdvancedConfigs
Initial value:
= new List<AssetAdvancedConfig>
{
AssetAdvancedConfig.CreateConfig(AssetAdvancedPropertyClassNames.SplitLargeMeshesVertexLimit, 65000),
AssetAdvancedConfig.CreateConfig(AssetAdvancedPropertyClassNames.FBXImportReadLights, false),
AssetAdvancedConfig.CreateConfig(AssetAdvancedPropertyClassNames.FBXImportReadCameras, false)
}

Use this field to define asset loading advanced configs.

◆ AnimationWrapMode

WrapMode TriLib.AssetLoaderOptions.AnimationWrapMode = WrapMode.Loop

Use this field to change default animations wrap mode.

◆ AnimatorController

RuntimeAnimatorController TriLib.AssetLoaderOptions.AnimatorController

If you don´t wish to use legacy animations, use this field to specify a UnityEngine.RuntimeAnimatorController.

◆ ApplyAlphaMaterials

bool TriLib.AssetLoaderOptions.ApplyAlphaMaterials

Turn on this field to automatically scan and apply alpha channel materials by checking textures per pixel (may decrease performance).

◆ ApplyColorAlpha

bool TriLib.AssetLoaderOptions.ApplyColorAlpha = true

Turn off this field to disable alpha color value on loaded materials.

◆ ApplyDiffuseColor

bool TriLib.AssetLoaderOptions.ApplyDiffuseColor = true

Turn off this field to disable diffuse color on loaded materials.

◆ ApplyDiffuseTexture

bool TriLib.AssetLoaderOptions.ApplyDiffuseTexture = true

Turn off this field to disable diffuse texture on loaded materials.

◆ ApplyDisplacementTexture

bool TriLib.AssetLoaderOptions.ApplyDisplacementTexture = true

Turn off this field to disable displacement texture on loaded materials.

◆ ApplyEmissionColor

bool TriLib.AssetLoaderOptions.ApplyEmissionColor = true

Turn off this field to disable emission color on loaded materials.

◆ ApplyEmissionTexture

bool TriLib.AssetLoaderOptions.ApplyEmissionTexture = true

Turn off this field to disable emission texture on loaded materials.

◆ ApplyGlossiness

bool TriLib.AssetLoaderOptions.ApplyGlossiness = true

Turn off this field to disable glossiness on loaded materials.

◆ ApplyGlossinessScale

bool TriLib.AssetLoaderOptions.ApplyGlossinessScale = true

Turn off this field to disable glossiness scale on loaded materials.

◆ ApplyMetallicTexture

bool TriLib.AssetLoaderOptions.ApplyMetallicTexture = true

Turn off this field to disable metallic texture on loaded materials.

◆ ApplyNormalScale

bool TriLib.AssetLoaderOptions.ApplyNormalScale = true

Turn off this field to disable normal scale on loaded materials.

◆ ApplyNormalTexture

bool TriLib.AssetLoaderOptions.ApplyNormalTexture = true

Turn off this field to disable normal texture on loaded materials.

◆ ApplyOcclusionTexture

bool TriLib.AssetLoaderOptions.ApplyOcclusionTexture = true

Turn off this field to disable occlusion texture on loaded materials.

◆ ApplySpecularColor

bool TriLib.AssetLoaderOptions.ApplySpecularColor = true

Turn off this field to disable specular color on loaded materials.

◆ ApplySpecularTexture

bool TriLib.AssetLoaderOptions.ApplySpecularTexture = true

Turn off this field to disable specular texture on loaded materials.

◆ AutoPlayAnimations

bool TriLib.AssetLoaderOptions.AutoPlayAnimations = true

Turn on this field to automatically play the first loaded animation.

Note
Only for legacy animations.

◆ Avatar

Avatar TriLib.AssetLoaderOptions.Avatar

If you don´t wish to use legacy animations, use this field to specify an existing UnityEngine.Avatar for using.

◆ CombineMeshes

bool TriLib.AssetLoaderOptions.CombineMeshes = true

Turn on this field to combine loaded meshes.

◆ ConvexMeshColliders

bool TriLib.AssetLoaderOptions.ConvexMeshColliders

Turn on this field to indicate that generated mesh collider will be convex.

◆ DisableAlphaMaterials

bool TriLib.AssetLoaderOptions.DisableAlphaMaterials

Turn on this field to disable transparent materials creation.

◆ DontAddMetadataCollection

bool TriLib.AssetLoaderOptions.DontAddMetadataCollection

Turn on this field to don't add the AssimpMetadataCollection component to the loaded UnityEngine.GameObjects.

◆ DontApplyAnimations

bool TriLib.AssetLoaderOptions.DontApplyAnimations

Turn on this field to disable applying loaded animations.

◆ DontGenerateAvatar

bool TriLib.AssetLoaderOptions.DontGenerateAvatar

Turn on this field if you gonna generate your own UnityEngine.Avatar later.

◆ DontLoadAnimations

bool TriLib.AssetLoaderOptions.DontLoadAnimations

Turn on this field to disable animations loading.

◆ DontLoadBlendShapes

bool TriLib.AssetLoaderOptions.DontLoadBlendShapes

Turn on this field to disable blend-shapes loading.

◆ DontLoadCameras

bool TriLib.AssetLoaderOptions.DontLoadCameras = true

Turn on this field to disable cameras loading.

◆ DontLoadLights

bool TriLib.AssetLoaderOptions.DontLoadLights = true

Turn on this field to disable lights loading.

◆ DontLoadMaterials

bool TriLib.AssetLoaderOptions.DontLoadMaterials

Turn on this field to disable materials loading.

◆ DontLoadMeshes

bool TriLib.AssetLoaderOptions.DontLoadMeshes

Turn on this field to disable meshes loading.

◆ DontLoadMetadata

bool TriLib.AssetLoaderOptions.DontLoadMetadata

Turn on this field to disable metadata processing and metadata processing callback (AssetLoaderBase.OnMetadataProcessed).

◆ DontLoadSkinning

bool TriLib.AssetLoaderOptions.DontLoadSkinning

Turn on this field to disable skinning.

◆ EnsureQuaternionContinuity

bool TriLib.AssetLoaderOptions.EnsureQuaternionContinuity = true

Turn on this field to realigns quaternion keys to ensure shortest interpolation paths.

This can cause glitches on some animations.

◆ ForceAnimationComponents

bool TriLib.AssetLoaderOptions.ForceAnimationComponents

Turn on this field to force the animation components creation even when there are no animations on the source model.

◆ GenerateMeshColliders

bool TriLib.AssetLoaderOptions.GenerateMeshColliders

Turn on this field to enable mesh collider generation

Note
Only for non-skinned mesh renderers.

◆ GenerateMipMaps

bool TriLib.AssetLoaderOptions.GenerateMipMaps = true

Enable this field to generate textures mipmaps.

◆ LoadRawMaterialProperties

bool TriLib.AssetLoaderOptions.LoadRawMaterialProperties

Turn on this field to load additional material properties (located on loaded MaterialData collection).

◆ MaterialShadingMode

MaterialShadingMode TriLib.AssetLoaderOptions.MaterialShadingMode

Change this field to switch between Standard, Specular and Roughness setup materials.

◆ MaterialTransparencyMode

MaterialTransparencyMode TriLib.AssetLoaderOptions.MaterialTransparencyMode

Change this field to switch between Alpha, Cutout and Fade transparency mode on materials.

◆ PostProcessSteps

Use this field to set-up advanced object loading options. AssimpPostProcessSteps

◆ RotationAngles

Vector3 TriLib.AssetLoaderOptions.RotationAngles = new Vector3(0f, 180f, 0f)

Use this field to override object rotation angles.

◆ Scale

float TriLib.AssetLoaderOptions.Scale = 1f

Use this field to override object scale.

◆ ScanForAlphaMaterials

bool TriLib.AssetLoaderOptions.ScanForAlphaMaterials

Turn on this field to automatically scan and apply alpha channel materials by checking textures per pixel (may decrease performance).

◆ TextureCompression

TextureCompression TriLib.AssetLoaderOptions.TextureCompression = TextureCompression.NormalQuality

Use this field to set loaded textures compression level.

◆ TextureFilterMode

FilterMode TriLib.AssetLoaderOptions.TextureFilterMode = FilterMode.Bilinear

Use this field to set the loaded textures filter mode.

◆ UseCutoutMaterials

bool TriLib.AssetLoaderOptions.UseCutoutMaterials

Turn on this field to use cutout materials instead of alpha-blended materials.

◆ UseLegacyAnimations

bool TriLib.AssetLoaderOptions.UseLegacyAnimations = true

Turn on this field to use legacy UnityEngine.Animation component.

◆ UseOriginalPositionRotationAndScale

bool TriLib.AssetLoaderOptions.UseOriginalPositionRotationAndScale = false

Turn on this field to use the original file orientation and rotation. That would fix issues with DAE files orientations, among others.

This field is turned off by default, to avoid breaking changes with existing code. When enabled, TriLib will create a wrapper object on top of the object you load, to keep the object original local transform. It's recommended to set this field to true on your AssetLoaderOptions instance.

◆ UseStandardSpecularMaterial

bool TriLib.AssetLoaderOptions.UseStandardSpecularMaterial

Turn on this field to use the Unity default specular material.


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