UNPKG

@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.

29 lines (26 loc) 1.3 kB
import { F as FlowGraphBlock } from './KHR_interactivity-CEwUaqxQ.esm.js'; import { R as RichTypeAny } from './declarationMapper-CqO08-WM.esm.js'; import './index-MZPybX0H.esm.js'; import './objectModelMapping-De5EKNEZ.esm.js'; import './spotLight.pure-CRdZC6Ci.esm.js'; /** * a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree * Can be used, for example, to get animation index from a glTF animation */ class FlowGraphGLTFDataProvider extends FlowGraphBlock { constructor(config) { super(config); const glTF = config.glTF; // glTF may be undefined when the block is re-created from serialized data // (e.g. in the Flow Graph Editor) where the live glTF parse tree is unavailable. const animationGroups = glTF?.animations?.map((a) => a._babylonAnimationGroup) || []; this.animationGroups = this.registerDataOutput("animationGroups", RichTypeAny, animationGroups); const nodes = glTF?.nodes?.map((n) => n._babylonTransformNode) || []; this.nodes = this.registerDataOutput("nodes", RichTypeAny, nodes); } getClassName() { return "FlowGraphGLTFDataProvider"; } } export { FlowGraphGLTFDataProvider }; //# sourceMappingURL=flowGraphGLTFDataProvider-BzAJsqyF.esm.js.map