@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
65 lines (61 loc) • 2.26 kB
JavaScript
import { F as FlowGraphBlock } from './KHR_interactivity-CEwUaqxQ.esm.js';
import { R as RichTypeAny } from './declarationMapper-CqO08-WM.esm.js';
import { u as RegisterClass } from './index-MZPybX0H.esm.js';
import './objectModelMapping-De5EKNEZ.esm.js';
import './spotLight.pure-CRdZC6Ci.esm.js';
/** This file must only contain pure code and pure imports */
/**
* A block that gets the value of a variable.
* Variables are an stored in the context of the flow graph.
*/
class FlowGraphGetVariableBlock extends FlowGraphBlock {
/**
* Construct a FlowGraphGetVariableBlock.
* @param config construction parameters
*/
constructor(config) {
super(config);
this.config = config;
// The output connection has to have the name of the variable.
this.value = this.registerDataOutput("value", RichTypeAny, config.initialValue);
}
/**
* @internal
*/
_updateOutputs(context) {
const variableNameValue = this.config.variable;
if (context.hasVariable(variableNameValue)) {
this.value.setValue(context.getVariable(variableNameValue), context);
}
}
/**
* Serializes this block
* @param serializationObject the object to serialize to
*/
serialize(serializationObject) {
super.serialize(serializationObject);
serializationObject.config.variable = this.config.variable;
}
getClassName() {
return "FlowGraphGetVariableBlock" /* FlowGraphBlockNames.GetVariable */;
}
}
let _Registered = false;
/**
* Register side effects for flowGraphGetVariableBlock.
* Safe to call multiple times; only the first call has an effect.
*/
function RegisterFlowGraphGetVariableBlock() {
if (_Registered) {
return;
}
_Registered = true;
RegisterClass("FlowGraphGetVariableBlock" /* FlowGraphBlockNames.GetVariable */, FlowGraphGetVariableBlock);
}
/**
* Re-exports pure implementation and applies runtime side effects.
* Import flowGraphGetVariableBlock.pure for tree-shakeable, side-effect-free usage.
*/
RegisterFlowGraphGetVariableBlock();
export { FlowGraphGetVariableBlock, RegisterFlowGraphGetVariableBlock };
//# sourceMappingURL=flowGraphGetVariableBlock-CUas8whh.esm.js.map