Class FlowGraphGetPropertyBlock<P, O>
Type Parameters
- P extends any
- O extends WebXRSpatialLayerType
Hierarchy
- FlowGraphCachedOperationBlock<P>
- FlowGraphGetPropertyBlock
Index
Constructors
constructor
-
new FlowGraphGetPropertyBlock<P extends unknown, O extends FlowGraphAssetType>(
config: IFlowGraphGetPropertyBlockConfiguration<O>,
): FlowGraphGetPropertyBlock<P, O>Constructs a new FlowGraphGetPropertyBlock.
Type Parameters
- P extends unknown
- O extends FlowGraphAssetType
Parameters
- config: IFlowGraphGetPropertyBlockConfiguration<O>
the configuration of the block
Returns FlowGraphGetPropertyBlock<P, O>
Properties
config
the configuration of the block
Readonlycustom Get Function
(
target: AssetType<O>,
propertyName: string,
context: FlowGraphContext,
) => P | undefined,
>
Input connection: A function that can be used to get the value of the property. This will be used if defined, instead of the default get function.
data Inputs
The data inputs of the block.
data Outputs
The data outputs of the block.
Readonlyis Valid
Output connection: Whether the value is valid.
metadata
Metadata that can be used by the block.
name
The name of the block.
Readonlyobject
Input connection: The asset from which the property will be retrieved
Readonlyproperty Name
Input connection: The name of the property that will be set
unique Id
A randomly generated GUID for each block.
Readonlyvalue
The output of the operation
Methods
_ do Operation
-
Retrieves the property value from the target object.
Parameters
- context: FlowGraphContext
the flow graph context
Returns P | undefined
the property value, or undefined if the target or property name is not set
- context: FlowGraphContext
deserialize
-
Deserializes this block
Parameters
- _serializationObject: ISerializedFlowGraphBlock
the object to deserialize from
Returns void
- _serializationObject: ISerializedFlowGraphBlock
get Class Name
-
Returns the class name of this block.
Returns string
the class name
get Data Input
-
Given the name of a data input, returns the connection if it exists
Parameters
- name: string
the name of the input
Returns FlowGraphDataConnection<any> | undefined
the connection if it exists, undefined otherwise
- name: string
get Data Output
-
Given the name of a data output, returns the connection if it exists
Parameters
- name: string
the name of the output
Returns FlowGraphDataConnection<any> | undefined
the connection if it exists, undefined otherwise
- name: string
register Data Input
-
registerDataInput<T>(
name: string,
richType: RichType<T>,
defaultValue?: T,
): FlowGraphDataConnection<T>Registers a data input on the block.
Type Parameters
- T
Parameters
Returns FlowGraphDataConnection<T>
the created connection
register Data Output
-
registerDataOutput<T>(
name: string,
richType: RichType<T>,
defaultValue?: T,
): FlowGraphDataConnection<T>Registers a data output on the block.
Type Parameters
- T
Parameters
Returns FlowGraphDataConnection<T>
the created connection
serialize
-
serialize(
serializationObject?: any,
_valueSerializeFunction?: (
key: string,
value: any,
serializationObject: any,
) => any,
): voidSerializes this block
Parameters
- serializationObject: any = {}
the object to serialize to
- _valueSerializeFunction: (key: string, value: any, serializationObject: any) => any = defaultValueSerializationFunction
a function that serializes a specific value
Returns void
- serializationObject: any = {}
This block will deliver a property of an asset, based on the property name and an input asset. The property name can include dots ("."), which will be interpreted as a path to the property.
For example, with an input of a mesh asset, the property name "position.x" will deliver the x component of the position of the mesh.
Note that it is recommended to input the object on which you are working on (i.e. a material) rather than providing a mesh as object and then getting the material from it.