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.

3 lines (2 loc) 1.69 kB
import{c as t}from"./KHR_interactivity-D4lwBSW9.esm.min.js";import{R as e,b as o}from"./declarationMapper-D_filC93.esm.min.js";import{u as i}from"./index-BPURObVq.esm.min.js";import"./objectModelMapping-ClgDmo5Q.esm.min.js";import"./spotLight.pure-5s2DDDIt.esm.min.js";class s 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",o,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"}}let n=!1;function r(){n||(n=!0,i("FlowGraphSetPropertyBlock",s))}r();export{s as FlowGraphSetPropertyBlock,r as RegisterFlowGraphSetPropertyBlock}; //# sourceMappingURL=flowGraphSetPropertyBlock-DUH0dKrs.esm.min.js.map