Table of Contents

Interface IRenderFilter

Namespace
nadena.dev.ndmf.preview
public interface IRenderFilter

Properties

CanEnableRenderers

Set to true if this RenderFilter might enable a renderer which is otherwise disabled. If you do, this should be performed by changing the enabled property of the proxy renderer.

Note that when enabling proxy renderers, it's up to you to consider the state of parent objects of the original; if you set enabled to true, it'll be displayed.

If all render filters interacting with a particular renderer have CanEnableRenderers set to false, the preview pipeline might skip all preview processing for that renderer.

bool CanEnableRenderers { get; }

Property Value

bool

StrictRenderGroup

Indicates that the preview system must not remove renderers from a multi-node render group, even if they are disabled. If this is set to true, then all renderers you return in a group from GetTargetGroups will be included when that group is instantiated.

Note that even if this is true, the preview system can eliminate nodes where all renderers are disabled.

bool StrictRenderGroup { get; }

Property Value

bool

Methods

GetPreviewControlNodes()

Returns a set of control nodes that can be used to modify the behavior of this filter. By default, returns an empty set.

IEnumerable<TogglablePreviewNode> GetPreviewControlNodes()

Returns

IEnumerable<TogglablePreviewNode>

GetTargetGroups(ComputeContext)

ImmutableList<RenderGroup> GetTargetGroups(ComputeContext context)

Parameters

context ComputeContext

Returns

ImmutableList<RenderGroup>

Instantiate(RenderGroup, IEnumerable<(Renderer, Renderer)>, ComputeContext)

Instantiates a node in the preview graph. This operation is used when creating a new proxy renderer, and may perform relatively heavyweight operations to prepare the Mesh, Materials, and Textures for the renderer. It may not modify other aspects of the renderer; however, these can be done in the OnFrame callback in the returned IRenderFilterNode.

When making changes to meshes, textures, and materials, this node must create new instances of these objects, and destroy them in IRenderFilterNode.Dispose.

Task<IRenderFilterNode> Instantiate(RenderGroup group, IEnumerable<(Renderer, Renderer)> proxyPairs, ComputeContext context)

Parameters

group RenderGroup
proxyPairs IEnumerable<(Renderer, Renderer)>

An enumerable of (original, proxy) renderer pairs

context ComputeContext

A compute context that is used to track which values your code depended on in configuring this node. Changing these values will triger a recomputation of this node.

Returns

Task<IRenderFilterNode>

IsEnabled(ComputeContext)

Evaluate whether the filter as a whole should be enabled. Returns true by default.

bool IsEnabled(ComputeContext context)

Parameters

context ComputeContext

Returns

bool