Readonly
elementsReadonly
eventReadonly
nameReadonly
parametersOptional
Readonly
parentReadonly
uuidReadonly
viewerReadonly
viewerAll TransformNodes of the Variant mapped flat with a DottedPath.
The DottedPath in the built tree of Variants. E.g. "_.top-1.sub-2.sub-sub-3"
The defined glTF URI.
The id representing a DottedPath.
All TransformNodes inherited from this Variant's parents mapped flat with a DottedPath.
The inherited defined glTF URI.
All Lights inherited from this Variant's parents.
All TransformNodes inherited from this Variant's parents.
The ParameterDeclarations inherited from this Variant's parents.
The ParameterBag inherited from this Variant's parents.
All ViewerLights inherited from this Variant's parents.
The ViewerLights of the Variant.
The TransformNodes of the Variant.
Gets the VariantInstance this variant was created for. There are variants without an instance (the "ghost" ones used for bootstrapping instances). The usage of Variants without an instance is an absolute edge-case when deeply using the viewer api and working abroad best practices.
Adds a listener function for the given event.
Adds an observer function for parameter changes. The ParameterObserver gets 3 parameters: the ParameterObservable, the old ParameterValue and the new ParameterValue.
See Parameters for an example.
Adds an observer function for camera matrix changes for given dottedPath
representing the Element
and the traceable
. The observer
gets 2 parameters: the AbstractMesh
and a ClientRect
object.
Optional
payload: anyAsserts whether given parameter is declared and valid.
Broadcasts the given event with given arguments to all listeners and emitters.
Rest
...args: any[]Invoke parameter observers for given parameter.
Places the given ParameterBag in the Variant's parameters, replaces all patterns in the StructureJson, broadcasts all ParameterObservers and delegates them to its Elements.
Optional
parameters: ParameterBagGets a descendant Variant of the current Variant relative to its DottedPath.
If you have the dotted path _.product_x.variant_blue.with_yellow_highlight
in a tree and you operate on the
product_x
, you can call this.getDescendant('variant_blue.with_yellow_highlight')
to get the lowermost
Variant.
Gets the desired Element of the current Variant relative to its DottedPath. Uses the mechanism of getDescendant to resolve the appropriate variant in tree.
A proxy for directly getting a Mesh from an Element by its DottedPaths.
A proxy for directly getting a Node from an Element by its DottedPaths.
Gets the desired ViewerLight of the current Variant relative to its DottedPath. Uses the mechanism of getDescendant to resolve the appropriate variant in tree.
Alias for removeEventListener.
Alias for addEventListener.
Removes all eventListeners
for given event.
Removes all ParameterObservers for given parameter.
Static
createCreates a Variant based on given parameters.
Error if "gltf" property is provided without a filename
Optional
parent: VariantStatic
createCreates the root Variant.
Generated using TypeDoc
A concrete "Variant". Most of these are handled by either the Viewer or VariantInstance.