diff --git a/src/CLI/ProcessActions.cpp b/src/CLI/ProcessActions.cpp index 3d7254733f..3c36dd5f96 100644 --- a/src/CLI/ProcessActions.cpp +++ b/src/CLI/ProcessActions.cpp @@ -298,8 +298,16 @@ bool process_actions(Data& cli, const DynamicPrintConfig& print_config, std::vec return 1; } - if (actions.has("slice")) { + if (actions.has("slice") || actions.has("export_gcode") || actions.has("export_sla")) { PrinterTechnology printer_technology = Preset::printer_technology(print_config); + if (actions.has("export_gcode") && printer_technology == ptSLA) { + boost::nowide::cerr << "error: cannot export G-code for an FFF configuration" << std::endl; + return 1; + } + else if (actions.has("export_sla") && printer_technology == ptFFF) { + boost::nowide::cerr << "error: cannot export SLA slices for a SLA configuration" << std::endl; + return 1; + } const Vec2crd gap{ s_multiple_beds.get_bed_gap() }; arr2::ArrangeBed bed = arr2::to_arrange_bed(get_bed_shape(print_config), gap); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index f14110723e..3cc9dfaf3f 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -5792,7 +5792,6 @@ CLIActionsConfigDef::CLIActionsConfigDef() def->cli = "slice|s"; def->set_default_value(new ConfigOptionBool(false)); - /* looks like redundant actions. "slice" is complitely enough def = this->add("export_sla", coBool); def->label = L("Export SLA"); def->tooltip = L("Slice the model and export SLA printing layers as PNG."); @@ -5804,7 +5803,6 @@ CLIActionsConfigDef::CLIActionsConfigDef() def->tooltip = L("Slice the model and export toolpaths as G-code."); def->cli = "export-gcode|gcode|g"; def->set_default_value(new ConfigOptionBool(false)); -*/ } CLITransformConfigDef::CLITransformConfigDef()