diff --git a/src/application/renderers/isf.js b/src/application/renderers/isf.js index 100a8e5b..1d9bb0d2 100644 --- a/src/application/renderers/isf.js +++ b/src/application/renderers/isf.js @@ -56,6 +56,8 @@ function render({ module, canvas, context, pipeline, props }) { } else { renderer.setValue(input.NAME, canvas); } + } else if (input.TYPE === "event") { + renderer.setValue(input.NAME, !!props[input.NAME]); } else { renderer.setValue(input.NAME, props[input.NAME]); } @@ -197,6 +199,13 @@ async function setupModule(moduleDefinition) { }); break; + + case "event": + addProp(input.NAME, { + type: "event", + label: input.LABEL || input.NAME + }); + break; } } diff --git a/src/application/worker/store/modules/dataTypes.js b/src/application/worker/store/modules/dataTypes.js index 7938e536..8dab2f64 100644 --- a/src/application/worker/store/modules/dataTypes.js +++ b/src/application/worker/store/modules/dataTypes.js @@ -11,6 +11,9 @@ const state = { bool: { get: value => value }, + event: { + get: value => value + }, vec2: { get: value => value, inputs: () => ({ 0: 0, 1: 0 }) diff --git a/src/application/worker/store/modules/modules.js b/src/application/worker/store/modules/modules.js index 91bbcc81..77a333bc 100644 --- a/src/application/worker/store/modules/modules.js +++ b/src/application/worker/store/modules/modules.js @@ -486,12 +486,12 @@ const actions = { let dataOut = data; - dataOut = applyExpression({ inputId, value: dataOut }); - if (store.state.dataTypes[type] && store.state.dataTypes[type].create) { dataOut = await store.state.dataTypes[type].create(dataOut); } + dataOut = applyExpression({ inputId, value: dataOut }); + if (!Array.isArray(dataOut)) { const { strict, min, max, abs } = propData; diff --git a/src/components/Control.vue b/src/components/Control.vue index 84adc12d..0026081a 100644 --- a/src/components/Control.vue +++ b/src/components/Control.vue @@ -78,6 +78,15 @@ > +