diff --git a/README.md b/README.md index d86b5b8..8ad71fa 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,9 @@ You can colorize nodes via their `title background`, `node body` or `title text` TICK Node Batch Support Output +**2024/02/23** @1.7.26: +* vector fields can now be reset by clicking on the header of the field + **2024/02/22** @1.7.25: * cleanup api names * cleaned up typehints diff --git a/__init__.py b/__init__.py index 0850eb7..e4c1eff 100644 --- a/__init__.py +++ b/__init__.py @@ -75,8 +75,8 @@ JOV_CONFIG_FILE = JOV_WEB / 'config.json' # nodes to skip on import; for online systems; skip Export, Streamreader, etc... JOV_IGNORE_NODE = ROOT / 'ignore.txt' -JOV_LOG_LEVEL = os.getenv("JOV_LOG_LEVEL", "INFO") -logger.configure(handlers=[{"sink": sys.stdout, "level": JOV_LOG_LEVEL}]) +logger.add(sys.stdout, level=os.getenv("JOV_LOG_LEVEL", "INFO"), + filter=lambda record: "jovi" in record["extra"]) JOV_INTERNAL = os.getenv("JOV_INTERNAL", 'false').strip().lower() in ('true', '1', 't') diff --git a/pyproject.toml b/pyproject.toml index efcbf94..b0ab4aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "jovimetrix" description = "Integrates Webcam, MIDI, Spout and GLSL shader support. Animation via tick. Parameter manipulation with wave generator. Math operations with Unary and Binary support. Value conversion for all major types (int, string, list, dict, Image, Mask). Shape mask generation, image stacking and channel ops, batch splitting, merging and randomizing, load images and video from anywhere, dynamic bus routing with a single node, export support for GIPHY, save output anywhere! flatten, crop, transform; check colorblindness, make stereogram or stereoscopic images, or liner interpolate values and more." -version = "1.7.25" +version = "1.7.26" license = { file = "LICENSE" } readme = "README.md" authors = [{ name = "Alexander G. Morano", email = "amorano@gmail.com" }] diff --git a/web/widget/widget_vector.js b/web/widget/widget_vector.js index 3d9581e..8eaf8b6 100644 --- a/web/widget/widget_vector.js +++ b/web/widget/widget_vector.js @@ -1,12 +1,11 @@ /** * File: widget_vector.js - * Project: Jovimetrix */ + import { app } from "../../../scripts/app.js" -import { widgetToInput, widgetToWidget } from '../util/util_widget.js' -import { domInnerValueChange } from '../util/util.js' import { $el } from "../../../scripts/ui.js" +import { widgetToInput, widgetToWidget, domInnerValueChange } from './util_jov.js' /** @import { IWidget, LGraphCanvas } from '../../types/litegraph/litegraph.d.ts' */ function isVersionLess(v1, v2) { @@ -164,7 +163,11 @@ const VectorWidget = (app, inputName, options, initial, desc='') => { const index = Math.floor(x / element_width); pointer.onClick = (eUp) => { - if (index >= 0 && index < size) { + /* if click on header, reset to defaults */ + if (index == -1) { + widget.value = Object.assign({}, widget.options.default); + } + else if (index >= 0 && index < size) { const pos = [eUp.canvasX - node.pos[0], eUp.canvasY - node.pos[1]] const old_value = { ...this.value }; const label = this.options?.label ? this.name + '➖' + this.options.label?.[index] : this.name;