UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

22 lines (21 loc) 776 B
"use strict"; import { ObjectNamedFunction2, ObjectNamedFunction3 } from "./_Base"; import { getOrCreateObjectAttributeRef } from "../../core/reactivity/ObjectAttributeReactivityCreateRef"; export class getObjectAttribute extends ObjectNamedFunction3 { static type() { return "getObjectAttribute"; } func(object3D, attribName, type, defaultValue) { const _ref = getOrCreateObjectAttributeRef(object3D, attribName, type, defaultValue); return _ref.current.value; } } export class getObjectAttributeAutoDefault extends ObjectNamedFunction2 { static type() { return "getObjectAttributeAutoDefault"; } func(object3D, attribName, type) { const _ref = getOrCreateObjectAttributeRef(object3D, attribName, type); return _ref.current.value; } }