ModifierInterface interface

Contract for Modifiers.

Signature:

interface ModifierInterface<TOptions extends KeyValueObject = KeyValueObject> extends EventEmitter<ModifierEvents> 

Extends: EventEmitter<ModifierEvents>

Remarks

Modifiers are a fundamental part of the Core3D SDK that describe the application of a ResourceInterface in a Design i.e. a link between the resource and design.

When a ResourceInterface is applied to a Design (e.g. using ) a ModifierInterface is returned.

Properties

Property

Modifiers

Type

Description

isModifier

readonly

boolean

Used by isModifier().

Methods

Method

Description

clone()

Clone the modifier.

dispose()

Destroy the modifier.

getDefault(key)

Get the default value for an option key.

getDefaults()

Get all option defaults.

getId()

Get the unique ID of this modifier.

getIsRendering()

Whether the modifier is currently rendering.

getMetadata()

Get any custom metadata for this resource.

getOption(key)

Get the current value of an option key.

getOptions()

Get all current option values.

getValue(key)

Get the value of an option key, falling back to the default.

render()

Render this modifier.

resetOption(key)

Reset an option by key back to undefined.

resetOptions()

Reset all options to undefined.

setId(id)

Set a unique ID for this modifier.

setMetadata(metadata)

Set custom metadata for this modifier.

setOption(key, value)

Set an option by key.

setOptions(options)

Set options with a key/value object.

setResource(resource)

Set the associated resource.

toJSON()

Serialize this resource to JSON.

Get in touch

We'd love to learn more about your vision and how we can help.

PressPrivacyTermsSupportCopyright © 2024 Core3D, Inc. All Rights Reserved.