Interface IGLTFToFlowGraphMapping
blocks: any[];
configuration?: { [originName: string]: IGLTFToFlowGraphMappingObject };
declarationSchema?: {
inputValueSockets: Record<
string,
| "bool"
| "float"
| "float2"
| "float3"
| "float4"
| "float2x2"
| "float3x3"
| "float4x4"
| "int"
| "ref"
| "custom",
>;
outputValueSockets: Record<
string,
| "bool"
| "float"
| "float2"
| "float3"
| "float4"
| "float2x2"
| "float3x3"
| "float4x4"
| "int"
| "ref"
| "custom",
>;
};
extraProcessor?: (
gltfBlock: IKHRInteractivity_Node,
declaration: IKHRInteractivity_Declaration,
mapping: IGLTFToFlowGraphMapping,
parser: InteractivityGraphToFlowGraphParser,
serializedObjects: ISerializedFlowGraphBlock[],
context: ISerializedFlowGraphContext,
globalGLTF?: IGLTF,
) => ISerializedFlowGraphBlock[];
inputs?: {
flows?: { [originName: string]: IGLTFToFlowGraphMappingObject };
values?: { [originName: string]: IGLTFToFlowGraphMappingObject };
};
interBlockConnectors?: {
input: string;
inputBlockIndex: number;
isVariable?: boolean;
output: string;
outputBlockIndex: number;
}[];
outputs?: {
flows?: { [originName: string]: IGLTFToFlowGraphMappingObject };
values?: { [originName: string]: IGLTFToFlowGraphMappingObject };
};
typeToTypeMapping?: { [originName: string]: IGLTFToFlowGraphMappingObject };
validation?: (
gltfBlock: IKHRInteractivity_Node,
interactivityGraph: IKHRInteractivity_Graph,
glTFObject?: IGLTF,
) => { error?: string; valid: boolean };
}
Properties
blocks
The type of the FlowGraph block(s). Typically will be a single element in an array. When adding blocks defined in this module use the KHR_interactivity prefix.
Optionalconfiguration
The configuration of the glTF node mapped to the FlowGraph block. This information is usually passed to the constructor of the block.
Optionaldeclaration Schema
inputValueSockets: Record<
string,
| "bool"
| "float"
| "float2"
| "float3"
| "float4"
| "float2x2"
| "float3x3"
| "float4x4"
| "int"
| "ref"
| "custom",
>;
outputValueSockets: Record<
string,
| "bool"
| "float"
| "float2"
| "float3"
| "float4"
| "float2x2"
| "float3x3"
| "float4x4"
| "int"
| "ref"
| "custom",
>;
}
Exact value socket contract for an operation supplied by another extension.
Optionalextra Processor
gltfBlock: IKHRInteractivity_Node,
declaration: IKHRInteractivity_Declaration,
mapping: IGLTFToFlowGraphMapping,
parser: InteractivityGraphToFlowGraphParser,
serializedObjects: ISerializedFlowGraphBlock[],
context: ISerializedFlowGraphContext,
globalGLTF?: IGLTF,
) => ISerializedFlowGraphBlock[]
This is used if we need extra information for the constructor/options that is not provided directly by the glTF node. This function can return more than one node, if extra nodes are needed for this block to function correctly. Returning more than one block will usually happen when a json pointer was provided.
Type Declaration
-
- (
gltfBlock: IKHRInteractivity_Node,
declaration: IKHRInteractivity_Declaration,
mapping: IGLTFToFlowGraphMapping,
parser: InteractivityGraphToFlowGraphParser,
serializedObjects: ISerializedFlowGraphBlock[],
context: ISerializedFlowGraphContext,
globalGLTF?: IGLTF,
): ISerializedFlowGraphBlock[] -
Parameters
- gltfBlock: IKHRInteractivity_Node
the glTF node
- declaration: IKHRInteractivity_Declaration
the declaration object
- mapping: IGLTFToFlowGraphMapping
the mapping object
- parser: InteractivityGraphToFlowGraphParser
the interactivity graph parser
- serializedObjects: ISerializedFlowGraphBlock[]
the serialized objects
- context: ISerializedFlowGraphContext
the serialized flow graph context
OptionalglobalGLTF: IGLTFthe global gltf object
Returns ISerializedFlowGraphBlock[]
an array of serialized nodes that will be added to the graph.
- gltfBlock: IKHRInteractivity_Node
- (
Optionalinputs
flows?: { [originName: string]: IGLTFToFlowGraphMappingObject };
values?: { [originName: string]: IGLTFToFlowGraphMappingObject };
}
The inputs of the glTF node mapped to the FlowGraph block.
Type Declaration
-
Optionalflows?: { [originName: string]: IGLTFToFlowGraphMappingObject }The flow inputs of the glTF node mapped to the FlowGraph block.
-
Optionalvalues?: { [originName: string]: IGLTFToFlowGraphMappingObject }The value inputs of the glTF node mapped to the FlowGraph block.
Optionalinter Block Connectors
input: string;
inputBlockIndex: number;
isVariable?: boolean;
output: string;
outputBlockIndex: number;
}[]
The connections between two or more blocks. This is used to connect the blocks in the graph
Type Declaration
-
input: string
The name of the input connection in the first block.
-
inputBlockIndex: number
The index of the block in the array of blocks that corresponds to the input.
-
OptionalisVariable?: booleanIf the connection is a variable connection or a flow connection.
-
output: string
The name of the output connection in the second block.
-
outputBlockIndex: number
The index of the block in the array of blocks that corresponds to the output.
Optionaloutputs
flows?: { [originName: string]: IGLTFToFlowGraphMappingObject };
values?: { [originName: string]: IGLTFToFlowGraphMappingObject };
}
The outputs of the glTF node mapped to the FlowGraph block.
Type Declaration
-
Optionalflows?: { [originName: string]: IGLTFToFlowGraphMappingObject }The flow outputs of the glTF node mapped to the FlowGraph block.
-
Optionalvalues?: { [originName: string]: IGLTFToFlowGraphMappingObject }The value outputs of the glTF node mapped to the FlowGraph block.
Optionaltype To Type Mapping
If we generate more than one block for a single glTF node, this mapping will be used to map between the flowGraph classes.
Optionalvalidation
gltfBlock: IKHRInteractivity_Node,
interactivityGraph: IKHRInteractivity_Graph,
glTFObject?: IGLTF,
) => { error?: string; valid: boolean }
This optional function will allow to validate the node, according to the glTF specs. For example, if a node has a configuration object, it must be present and correct. This is a basic node-based validation. This function is expected to return false and log the error if the node is not valid. Note that this function can also modify the node, if needed.
Type Declaration
-
- (
gltfBlock: IKHRInteractivity_Node,
interactivityGraph: IKHRInteractivity_Graph,
glTFObject?: IGLTF,
): { error?: string; valid: boolean } -
Parameters
- gltfBlock: IKHRInteractivity_Node
the glTF node to validate
- interactivityGraph: IKHRInteractivity_Graph
the interactivity graph
OptionalglTFObject: IGLTFthe glTF object
Returns { error?: string; valid: boolean }
true if validated, false if not.
- gltfBlock: IKHRInteractivity_Node
- (
Description of how a KHR_interactivity declaration (op such as
pointer/get,event/onSelect,math/add) maps to one or more FlowGraph blocks. Used by InteractivityGraphToFlowGraphParser to translate the source glTF graph into the serialized FlowGraph form.