From bd76ada3191632811c4d0b2258b93ae34eefd540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Sat, 14 Nov 2026 20:08:01 +0100 Subject: [PATCH] fix(blender): OpenCode for Blender 0.4.4, find the API and verify by criteria The 0.4.3 exercises showed agents guessing Blender's Python API (a property name, an operator's stroke elements, a node's sockets, the 5.3 compositing tree), declaring results they had not measured, and a scripted sculpt stroke closing Blender 5.3. 0.4.4 answers from the running Blender itself, never from embedded tables, and keeps the tool surface as it was. Errors that say what is valid: a failed execute_code run on Blender's API carries a hint, read before the run is undone: the closest names and the type's properties for an unknown attribute, the operator's real signature (with its collections' element type) for its arguments, the closest items for an invalid enumeration value, a collection's keys for a missing key (node sockets included), the node types the tree creates for an unknown node type, Blender's reason and the context the code had for a failed poll. The add-on wraps the bpy.ops callables created during the run (same call, poll, get_rna_type and repr; restored afterwards) to name the failing operator, and reads a failing collection or node tree from the failing line with names, attribute reads and constant subscripts only. blender_inspect: search finds words in this Blender's types, properties, functions and operators, with their paths and the properties that lead to a type; an operator shows its collections' element type and its poll here with Blender's reason; tree makes a node type in the tree named (shader, geometry, compositing, texture) or lists what that tree creates instead; entries beyond limit are named instead of cut, and match takes words as well as a glob. blender_verify: criteria are the agent's own checks (a read-only expression or a bpy.data path, a comparison, a value, frames), measured on the evaluated scene and returned passed or failed with the value; visible says whether an object shows in the render at a frame, or every reason found (out of frame, hidden in render, collection excluded, view layer not rendered, holdout, transparent or zero-density material, no geometry, hidden behind another object). The render runs when asked, or without criteria and visible. The sculpt crash is a Blender 5.3 defect, established without the add-on: the script path of sculpt.brush_stroke skips the grid mask layer its interactive path creates (BKE_sculpt_mask_layers_ensure), so a mask stroke (the Mask brush or brush_toggle='MASK', which the default keymap binds to Alt+drag) on a multiresolution object corrupts the heap. A sphere with one Multires level and one scripted mask stroke closes Blender from a timer and from the Text editor's Run Script alike; the same strokes by hand never do. OpenCode Link now creates the layer first, as the interactive path does (inverting the mask twice keeps its values), and says so in warnings. A background Blender has no undo stack until a first undo step, and every sculpt-mode operator closes it without one: a first step is pushed when none was. The add-on's hello names its process and crash folder, so a call after Blender closed says so with the crash report it wrote instead of an unreachable host (not under WSL, where Blender's process is on Windows). Asset previews run from execute_code in a Blender with a window when the operator gets its data-block (temp_override(id=...)); the failed poll's hint and inspect now show that. The working method asks to inspect the exact element, read an error's hint and inspect again, set measurable criteria and conclude with blender_verify, within its 10 lines. Validation: ops044_tests.py (12 tests) and three plugin tests in a background Blender 5.3 fail on 0.4.3 (the first through a real crash) and pass on 0.4.4; unit tests for the closed-Blender notice. Windowed Blender 5.3 on Ubuntu, through the add-on's execute_code: the minimal mask stroke and the full ex02 sequence 6/6 alive with 0.4.4, 2/3 crashes with 0.4.3 in the same harness; asset previews generated. lint, typecheck, npm test, build, check:markers, trace scan, Blender suites (20/20, extension 1/1) and native sessions with OpenCode 2.2.5 pass. --- catalog.json | 2 +- .../blender/host/opencode_link/blender_app.py | 19 + .../host/opencode_link/blender_manifest.toml | 2 +- .../blender/host/opencode_link/core.py | 20 +- .../blender/host/opencode_link/hints.py | 330 +++++++++++ .../blender/host/opencode_link/op_watch.py | 126 ++++ integrations/blender/host/ops.json | 2 +- integrations/blender/plugin/README.md | 30 +- ...link-0.4.3.zip => opencode_link-0.4.4.zip} | Bin 836111 -> 855894 bytes .../plugin/methods/tools/blender_inspect.json | 18 +- .../plugin/methods/tools/blender_verify.json | 19 +- integrations/blender/plugin/package.json | 8 +- .../blender/plugin/programs/inspect.py | 221 ++++++- .../blender/plugin/programs/verify.py | 551 ++++++++++++++---- integrations/blender/plugin/src/closed.ts | 49 ++ .../blender/plugin/src/integration.ts | 58 +- integrations/blender/plugin/src/method.ts | 13 +- integrations/blender/test/MANUAL.md | 2 + integrations/blender/test/blender.test.ts | 153 +++++ .../blender/test/blender/ops044_tests.py | 217 +++++++ integrations/blender/test/plugin.test.ts | 7 +- integrations/blender/test/publication.test.ts | 2 +- integrations/blender/test/unit.test.ts | 30 +- package-lock.json | 2 +- spec/README.md | 4 +- 25 files changed, 1691 insertions(+), 194 deletions(-) create mode 100644 integrations/blender/host/opencode_link/hints.py create mode 100644 integrations/blender/host/opencode_link/op_watch.py rename integrations/blender/plugin/host/blender/{opencode_link-0.4.3.zip => opencode_link-0.4.4.zip} (97%) create mode 100644 integrations/blender/plugin/src/closed.ts create mode 100644 integrations/blender/test/blender/ops044_tests.py diff --git a/catalog.json b/catalog.json index 97402bd..3083392 100644 --- a/catalog.json +++ b/catalog.json @@ -32,7 +32,7 @@ "fr": "Lire et modifier la scène ouverte dans Blender grâce à l'extension OpenCode Link : changements typés en un pas d'annulation, inspection du Blender lancé, rendus de vérification et en arrière-plan." }, "app": { "name": "Blender", "versions": ">=5.3" }, - "host": { "protocol": 1, "range": "^0.4.3" }, + "host": { "protocol": 1, "range": "^0.4.4" }, "docs": "https://github.com/NeuralNomadsAI/opencode-integrations/blob/main/integrations/blender/plugin/README.md", "status": "preview", "sources": { "git": ["github:NeuralNomadsAI/opencode-integrations#main::path:integrations/blender/plugin"] } diff --git a/integrations/blender/host/opencode_link/blender_app.py b/integrations/blender/host/opencode_link/blender_app.py index 17c5562..1568ac4 100644 --- a/integrations/blender/host/opencode_link/blender_app.py +++ b/integrations/blender/host/opencode_link/blender_app.py @@ -8,11 +8,13 @@ import os import queue import secrets +import tempfile import threading import time import bpy +from . import hints, op_watch from .process import state as process_state from .wire import HostFailure from .native_refs import NativeRefs @@ -413,6 +415,7 @@ def _with_window(self, fn): def undo_push(self, message): self._with_window(lambda: bpy.ops.ed.undo_push(message=message[:63])) + op_watch.undo_stack_made() def undo(self): epoch = self.script_epoch() @@ -544,6 +547,22 @@ def created_refs(self, op, result): def exec_namespace(self): return {"bpy": bpy, "__name__": "__opencode_execute__"} + @staticmethod + def watch_operators(): + return op_watch.watching() + + @staticmethod + def explain(error, code, filename): + return hints.explain(error, code, filename) + + @staticmethod + def process(): + """This Blender's process and the folder its crash report goes to (.crash.txt, or + blender.crash.txt for an unsaved file): the parent of its session temporary folder.""" + session = bpy.app.tempdir + return {"pid": os.getpid(), + "temp_dir": os.path.dirname(os.path.normpath(session)) if session else tempfile.gettempdir()} + # UI datablocks (windows, screens, workspaces) are not the document's content. _UI_DATA = frozenset(("window_managers", "screens", "workspaces")) diff --git a/integrations/blender/host/opencode_link/blender_manifest.toml b/integrations/blender/host/opencode_link/blender_manifest.toml index cfa4705..b6e0215 100644 --- a/integrations/blender/host/opencode_link/blender_manifest.toml +++ b/integrations/blender/host/opencode_link/blender_manifest.toml @@ -1,7 +1,7 @@ schema_version = "1.0.0" id = "opencode_link" -version = "0.4.3" +version = "0.4.4" name = "OpenCode Link" tagline = "Lets OpenCode work on this Blender session" maintainer = "NeuralNomads" diff --git a/integrations/blender/host/opencode_link/core.py b/integrations/blender/host/opencode_link/core.py index 83ad2b2..ab2bfad 100644 --- a/integrations/blender/host/opencode_link/core.py +++ b/integrations/blender/host/opencode_link/core.py @@ -345,6 +345,8 @@ def _hello(self, params): document = self.app.document() if document: hello["document"] = document + if hasattr(self.app, "process"): + hello["process"] = self.app.process() # the plugin says where the crash report is if Blender closes return hello def _reload(self, params): @@ -908,14 +910,28 @@ def _execute_code(self, params): # modified: inspections and runs after a save leave the file saved; a change is reported, never undone. read_only = params.get("read_only") is True rotations = self.app.rotation_snapshot() if hasattr(self.app, "rotation_snapshot") else None + notes, hint = [], [] def run(): - exec(compile(code, filename or "", "exec"), namespace) # noqa: S102 - the dangerous method + # Operator calls watched (guards, the failing operator named); a failure on Blender's API explained + # by what is valid there, read before the failed run is undone. + watch = self.app.watch_operators() if hasattr(self.app, "watch_operators") else contextlib.nullcontext() + with watch as watched: + try: + exec(compile(code, filename or "", "exec"), namespace) # noqa: S102 - the dangerous method + except Exception as error: + found = self.app.explain(error, code, filename) if hasattr(self.app, "explain") else None + if found: + hint.append(found) + raise + finally: + notes.extend(getattr(watched, "notes", None) or []) check = namespace.get("check_is_finished") return check if callable(check) else None done = self._guarded(run, "code", barrier=not read_only) warnings = self.app.rotation_warnings(rotations) if rotations is not None else [] + warnings.extend(notes) if read_only and done.changed: warnings.append("OpenCode: this read_only run changed the document; no undo step groups or undoes it.") @@ -935,6 +951,8 @@ def finish(deferred=None, deferred_error=None): output["warnings"] = warnings if done.error: output.update(message=done.error, traceback=done.trace) + if hint: + output["hint"] = hint[0] if done.changed: output["restored"] = done.restored if self.residue: diff --git a/integrations/blender/host/opencode_link/hints.py b/integrations/blender/host/opencode_link/hints.py new file mode 100644 index 0000000..467fd2b --- /dev/null +++ b/integrations/blender/host/opencode_link/hints.py @@ -0,0 +1,330 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +"""What is valid where supplied code failed on Blender's API, read from this Blender (RNA, bpy.ops, node types made +in a temporary tree): the closest names, an operator's real signature, a type's properties, an enumeration's items, +a collection's keys (node sockets included), the node types a tree accepts. Computed before the failed run is +undone, so the data the code made is still there. Never raises: no hint rather than a second error. +""" + +import ast +import difflib +import re + +import bpy + +LIST_MAX = 80 +CLOSEST = 6 + +_OPERATOR = re.compile(r'Calling operator "bpy\.ops\.(\w+)\.(\w+)" error, could not be found') +_KEYWORD = re.compile(r'keyword "(\w+)" (unrecognized|missing)') +_ENUM = re.compile(r'enum "([^"]*)" not found in \(([^)]*)\)') +_KEY = re.compile(r'bpy_prop_collection\[key\]: key "([^"]*)" not found') +_INDEX = re.compile(r"bpy_prop_collection\[index\]: index (-?\d+) out of range") +_NODE = re.compile(r"Node type (\w+) undefined") +_POLL = re.compile(r"Operator bpy\.ops\.(\w+)\.(\w+)\.poll\(\) (.*)", re.S) + + +def explain(error, code, filename): + """A dict of what is valid at the failure, or None.""" + try: + text = str(error) + for rule in (_operator_unknown, _operator_poll, _operator_arguments, _attribute, _enum, _collection, _node_type): + hint = rule(error, text, code, filename) + if hint: + return hint + except Exception: # noqa: BLE001 - a hint is a bonus + return None + return None + + +# -- names ---------------------------------------------------------------------------------------------------- +def _closest(name, names): + names = list(dict.fromkeys(names)) + found = difflib.get_close_matches(name, names, n=CLOSEST, cutoff=0.55) + words = [w for w in re.split(r"[_\W]+|(?<=[a-z])(?=[A-Z])", name.lower()) if len(w) > 2] + for candidate in names: + if len(found) >= CLOSEST * 2: + break + if candidate not in found and any(w in candidate.lower() for w in words): + found.append(candidate) + return found + + +def _listed(names): + names = list(names) + out = {"all": names[:LIST_MAX]} + if len(names) > LIST_MAX: + out["more"] = len(names) - LIST_MAX + return out + + +def _prop(p): + d = {"id": p.identifier, "type": p.type} + if p.type == "ENUM": + d["enum"] = [e.identifier for e in p.enum_items][:LIST_MAX] or "dynamic" + elif p.type in ("POINTER", "COLLECTION"): + d["of"] = p.fixed_type.identifier + elif getattr(p, "array_length", 0): + d["array"] = p.array_length + if p.is_readonly: + d["readonly"] = True + if p.description: + d["desc"] = p.description[:120] + return d + + +def _struct(rna, name, members_of=None): + props = [p for p in rna.properties if p.identifier != "rna_type"] + funcs = list(rna.functions) + names = [p.identifier for p in props] + [f.identifier for f in funcs] + closest = _closest(name, names) + by_id = {p.identifier: p for p in props} + hint = {"type": rna.identifier, "missing": name, + "closest": [(_prop(by_id[c]) if c in by_id else {"id": c, "type": "FUNCTION"}) for c in closest]} + hint["properties"] = _listed(p.identifier for p in props) + if funcs: + hint["functions"] = _listed(f.identifier for f in funcs) + return hint + + +# -- rules ---------------------------------------------------------------------------------------------------- +def _operator_unknown(error, text, code, filename): + m = _OPERATOR.search(text) + if not isinstance(error, AttributeError) or not m: + return None + module, name = m.groups() + modules = sorted(dir(bpy.ops)) + if module not in modules: + return {"operator": "%s.%s" % (module, name), "missing": "module %s" % module, + "closest_modules": _closest(module, modules)} + ops = sorted(dir(getattr(bpy.ops, module))) + return {"operator": "%s.%s" % (module, name), "missing": name, + "closest": ["%s.%s" % (module, o) for o in _closest(name, ops)], "in_module": _listed(ops)} + + +def own(rna): + """A struct's properties by identifier, the struct's own one when a base declares it too (an operator's file + element redeclares PropertyGroup.name).""" + found = {} + for p in rna.properties: + if p.identifier != "rna_type": + found[p.identifier] = p + return list(found.values()) + + +def _signature(rna): + out = [] + for p in rna.properties: + if p.identifier == "rna_type": + continue + d = _prop(p) + if p.type == "COLLECTION": + d["element"] = {"type": p.fixed_type.identifier, "properties": [_prop(e) for e in own(p.fixed_type)], + "note": "each element is a dict holding every one of these properties"} + out.append(d) + return out + + +def _operator_rna(error): + idname = getattr(error, "opencode_operator", None) + if not idname: + return None, None + module, _, name = idname.partition(".") + try: + return idname, getattr(getattr(bpy.ops, module), name).get_rna_type() + except Exception: # noqa: BLE001 + return idname, None + + +def _operator_poll(error, text, code, filename): + m = _POLL.search(text) + if not isinstance(error, RuntimeError) or not m: + return None + idname = "%s.%s" % m.groups()[:2] + ctx = bpy.context + seen = {} + for member in ("window", "screen", "area", "region", "mode", "scene", "view_layer", "active_object", "object", "id"): + try: + value = getattr(ctx, member, None) + except Exception: # noqa: BLE001 + value = None + if member == "mode" or value is None: + seen[member] = value + elif member in ("area", "region"): + seen[member] = value.type + else: + seen[member] = getattr(value, "name", None) or type(value).__name__ + hint = {"operator": idname, "poll": m.group(3).strip()[:300], "context": seen, + "give_context": "with bpy.context.temp_override(window=..., area=..., region=..., id=..., active_object=...)"} + try: + rna = getattr(getattr(bpy.ops, m.group(1)), m.group(2)).get_rna_type() + hint["description"] = (rna.description or "")[:300] + except Exception: # noqa: BLE001 + pass + return hint + + +def _operator_arguments(error, text, code, filename): + idname, rna = _operator_rna(error) + if rna is None or not isinstance(error, (TypeError, ValueError)): + return None + hint = {"operator": idname, "signature": _signature(rna)} + keyword = _KEYWORD.search(text) + if keyword and keyword.group(2) == "unrecognized": + hint["unknown"] = keyword.group(1) + hint["closest"] = _closest(keyword.group(1), [p.identifier for p in rna.properties if p.identifier != "rna_type"]) + elif keyword: + hint["missing"] = keyword.group(1) + enum = _ENUM.search(text) + if enum: + items = [i.strip().strip("'\"") for i in enum.group(2).split(",") if i.strip()] + hint["invalid"] = enum.group(1) + hint["closest"] = _closest(enum.group(1), items) + return hint + + +def _attribute(error, text, code, filename): + if not isinstance(error, AttributeError): + return None + obj, name = getattr(error, "obj", None), getattr(error, "name", None) + if not name: + return None + if obj is bpy.types: + return {"missing": "bpy.types.%s" % name, "closest": _closest(name, dir(bpy.types))} + if obj is bpy.context: + return {"missing": "bpy.context.%s" % name, "closest": _closest(name, dir(bpy.context))} + rna = getattr(obj, "bl_rna", None) + return _struct(rna, name) if rna is not None else None + + +def _enum(error, text, code, filename): + m = _ENUM.search(text) + if not isinstance(error, TypeError) or not m: + return None + items = [i.strip().strip("'\"") for i in m.group(2).split(",") if i.strip()] + return {"invalid": m.group(1), "closest": _closest(m.group(1), items), "items": items[:LIST_MAX]} + + +def _collection(error, text, code, filename): + key = _KEY.search(text) + index = _INDEX.search(text) + if not (isinstance(error, KeyError) and key) and not (isinstance(error, IndexError) and index): + return None + wanted = key.group(1) if key else int(index.group(1)) + found = _failing_value(error, code, filename, + lambda node: isinstance(node, ast.Subscript) and _constant(node.slice) == wanted, + lambda node: node.value) + if found is None: + return None + path, collection = found + if not isinstance(collection, bpy.types.bpy_prop_collection): + return None + keys, labels = [], [] + for item in collection: + name = getattr(item, "name", None) or getattr(item, "identifier", None) + if name is None: + continue + ident = getattr(item, "identifier", None) + keys.append(name) + if ident and ident != name: + keys.append(ident) + labels.append("%s (identifier %s)" % (name, ident) if ident and ident != name else name) + hint = {"collection": path, "length": len(collection), "keys": _listed(labels)} + if key: + hint["missing"] = wanted + hint["closest"] = _closest(wanted, keys) + owner = getattr(collection, "id_data", None) + if owner is not None: + hint["of"] = "%s %r" % (type(owner).__name__, owner.name) + return hint + + +def _node_type(error, text, code, filename): + m = _NODE.search(text) + if not isinstance(error, RuntimeError) or not m: + return None + wanted = m.group(1) + names = [n for n in dir(bpy.types) if _is_node(getattr(bpy.types, n, None))] + hint = {"missing": wanted} + found = _failing_value( + error, code, filename, + lambda node: (isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute) and node.func.attr == "new" + and node.args and _constant(node.args[0]) == wanted), + lambda node: node.func.value) + tree_type = None + if found is not None and getattr(found[1], "id_data", None) is not None: + tree_type = found[1].id_data.bl_idname + hint["tree_type"] = tree_type + candidates = _closest(wanted, names) + if tree_type: + hint["closest_creatable"] = _creatable(tree_type, candidates) + else: + hint["closest"] = candidates + return hint + + +# -- helpers ---------------------------------------------------------------------------------------------------- +def _is_node(cls): + rna = getattr(cls, "bl_rna", None) + while rna is not None: + if rna.identifier == "Node": + return True + rna = rna.base + return False + + +def _creatable(tree_type, candidates): + out = [] + with bpy.data.temp_data() as data: + tree = data.node_groups.new("hints", tree_type) + for name in candidates: + try: + node = tree.nodes.new(name) + except Exception: # noqa: BLE001 + continue + out.append({"type": name, "name": node.name, + "inputs": [s.name for s in node.inputs][:24], "outputs": [s.name for s in node.outputs][:24]}) + tree.nodes.remove(node) + return out + + +def _constant(node): + return node.value if isinstance(node, ast.Constant) else None + + +def _failing_value(error, code, filename, match, part): + """The value of `part(node)` for the first AST node of the failing line that `match`es, evaluated from the + failing frame's names with attribute reads and constant subscripts only (no call). (source, value) or None.""" + if not isinstance(code, str): + return None + frame, line = None, None + tb = error.__traceback__ + while tb is not None: + if tb.tb_frame.f_code.co_filename == (filename or ""): + frame, line = tb.tb_frame, tb.tb_lineno + tb = tb.tb_next + if frame is None: + return None + scope = dict(frame.f_globals) + scope.update(frame.f_locals) + for node in ast.walk(ast.parse(code)): + if getattr(node, "lineno", None) is None or not node.lineno <= line <= node.end_lineno or not match(node): + continue + target = part(node) + try: + return ast.unparse(target), _value(target, scope) + except Exception: # noqa: BLE001 - not a plain read: try the next candidate + continue + return None + + +def _value(node, scope): + if isinstance(node, ast.Name): + if node.id not in scope: + raise LookupError(node.id) + return scope[node.id] + if isinstance(node, ast.Attribute): + return getattr(_value(node.value, scope), node.attr) + if isinstance(node, ast.Subscript) and isinstance(node.slice, ast.Constant): + return _value(node.value, scope)[node.slice.value] + raise LookupError(type(node).__name__) diff --git a/integrations/blender/host/opencode_link/op_watch.py b/integrations/blender/host/opencode_link/op_watch.py new file mode 100644 index 0000000..4dc7965 --- /dev/null +++ b/integrations/blender/host/opencode_link/op_watch.py @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +"""The operator calls of supplied code (execute_code), watched while it runs. + +Every `bpy.ops` callable the code creates is wrapped: a failing call names its operator, so the error's hint reads +the operator's real signature. Two calls that close Blender 5.3 from a script are prepared first, as Blender's +interactive path prepares them: + +- a mask stroke (`sculpt.brush_stroke` with the Mask brush or brush_toggle='MASK') on a multiresolution object. + The operator's interactive path creates the grid mask layer before painting; its script path does not, and the + stroke writes into grids never allocated (a heap corruption: Blender closes on the next mode switch or redraw). + The layer is created first, as the interactive path does: inverting the mask twice keeps its values. +- a sculpt-mode operator in a Blender without interface: its sculpt undo step reads the undo stack, which a + background Blender makes at its first undo step only. One step is pushed first when none was yet (an + execute_code that changes the document already pushed its barrier step). + +Where `bpy.ops` creates its callables otherwise (another Blender version), nothing is wrapped. +""" + +import contextlib + +import bpy + +# Sculpt-mode operators that record no sculpt undo step. +_NO_SCULPT_UNDO = frozenset(("sculpt.sculptmode_toggle",)) +_undo_stack = {"made": False} +UNDO_STEP = "OpenCode: undo stack" +UNDO_NOTE = ("OpenCode: pushed a first undo step before %s: a Blender without interface makes its undo stack then, " + "and a sculpt-mode operator closes it without one.") +MASK_LAYER_NOTE = ("OpenCode: created the multiresolution mask layer of %r before the scripted mask stroke " + "(Blender's script path of sculpt.brush_stroke skips it and closes Blender).") + + +def undo_stack_made(): + """An undo step was pushed: from then on this Blender has its undo stack.""" + _undo_stack["made"] = True + + +class _Watch(object): + def __init__(self, create): + self.create = create # the original factory: the guards' own calls are not watched + self.notes = [] + self.prepared = set() + + def before(self, idname, args, kwargs): + module = idname.partition(".")[0] + if module not in ("sculpt", "paint"): + return + obj = getattr(bpy.context, "active_object", None) + sculpting = obj is not None and getattr(obj, "mode", None) == "SCULPT" + if not sculpting: + return + if bpy.app.background and idname not in _NO_SCULPT_UNDO and not _undo_stack["made"]: + self.create("ed", "undo_push")(message=UNDO_STEP) + undo_stack_made() + self.notes.append(UNDO_NOTE % idname) + if idname == "sculpt.brush_stroke" and not _invoked(args) and _masks(kwargs) and _multires(obj): + key = obj.as_pointer() + if key in self.prepared: + return + invert = self.create("paint", "mask_flood_fill") + invert(mode="INVERT") + invert(mode="INVERT") + self.prepared.add(key) + self.notes.append(MASK_LAYER_NOTE % obj.name) + + +def _invoked(args): + # An INVOKE_* call goes through the interactive path, which prepares the layer itself. + return bool(args) and isinstance(args[0], str) and args[0].startswith("INVOKE") + + +def _masks(kwargs): + if kwargs.get("brush_toggle") == "MASK": + return True + paint = getattr(bpy.context.tool_settings, "sculpt", None) + brush = getattr(paint, "brush", None) + return getattr(brush, "sculpt_brush_type", None) == "MASK" + + +def _multires(obj): + return any(m.type == "MULTIRES" and m.show_viewport for m in getattr(obj, "modifiers", ())) + + +class _Operator(object): + """A bpy.ops callable: the same call, poll, get_rna_type and repr, watched.""" + + __slots__ = ("_op", "_idname", "_watch") + + def __init__(self, op, idname, watch): + self._op = op + self._idname = idname + self._watch = watch + + def __call__(self, *args, **kwargs): + try: + self._watch.before(self._idname, args, kwargs) + return self._op(*args, **kwargs) + except Exception as error: + try: + error.opencode_operator = self._idname # read by hints.explain + except Exception: # noqa: BLE001 - an exception without attributes keeps its message + pass + raise + + def __getattr__(self, name): + return getattr(self._op, name) + + def __repr__(self): + return repr(self._op) + + +@contextlib.contextmanager +def watching(): + """Wraps the bpy.ops callables created inside the block; yields the watch (its notes).""" + ops = getattr(bpy, "ops", None) + create = getattr(ops, "_op_create_function", None) + if create is None: + yield _Watch(None) + return + watch = _Watch(create) + ops._op_create_function = lambda module, func: _Operator(create(module, func), "%s.%s" % (module, func), watch) + try: + yield watch + finally: + ops._op_create_function = create diff --git a/integrations/blender/host/ops.json b/integrations/blender/host/ops.json index 14d5d46..6fb3854 100644 --- a/integrations/blender/host/ops.json +++ b/integrations/blender/host/ops.json @@ -1,6 +1,6 @@ { "addon": "opencode_link", - "version": "0.4.3", + "version": "0.4.4", "protocol": 1, "method": "apply", "wire": "params.operations: [{op, args}] with every op below (an edit batch); unknown ops and fields are refused", diff --git a/integrations/blender/plugin/README.md b/integrations/blender/plugin/README.md index 9238f5d..443f0ce 100644 --- a/integrations/blender/plugin/README.md +++ b/integrations/blender/plugin/README.md @@ -39,24 +39,24 @@ The **Plugins** section lists OpenCode for Blender as an integration: its versio - **Which Blender.** `blender_hosts` and `blender_context` name the Blender this conversation acts on (`attached_to`: offer and label). Other conversations attaching or detaching other Blenders, or Blenders appearing, never make this conversation's ownership unverifiable; a permission prompt is refused only when this conversation's own Blender changed meanwhile. - **Across an OpenCode restart.** The plugin keeps each conversation's attachment in its storage (the Blender's offer key only as a SHA-256 digest, with the label; never a token, port or script handle). When the same Blender offers itself again after a restart, the conversation is attached back without asking, once its ownership is verified at its Location; never inside a read. A kept attachment lasts while its Blender is offered and two minutes after it stops; detaching removes it at once. A Blender restarted itself is a new offer: the conversation attaches again as above. - **Upgrading without restarting OpenCode.** A daemon that loads a newer version of the plugin without restarting can keep the older one in memory. Each version keeps its own list of offered Blenders, named after the add-on versions it accepts, so a Blender is always judged by the version that lists it; it offers itself again within 5 seconds. -- **The working method.** When a conversation attaches a Blender, a short method joins it (an instructions entry, about 200 tokens): read the Blender version first, ask Blender itself (`blender_inspect`) before writing code in an area that changed recently, verify each step by its result (`blender_verify` for anything that renders), and write down what you discover. +- **The working method.** When a conversation attaches a Blender, a short method joins it (an instructions entry, about 250 tokens): read the Blender version first, inspect the exact element before coding it (`blender_inspect`, its `search` to find where a setting lives), read an error's hint and inspect again instead of guessing, give operators their context with `temp_override`, turn the acceptance criteria into checks run with `blender_verify` (`criteria`, `visible`) and report the measured values, and write down what you discover. - **Session binding.** Clients read `bindingRead({ sessionID })` at the session's current OpenCode Location: `attached` identifies its live offer and safe label, `none` confirms a verified session without a binding, and `unknown` keeps the state unverified. `status_changed {}` invalidates the read; `detachHost({ sessionID })` detaches. See the [draft 0.2 RPC contract](../../../spec/rpc-contract.md). ## Tools -| Tool | What it does | -| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `blender_hosts` | The offered Blenders (label, document, Blender version, whether this conversation or another one is attached to each) and the add-on's install state; `attach` attaches one (asks permission), `detach` releases this conversation's. | -| `blender_install_host` | Installs or updates OpenCode Link in the newest Blender 5.3 or later (asks permission). | -| `blender_context` | A compact read of the scene: revision, scene settings, collections, markers, a page of objects with their transforms; `ref` gives one object in detail (world bounds, pose bones); `include: ["parts"]` lists a mesh's loose parts (world box, material, dominant vertex group), `region` keeps those in a world box. | -| `blender_apply` | Up to 50 typed operations as one undo step, checked whole before anything changes; a failure part-way restores every changed field. See [Typed operations](#typed-operations). | -| `blender_execute_code` | Python in Blender; every run asks the `blender_execute_code` permission. See [Code execution](#code-execution). | -| `blender_lab` | One of Blender Lab's tools (object and file summaries, screenshots, views, thumbnails), run by the add-on; images come back as attachments. | -| `blender_inspect` | What this Blender really exposes for a type (properties, functions, node sockets), an operator or live data, with the links to the API docs, manual and release notes of its version. | -| `blender_verify` | A low-resolution render of the scene's final output (sequencer, compositing), or from a free viewpoint (`view`: location, target, lens), with facts: black or transparent, brightness, the camera used and why, strips, instances. `frames` returns several frames as one contact sheet; `scene` chooses the scene (the facts name the one read, and warn when it is a shot of a montage). Settings, cameras and frame are restored; the revision stays. | -| `blender_render` | A render in a separate background Blender to an exact output (an image, a frame pattern or an H.264 video, with the montage's sound when it has any; the result lists the streams written), followed as a task (`task`, `wait_s` up to an hour, `cancel`). It renders the saved file (`unsaved`). | -| `blender_save` | Saves the file, under a path, or a copy; a save that failed because another process held the file a moment is retried once and says so (`retried`). | -| `blender_import` | BlenderKit and Sketchfab searches, and imports from them or from a file (glTF, FBX, OBJ, USD; a path or an https URL), followed as a task (`task`, `wait_s`, `cancel`). BlenderKit and Sketchfab need their add-ons. | +| Tool | What it does | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `blender_hosts` | The offered Blenders (label, document, Blender version, whether this conversation or another one is attached to each) and the add-on's install state; `attach` attaches one (asks permission), `detach` releases this conversation's. | +| `blender_install_host` | Installs or updates OpenCode Link in the newest Blender 5.3 or later (asks permission). | +| `blender_context` | A compact read of the scene: revision, scene settings, collections, markers, a page of objects with their transforms; `ref` gives one object in detail (world bounds, pose bones); `include: ["parts"]` lists a mesh's loose parts (world box, material, dominant vertex group), `region` keeps those in a world box. | +| `blender_apply` | Up to 50 typed operations as one undo step, checked whole before anything changes; a failure part-way restores every changed field. See [Typed operations](#typed-operations). | +| `blender_execute_code` | Python in Blender; every run asks the `blender_execute_code` permission. See [Code execution](#code-execution). | +| `blender_lab` | One of Blender Lab's tools (object and file summaries, screenshots, views, thumbnails), run by the add-on; images come back as attachments. | +| `blender_inspect` | What this Blender really exposes: `search` (words found in its types, properties, functions and operators, with their paths and the properties that lead to a type), a type (properties, functions; a node type's real sockets, made in the `tree` named), an operator (parameters, the element type of its collections, its poll here with Blender's reason) or live data; entries beyond `limit` are named, `match` takes a glob or words. With the links to the API docs, manual and release notes of its version. | +| `blender_verify` | `criteria`: the agent's checks (a read-only expression or a `bpy.data` path, a comparison, a value, frames), each measured on the evaluated scene and passed or failed with the value; `visible`: whether an object shows in the render at a frame, otherwise every reason found (out of frame, hidden in render, collection excluded, view layer not rendered, holdout, transparent or zero-density material, no geometry, hidden behind another object). Without them, or with `render` or `view`: a low-resolution render of the scene's final output, or from a free viewpoint (`view`: location, target, lens), with facts: black or transparent, brightness, the camera used and why, strips, instances. `frames` returns several frames as one contact sheet; `scene` chooses the scene (the facts name the one read, and warn when it is a shot of a montage). Settings, cameras and frame are restored; the revision stays. | +| `blender_render` | A render in a separate background Blender to an exact output (an image, a frame pattern or an H.264 video, with the montage's sound when it has any; the result lists the streams written), followed as a task (`task`, `wait_s` up to an hour, `cancel`). It renders the saved file (`unsaved`). | +| `blender_save` | Saves the file, under a path, or a copy; a save that failed because another process held the file a moment is retried once and says so (`retried`). | +| `blender_import` | BlenderKit and Sketchfab searches, and imports from them or from a file (glTF, FBX, OBJ, USD; a path or an https URL), followed as a task (`task`, `wait_s`, `cancel`). BlenderKit and Sketchfab need their add-ons. | `blender_inspect`, `blender_verify`, `blender_render` and `blender_save` send fixed programs of the package (`programs/*.py`) through the host's code execution, read only, with their parameters as JSON data; they ask no permission because they run no code from the model. Without `if_revision` and `command_id`, `blender_apply` applies to the document as it is now under a new `command_id`; with them it is refused when the scene changed, and a replayed `command_id` applies nothing. @@ -129,6 +129,8 @@ Add-on settings (Preferences ▸ Add-ons ▸ OpenCode Link): _OpenCode service_ `blender_execute_code` runs Python in Blender with your rights: it can read and write files, start processes and reach the network. The add-on lists it while it is enabled, and **every run asks the `blender_execute_code` permission** ("ask" unless you allow it in OpenCode's permission settings); a refused run executes nothing. A run that changes the scene is one undo step; a failing one is undone. Blender keeps linked data outside its undo (a linked library, the brush a sculpt or paint mode links): it is named in `restoration.kept_linked`, unused and not saved. When an undo cannot be proven, OpenCode Link is **quarantined**: reads, `blender_verify`, `blender_inspect` and `read_only` code still run, changes wait; `blender_context` shows `quarantine.may_have_changed`, and once you checked it, `blender_context` with `release_quarantine` (that read's revision) lifts it, as does Reset in the add-on's panel. A long script can be a file (`path`): it is read as written, with no escaping through a JSON or JavaScript string, and its tracebacks name the file. See [`SECURITY.md`](../../../SECURITY.md). +A run that fails on Blender's API carries a `hint` read from that Blender before the run is undone: for an unknown attribute, the closest names and the type's properties; for an operator's arguments, its real signature (with the element type of its collections) and the closest names; for an invalid enumeration value, the closest items; for a missing key, the collection's keys (a node's sockets included); for an unknown node type, the closest types the tree creates, with their sockets; for a failed poll, Blender's reason and the context the code had. While a run executes, OpenCode Link prepares two calls Blender 5.3 closes on from a script, as Blender's interactive path prepares them, and says so in `warnings`: a mask stroke (`sculpt.brush_stroke` with the Mask brush or `brush_toggle='MASK'`) on a multiresolution object gets its mask layer first, and in a Blender without interface a sculpt-mode operator gets a first undo step when none was pushed yet. If the attached Blender closes, the next call says so with the crash report it wrote (`.crash.txt` in its temporary folder), instead of an unreachable host. + ## Blender limits - Blender 5.3 or later; edits run in Object mode only. diff --git a/integrations/blender/plugin/host/blender/opencode_link-0.4.3.zip b/integrations/blender/plugin/host/blender/opencode_link-0.4.4.zip similarity index 97% rename from integrations/blender/plugin/host/blender/opencode_link-0.4.3.zip rename to integrations/blender/plugin/host/blender/opencode_link-0.4.4.zip index 050c614871589611a43239fed43ff835cc302f99..4a7a8d4b951c3610a84ab781b5f63563c7546e7b 100644 GIT binary patch delta 17134 zcmb7r4RjpWbsqKy*dMGYfB^UlQiGu&&XV8={E;Jp0%eGTeP~hy#UHEE5?%~;2f&Jp z-PO#jK$xOeO57+(dmOv0{cI^m7W;EfT|2d0iK1l5BH5F+b`mFLeUzRgN-L#xeR`V2 z(vh2!#J1e;-uLEbL5fkR1MTk2oBQs&Ki|FYzB|A9+1-Ei?4IYJ_}%Q=Yk#n9`q7S# z=|^Aqjo*#M#3#3>d&F0Fb{gXB_H_E@g-XqHN3?pQxMX>yg%`f@dvDw`q^W=YRkK+u z*Nd)al};5Gt+H)gY<0)Jwnm&^mDsR~pDWfIwqtp9M`+I``ulSS0x6I z*{2&-t5P#;$EiCbTB%;PN3^+0)vj5Kc781D&+OP<)2V69oq6Mjm~gA%)JwMO8W9@0 zt{-2hxZ1s-UbdaBuBHZQR;{dg3$`{_ui}PQ@m#IsSnh)6*p0g5Y4dg4)x5f9+)b=$ z#M?fTN0{De57Kf1MrS4QR(Km!9n7FLYp(T}UFOy0$9TSm<=8b(tIzS2F8Hm~Yno>- zVphvpR{WS?JfQCn8rNnU%cj+6m^8dx2{~XBHdrBdp69S>uOxf<{A&n>cbnQ|4=z1EtdHw`jA=Sc&Cn;QKM_WVOO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