From 147d8d7b964c09278409ded8ea4a9747bd931b46 Mon Sep 17 00:00:00 2001 From: Nicolas Predella Date: Thu, 21 May 2026 20:23:08 +0300 Subject: [PATCH] up --- core/nodeslicer/nodes.py | 12 ++++++++++++ gcode_snippets/ginger_end.gcode | 6 ++++++ gcode_snippets/ginger_start.gcode | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 gcode_snippets/ginger_end.gcode create mode 100644 gcode_snippets/ginger_start.gcode diff --git a/core/nodeslicer/nodes.py b/core/nodeslicer/nodes.py index 40ad2b4..a9c737f 100644 --- a/core/nodeslicer/nodes.py +++ b/core/nodeslicer/nodes.py @@ -1629,6 +1629,18 @@ class SLICENODE_GcodeToMesh(ExecSliceNode): # Assign Geometry Nodes nodegroup for preview ng_name = "Nonplanar Slicing Preview" + if ng_name not in bpy.data.node_groups: + # Try to load it from nodes.blend in the addon root + addon_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) + blend_path = os.path.join(addon_dir, "nodes.blend") + if os.path.exists(blend_path): + try: + with bpy.data.libraries.load(blend_path) as (data_from, data_to): + if ng_name in data_from.node_groups: + data_to.node_groups = [ng_name] + except Exception as e: + if operator: operator.report({'WARNING'}, f"Failed to load preview node group: {e}") + if ng_name in bpy.data.node_groups: ng = bpy.data.node_groups[ng_name] # Check if already assigned diff --git a/gcode_snippets/ginger_end.gcode b/gcode_snippets/ginger_end.gcode new file mode 100644 index 0000000..e775e4f --- /dev/null +++ b/gcode_snippets/ginger_end.gcode @@ -0,0 +1,6 @@ + +; End of print +G1 E-150 F1800 +G1 X950 Y950 Z418.550110 F9000 +M106 S0 +TURN_OFF_HEATERS diff --git a/gcode_snippets/ginger_start.gcode b/gcode_snippets/ginger_start.gcode new file mode 100644 index 0000000..caf3b77 --- /dev/null +++ b/gcode_snippets/ginger_start.gcode @@ -0,0 +1,21 @@ +M73 P0 R19 +EXCLUDE_OBJECT_DEFINE NAME=model CENTER=500.000,500.000 POLYGON=[[390.000,325.000],[610.000,325.000],[610.000,675.000],[390.000,675.000]] +START_PRINT BED_TEMPERATURE=80 KAMP_LEVELING=1 EXTRUDER_ROTATION_VOLUME=755 MIXING_STEPPER_ROTATION_VOLUME=9000 PURGE_LAYER_HEIGHT=2 PURGE_PARKING_SPEED=10000 PURGE_LENGHT=500 PURGE_SPEED=500 PURGE_MATERIAL_QUANTITY=10000 EXTRUDER_TEMPERATURE=240 EXTRUDER_TEMPERATURE_INITIAL_LAYER=240 PRESSURE_ADVANCE=0.2 PRESSURE_ADVANCE_SMOOTH_TIME=0.5 ZONE_1_TEMPERATURE=210 ZONE_2_TEMPERATURE=220 ZONE_3_TEMPERATURE=240 +G90 +G21 +M83 +SET_PRESSURE_ADVANCE EXTRUDER=extruder SMOOTH_TIME=0.55 +SET_PRESSURE_ADVANCE ADVANCE=0.3; Override pressure advance value +SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder DISTANCE=755 +SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=mixing_stepper DISTANCE=9000 +M106 S130 +G92 E0 +G1 Z3.5 F15000 +SET_VELOCITY_LIMIT ACCEL=2500 +SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5 +M140 S80 + +; Retract and travel to starting position +G1 E-135.000 F1800 +G1 X501.345957 Y675.000015 Z2.550000 F9000 +G1 E135.000 F1800