Table of Contents

Class BuildContext

Namespace
nadena.dev.ndmf

The BuildContext is passed to all plugins during the build process. It provides access to the avatar being built, as well as various other context information.

public sealed class BuildContext
Inheritance
BuildContext
Inherited Members

Constructors

BuildContext(GameObject, string, bool)

public BuildContext(GameObject obj, string assetRootPath, bool isClone = true)

Parameters

obj GameObject
assetRootPath string
isClone bool

Properties

AssetContainer

An asset container that can be used to store generated assets. NDMF will automatically add any objects referenced by the avatar to this container when the build completes, but in some cases it can be necessary to manually save assets (e.g. when using AnimatorController builtins).

public UnityEngine.Object AssetContainer { get; }

Property Value

Object

AssetSaver

public IAssetSaver AssetSaver { get; }

Property Value

IAssetSaver

AvatarRootObject

The root GameObject of the avatar being built.

public GameObject AvatarRootObject { get; }

Property Value

GameObject

AvatarRootTransform

The root Transform of the avatar being built.

public Transform AvatarRootTransform { get; }

Property Value

Transform

ErrorReport

public ErrorReport ErrorReport { get; }

Property Value

ErrorReport

ObjectRegistry

public ObjectRegistry ObjectRegistry { get; }

Property Value

ObjectRegistry

Successful

public bool Successful { get; }

Property Value

bool

Methods

ActivateExtensionContext(Type)

public IExtensionContext ActivateExtensionContext(Type ty)

Parameters

ty Type

Returns

IExtensionContext

ActivateExtensionContext<T>()

public T ActivateExtensionContext<T>() where T : IExtensionContext

Returns

T

Type Parameters

T

DeactivateExtensionContext(Type)

public void DeactivateExtensionContext(Type t)

Parameters

t Type

DeactivateExtensionContext<T>()

public void DeactivateExtensionContext<T>() where T : IExtensionContext

Type Parameters

T

Extension<T>()

public T Extension<T>() where T : IExtensionContext

Returns

T

Type Parameters

T

GetState<T>()

public T GetState<T>() where T : new()

Returns

T

Type Parameters

T

GetState<T>(Func<BuildContext, T>)

public T GetState<T>(Func<BuildContext, T> init)

Parameters

init Func<BuildContext, T>

Returns

T

Type Parameters

T

IsTemporaryAsset(Object)

public bool IsTemporaryAsset(UnityEngine.Object obj)

Parameters

obj Object

Returns

bool

OpenSerializationScope()

public SerializationScope OpenSerializationScope()

Returns

SerializationScope

Serialize()

public void Serialize()

SetEnableUVDistributionRecalculation(Mesh, bool)

NDMF will automatically invoke RecalculateUVDistributionMetrics on all temporary asset meshes to ensure they work properly with streaming mipmaps. If you don't want this to happen for a specific mesh (eg if you invoked RecalculateUVDistributionMetric with a specific UV channel), invoke this function with enabled=false to opt out.

public void SetEnableUVDistributionRecalculation(Mesh mesh, bool enabled)

Parameters

mesh Mesh

The mesh to control

enabled bool

False to disable UV distribution recalculation