up
This commit is contained in:
parent
e01e1d2e94
commit
6174dbce4a
4 changed files with 25 additions and 2 deletions
|
|
@ -751,6 +751,20 @@ class SLICENODE_JoinGcode(SliceNodeJoiner):
|
||||||
return "\n".join(gcode_input)
|
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
|
@register_class
|
||||||
class SLICENODE_JoinSlices(SliceNodeJoiner):
|
class SLICENODE_JoinSlices(SliceNodeJoiner):
|
||||||
bl_label = "Join Slices"
|
bl_label = "Join Slices"
|
||||||
|
|
|
||||||
|
|
@ -158,8 +158,8 @@ class CollectionInputNodeSocket(InputNodeSocket):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
@register_class
|
|
||||||
class SLICESOCK_Overrides(CollectionInputNodeSocket):
|
class SLICESOCK_Overrides_Common(CollectionInputNodeSocket):
|
||||||
bl_label = "Overrides"
|
bl_label = "Overrides"
|
||||||
|
|
||||||
items: CollectionProperty(type=SLICENODE_OverrideItem) # pyright: ignore[reportInvalidTypeForm]
|
items: CollectionProperty(type=SLICENODE_OverrideItem) # pyright: ignore[reportInvalidTypeForm]
|
||||||
|
|
@ -185,6 +185,11 @@ class SLICESOCK_Overrides(CollectionInputNodeSocket):
|
||||||
overrides[item.field] = item.value_str
|
overrides[item.field] = item.value_str
|
||||||
return overrides
|
return overrides
|
||||||
|
|
||||||
|
@register_class
|
||||||
|
class SLICESOCK_Overrides(SLICESOCK_Overrides_Common): ...
|
||||||
|
@register_class
|
||||||
|
class SLICESOCK_OverridesRo(ReadonlySocket, SLICESOCK_Overrides_Common): ...
|
||||||
|
|
||||||
@register_class
|
@register_class
|
||||||
class SLICESOCK_ExecutionLink(LabelNodeSocket):
|
class SLICESOCK_ExecutionLink(LabelNodeSocket):
|
||||||
bl_label = "Execution Link"
|
bl_label = "Execution Link"
|
||||||
|
|
|
||||||
|
|
@ -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 Gcode").type = "SLICENODE_JoinGcode"
|
||||||
layout.operator("node.add_node", text="Join Mesh").type = "SLICENODE_JoinMesh"
|
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 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="Join Execution").type = "SLICENODE_JoinExecution"
|
||||||
layout.operator("node.add_node", text="Boolean Paths").type = "SLICENODE_JoinSlices"
|
layout.operator("node.add_node", text="Boolean Paths").type = "SLICENODE_JoinSlices"
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
| `SLICESOCK_Mesh` | `SlicingObject` | NumPy NDArray (Triangles) | Internal mesh data (Transformed/Scaled) |
|
| `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_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_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
|
## 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 Mesh**: Merges multiple `SlicingObject` instances into one.
|
||||||
- **Join Paths**: Combines multiple `SlicePaths`. Supports Sequential or Interleaved modes.
|
- **Join Paths**: Combines multiple `SlicePaths`. Supports Sequential or Interleaved modes.
|
||||||
- **Join Gcode**: Concatenates multiple G-code strings.
|
- **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.).
|
- **Integer Math**: Simple integer operations (Add, Multiply, etc.).
|
||||||
|
|
||||||
### Action & I/O
|
### Action & I/O
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue