From 6174dbce4a361b15b94b650b1193ed62ae60aab9 Mon Sep 17 00:00:00 2001 From: Nicolas Predella Date: Sat, 16 May 2026 19:14:51 +0300 Subject: [PATCH] up --- core/nodeslicer/nodes.py | 14 ++++++++++++++ core/nodeslicer/sockets.py | 9 +++++++-- core/nodeslicer/tree.py | 1 + doc/NODES.md | 3 +++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/core/nodeslicer/nodes.py b/core/nodeslicer/nodes.py index 3a01a73..76256b1 100644 --- a/core/nodeslicer/nodes.py +++ b/core/nodeslicer/nodes.py @@ -751,6 +751,20 @@ class SLICENODE_JoinGcode(SliceNodeJoiner): return "\n".join(gcode_input) +@register_class +class SLICENODE_JoinOverrides(SliceNodeJoiner): + bl_label = "Join Overrides" + socket_type = "SLICESOCK_Overrides" + output_socket_type = "SLICESOCK_OverridesRo" + + def evaluate_output(self, socket_name: str, **_kwargs) -> dict[str, str]: + merged: dict[str, str] = {} + for input in self.inputs: + val = resolve_input(input) + if isinstance(val, dict): + merged.update(val) + return merged + @register_class class SLICENODE_JoinSlices(SliceNodeJoiner): bl_label = "Join Slices" diff --git a/core/nodeslicer/sockets.py b/core/nodeslicer/sockets.py index 038acd8..5804ab0 100644 --- a/core/nodeslicer/sockets.py +++ b/core/nodeslicer/sockets.py @@ -158,8 +158,8 @@ class CollectionInputNodeSocket(InputNodeSocket): else: break -@register_class -class SLICESOCK_Overrides(CollectionInputNodeSocket): + +class SLICESOCK_Overrides_Common(CollectionInputNodeSocket): bl_label = "Overrides" items: CollectionProperty(type=SLICENODE_OverrideItem) # pyright: ignore[reportInvalidTypeForm] @@ -185,6 +185,11 @@ class SLICESOCK_Overrides(CollectionInputNodeSocket): overrides[item.field] = item.value_str return overrides +@register_class +class SLICESOCK_Overrides(SLICESOCK_Overrides_Common): ... +@register_class +class SLICESOCK_OverridesRo(ReadonlySocket, SLICESOCK_Overrides_Common): ... + @register_class class SLICESOCK_ExecutionLink(LabelNodeSocket): bl_label = "Execution Link" diff --git a/core/nodeslicer/tree.py b/core/nodeslicer/tree.py index c9c5893..7fe42ef 100644 --- a/core/nodeslicer/tree.py +++ b/core/nodeslicer/tree.py @@ -163,6 +163,7 @@ class SLICENODE_MT_Menu(Menu): layout.operator("node.add_node", text="Join Gcode").type = "SLICENODE_JoinGcode" layout.operator("node.add_node", text="Join Mesh").type = "SLICENODE_JoinMesh" layout.operator("node.add_node", text="Join Paths").type = "SLICENODE_JoinPaths" + layout.operator("node.add_node", text="Join Overrides").type = "SLICENODE_JoinOverrides" layout.operator("node.add_node", text="Join Execution").type = "SLICENODE_JoinExecution" layout.operator("node.add_node", text="Boolean Paths").type = "SLICENODE_JoinSlices" layout.separator() diff --git a/doc/NODES.md b/doc/NODES.md index 7110b21..73afd8d 100644 --- a/doc/NODES.md +++ b/doc/NODES.md @@ -12,6 +12,8 @@ | `SLICESOCK_Mesh` | `SlicingObject` | NumPy NDArray (Triangles) | Internal mesh data (Transformed/Scaled) | | `SLICESOCK_Paths` | `SlicePaths` (list) | List of paths (N, 3) + groups | Generic toolpaths or slice boundaries | | `SLICESOCK_Gcode` | `str` | Multi-line string | Generated G-code text | +| `SLICESOCK_Overrides` | `dict[str, str]` | Python dictionary | Mapping of configuration fields to values | +| `SLICESOCK_OverridesRo` | `dict[str, str]` | Python dictionary | Read-only merged configuration overrides | ## Detailed Data Types @@ -64,6 +66,7 @@ All nodes are found in the **Add (Shift+A)** menu under the **SliceNodes** categ - **Join Mesh**: Merges multiple `SlicingObject` instances into one. - **Join Paths**: Combines multiple `SlicePaths`. Supports Sequential or Interleaved modes. - **Join Gcode**: Concatenates multiple G-code strings. +- **Join Overrides**: Sequentially merges multiple override dictionaries. Later inputs overwrite earlier ones for matching keys. - **Integer Math**: Simple integer operations (Add, Multiply, etc.). ### Action & I/O