From 4c69d7095b8fcabe7759b5427b7fa01e3f18975f Mon Sep 17 00:00:00 2001 From: Nicolas Predella Date: Tue, 2 Jun 2026 14:10:11 +0300 Subject: [PATCH] renaming --- README.md | 2 +- core/nodeslicer/nodes/preview.py | 10 ++++++++-- core/nodeslicer/tree.py | 2 +- doc/NODES.md | 2 +- doc/USER_GUIDE.md | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 475507c..5009ab8 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ NodeSlicer is a high-performance Blender extension that provides a custom node-b * Add internal structure with the **Infill** node. * Combine or modify paths using **Join Paths** or **Join Slices**. 5. **Generate**: Convert paths to G-code using **Paths to Gcode**. -6. **Export & Preview**: Use **Gcode To File** to save the result, and **Gcode Preview** to visualize the final toolpaths in the viewport. +6. **Export & Preview**: Use **Gcode To File** to save the result, and **Gcode to Preview Mesh** to visualize the final toolpaths in the viewport. ## Documentation diff --git a/core/nodeslicer/nodes/preview.py b/core/nodeslicer/nodes/preview.py index de1b683..818328c 100644 --- a/core/nodeslicer/nodes/preview.py +++ b/core/nodeslicer/nodes/preview.py @@ -8,7 +8,7 @@ from .base import ExecSliceNode @register_class class SLICENODE_GcodeToMesh(ExecSliceNode): - bl_label = "Gcode Preview" + bl_label = "Gcode to Preview Mesh" button_label = "Update Preview" show_e_0: NfBoolProperty(name="Show Zero Extrusions", default=False) # pyright: ignore[reportInvalidTypeForm] @@ -195,6 +195,12 @@ class SLICENODE_GcodeToMesh(ExecSliceNode): for i, gcode in enumerate(valid_gcodes): mesh_name = base_mesh_name if i == 0 else f"{base_mesh_name}_{i+1}" - self._process_gcode(gcode, mesh_name, operator) + try: + self._process_gcode(gcode, mesh_name, operator) + except Exception as e: + import traceback + traceback.print_exc() + if operator: + operator.report({'WARNING'}, f"Failed to preview G-code {i+1}: {e}") return 'ok' diff --git a/core/nodeslicer/tree.py b/core/nodeslicer/tree.py index 9b5068e..e07a49d 100644 --- a/core/nodeslicer/tree.py +++ b/core/nodeslicer/tree.py @@ -537,7 +537,7 @@ class SLICENODE_MT_ActionIO(Menu): layout.operator("node.add_node", text="Baserow Submit").type = "SLICENODE_BaserowSubmit" layout.operator("node.add_node", text="Airtable Submit").type = "SLICENODE_AirtableSubmit" layout.separator() - layout.operator("node.add_node", text="Gcode Preview").type = "SLICENODE_GcodeToMesh" + layout.operator("node.add_node", text="Gcode to Preview Mesh").type = "SLICENODE_GcodeToMesh" layout.operator("node.add_node", text="PrusaSlicer Preview").type = "SLICENODE_PrusaslicerPreview" layout.operator("node.add_node", text="PrusaSlicer Slice").type = "SLICENODE_PrusaslicerSlice" layout.operator("node.add_node", text="Executor").type = "SLICENODE_Executor" diff --git a/doc/NODES.md b/doc/NODES.md index fcbda3c..fd8548d 100644 --- a/doc/NODES.md +++ b/doc/NODES.md @@ -97,7 +97,7 @@ All nodes are found in the **Add (Shift+A)** menu under the **SliceNodes** categ - **Config**: PrusaSlicer configuration (from the **PrusaSlicer Config** node). - **Gcode**: Output socket providing the generated G-code string. - **Gcode to Text Block**: Creates a new Blender text block containing the G-code and opens it in any active text editors. -- **Gcode Preview**: Decodes G-code and creates a Blender mesh ("Debug" object) for visualization. +- **Gcode to Preview Mesh**: Decodes G-code and creates a Blender mesh ("Debug" object) for visualization. - **PrusaSlicer Preview**: Launches PrusaSlicer's built-in G-code viewer to visualize a G-code string. - **Executable**: Path to the PrusaSlicer executable (default: `flatpak run com.prusa3d.PrusaSlicer`). - **Gcode**: Input socket for the G-code string to preview. diff --git a/doc/USER_GUIDE.md b/doc/USER_GUIDE.md index 34bcc0d..9d3cdf8 100644 --- a/doc/USER_GUIDE.md +++ b/doc/USER_GUIDE.md @@ -33,7 +33,7 @@ Follow these steps to generate G-code for a simple object and preview it: * This node generates the raw G-code text. ### Step 4: Preview the Result -* Add a **Gcode Preview** node. +* Add a **Gcode to Preview Mesh** node. * Connect the Gcode output to it. * Click the **Update Debug Mesh** button on the node. * A new object named **Debug** will appear in your scene, showing the toolpaths.