shaderNodeObject function

dynamic shaderNodeObject(
  1. dynamic obj
)

Implementation

shaderNodeObject(obj) {
  if (obj is num) {
    return shaderNodeObject(FloatNode(obj).setConst(true));
  } else if (obj is Node) {
    var nodeObject = nodeObjects.get(obj);

    if (nodeObject == null) {
      nodeObject = proxy(obj, NodeHandler);
      nodeObjects.set(obj, nodeObject);
    }

    return nodeObject;
  }

  return obj;
}