@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.
3 lines (2 loc) • 1.56 kB
JavaScript
import{b as t}from"./KHR_interactivity-CKt1TdMW.esm.min.js";import{R as e}from"./declarationMapper-13w1YGqM.esm.min.js";import{R as o}from"./index-Bw2N6w1y.esm.min.js";import"./objectModelMapping-DX92iJ8M.esm.min.js";class i extends t{constructor(t){super(t),this.config=t,this.object=this.registerDataInput("object",e,t.target),this.value=this.registerDataInput("value",e),this.propertyName=this.registerDataInput("propertyName",e,t.propertyName),this.customSetFunction=this.registerDataInput("customSetFunction",e)}_execute(t,e){try{const e=this.object.getValue(t),o=this.value.getValue(t),i=this.propertyName.getValue(t);this._stopRunningAnimations(t,e,i);const s=this.customSetFunction.getValue(t);s?s(e,i,o,t):this._setPropertyValue(e,i,o)}catch(e){this._reportError(t,e)}this.out._activateSignal(t)}_stopRunningAnimations(t,e,o){const i=t._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const s of i){const n=t.assetsContext.animationGroups.find((t=>t.uniqueId===s));if(n)for(const r of n.targetedAnimations)if(r.target===e&&r.animation.targetProperty===o){n.stop(!0),n.dispose();const e=i.indexOf(s);-1!==e&&(i.splice(e,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",i))}}}_setPropertyValue(t,e,o){const i=e.split(".");let s=t;for(let t=0;t<i.length-1;t++){const e=i[t];void 0===s[e]&&(s[e]={}),s=s[e]}s[i[i.length-1]]=o}getClassName(){return"FlowGraphSetPropertyBlock"}}o("FlowGraphSetPropertyBlock",i);export{i as FlowGraphSetPropertyBlock};
//# sourceMappingURL=flowGraphSetPropertyBlock-VHW7ynWh.esm.min.js.map