mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-10 06:29:08 +08:00
Fixed conflicts after merge with master
This commit is contained in:
commit
ef32cd6059
@ -440,16 +440,25 @@ function(prusaslicer_copy_dlls target)
|
|||||||
set(_bits 32)
|
set(_bits 32)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
get_target_property(_out_dir ${target} BINARY_DIR)
|
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
get_target_property(_alt_out_dir ${target} RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
|
||||||
|
if (_alt_out_dir)
|
||||||
|
set (_out_dir "${_alt_out_dir}")
|
||||||
|
elseif (_is_multi)
|
||||||
|
set (_out_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>/$<CONFIG>")
|
||||||
|
else ()
|
||||||
|
set (_out_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# This has to be a separate target due to the windows command line lenght limits
|
# This has to be a separate target due to the windows command line lenght limits
|
||||||
add_custom_command(TARGET ${target} POST_BUILD
|
add_custom_command(TARGET ${target} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}/
|
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}
|
||||||
COMMENT "Copy gmp runtime to build tree"
|
COMMENT "Copy gmp runtime to build tree"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
|
||||||
add_custom_command(TARGET ${target} POST_BUILD
|
add_custom_command(TARGET ${target} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}/
|
COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}
|
||||||
COMMENT "Copy mpfr runtime to build tree"
|
COMMENT "Copy mpfr runtime to build tree"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
|
||||||
|
@ -1774,7 +1774,7 @@ namespace ProcessLayer
|
|||||||
const CustomGCode::Item *custom_gcode,
|
const CustomGCode::Item *custom_gcode,
|
||||||
// ID of the first extruder printing this layer.
|
// ID of the first extruder printing this layer.
|
||||||
unsigned int first_extruder_id,
|
unsigned int first_extruder_id,
|
||||||
bool single_material_print)
|
bool single_extruder_printer)
|
||||||
{
|
{
|
||||||
std::string gcode;
|
std::string gcode;
|
||||||
|
|
||||||
@ -1783,30 +1783,38 @@ namespace ProcessLayer
|
|||||||
assert(custom_gcode->gcode != ToolChangeCode);
|
assert(custom_gcode->gcode != ToolChangeCode);
|
||||||
|
|
||||||
const std::string &custom_code = custom_gcode->gcode;
|
const std::string &custom_code = custom_gcode->gcode;
|
||||||
|
bool color_change = custom_code == ColorChangeCode;
|
||||||
|
bool tool_change = custom_code == ToolChangeCode;
|
||||||
|
// Tool Change is applied as Color Change for a single extruder printer only.
|
||||||
|
assert(! tool_change || single_extruder_printer);
|
||||||
|
|
||||||
std::string pause_print_msg;
|
std::string pause_print_msg;
|
||||||
int m600_extruder_before_layer = -1;
|
int m600_extruder_before_layer = -1;
|
||||||
if (custom_code == ColorChangeCode && custom_gcode->extruder > 0)
|
if (color_change && custom_gcode->extruder > 0)
|
||||||
m600_extruder_before_layer = custom_gcode->extruder - 1;
|
m600_extruder_before_layer = custom_gcode->extruder - 1;
|
||||||
else if (custom_code == PausePrintCode)
|
else if (custom_code == PausePrintCode)
|
||||||
pause_print_msg = custom_gcode->color;
|
pause_print_msg = custom_gcode->color;
|
||||||
|
|
||||||
// we should add or not colorprint_change in respect to nozzle_diameter count instead of really used extruders count
|
// we should add or not colorprint_change in respect to nozzle_diameter count instead of really used extruders count
|
||||||
if (custom_code == ColorChangeCode) // color change
|
if (color_change || tool_change)
|
||||||
{
|
{
|
||||||
|
// Color Change or Tool Change as Color Change.
|
||||||
// add tag for analyzer
|
// add tag for analyzer
|
||||||
gcode += "; " + GCodeAnalyzer::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
|
gcode += "; " + GCodeAnalyzer::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
|
||||||
// add tag for time estimator
|
// add tag for time estimator
|
||||||
gcode += "; " + GCodeTimeEstimator::Color_Change_Tag + "\n";
|
gcode += "; " + GCodeTimeEstimator::Color_Change_Tag + "\n";
|
||||||
|
|
||||||
if (!single_material_print && m600_extruder_before_layer >= 0 && first_extruder_id != m600_extruder_before_layer
|
if (!single_extruder_printer && m600_extruder_before_layer >= 0 && first_extruder_id != m600_extruder_before_layer
|
||||||
// && !MMU1
|
// && !MMU1
|
||||||
) {
|
) {
|
||||||
//! FIXME_in_fw show message during print pause
|
//! FIXME_in_fw show message during print pause
|
||||||
gcode += "M601\n"; // pause print
|
gcode += "M601\n"; // pause print
|
||||||
gcode += "M117 Change filament for Extruder " + std::to_string(m600_extruder_before_layer) + "\n";
|
gcode += "M117 Change filament for Extruder " + std::to_string(m600_extruder_before_layer) + "\n";
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
gcode += custom_code + "\n";
|
gcode += ColorChangeCode;
|
||||||
|
gcode += "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -130,7 +130,8 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
|
|||||||
// Do it only if all the objects were configured to be printed with a single extruder.
|
// Do it only if all the objects were configured to be printed with a single extruder.
|
||||||
std::vector<std::pair<double, unsigned int>> per_layer_extruder_switches;
|
std::vector<std::pair<double, unsigned int>> per_layer_extruder_switches;
|
||||||
if (auto num_extruders = unsigned(print.config().nozzle_diameter.size());
|
if (auto num_extruders = unsigned(print.config().nozzle_diameter.size());
|
||||||
num_extruders > 1 && print.object_extruders().size() == 1) {
|
num_extruders > 1 && print.object_extruders().size() == 1 && // the current Print's configuration is CustomGCode::MultiAsSingle
|
||||||
|
print.model().custom_gcode_per_print_z.mode == CustomGCode::MultiAsSingle) {
|
||||||
// Printing a single extruder platter on a printer with more than 1 extruder (or single-extruder multi-material).
|
// Printing a single extruder platter on a printer with more than 1 extruder (or single-extruder multi-material).
|
||||||
// There may be custom per-layer tool changes available at the model.
|
// There may be custom per-layer tool changes available at the model.
|
||||||
per_layer_extruder_switches = custom_tool_changes(print.model().custom_gcode_per_print_z, num_extruders);
|
per_layer_extruder_switches = custom_tool_changes(print.model().custom_gcode_per_print_z, num_extruders);
|
||||||
@ -466,11 +467,19 @@ void ToolOrdering::assign_custom_gcodes(const Print &print)
|
|||||||
if (custom_gcode_per_print_z.gcodes.empty())
|
if (custom_gcode_per_print_z.gcodes.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unsigned int num_extruders = *std::max_element(m_all_printing_extruders.begin(), m_all_printing_extruders.end()) + 1;
|
auto num_extruders = unsigned(print.config().nozzle_diameter.size());
|
||||||
|
CustomGCode::Mode mode =
|
||||||
|
(num_extruders == 1) ? CustomGCode::SingleExtruder :
|
||||||
|
print.object_extruders().size() == 1 ? CustomGCode::MultiAsSingle : CustomGCode::MultiExtruder;
|
||||||
|
CustomGCode::Mode model_mode = print.model().custom_gcode_per_print_z.mode;
|
||||||
std::vector<unsigned char> extruder_printing_above(num_extruders, false);
|
std::vector<unsigned char> extruder_printing_above(num_extruders, false);
|
||||||
auto custom_gcode_it = custom_gcode_per_print_z.gcodes.rbegin();
|
auto custom_gcode_it = custom_gcode_per_print_z.gcodes.rbegin();
|
||||||
|
// Tool changes and color changes will be ignored, if the model's tool/color changes were entered in mm mode and the print is in non mm mode
|
||||||
|
// or vice versa.
|
||||||
|
bool ignore_tool_and_color_changes = (mode == CustomGCode::MultiExtruder) != (model_mode == CustomGCode::MultiExtruder);
|
||||||
// If printing on a single extruder machine, make the tool changes trigger color change (M600) events.
|
// If printing on a single extruder machine, make the tool changes trigger color change (M600) events.
|
||||||
bool tool_changes_as_color_changes = num_extruders == 1;
|
bool tool_changes_as_color_changes = mode == CustomGCode::SingleExtruder && model_mode == CustomGCode::MultiAsSingle;
|
||||||
|
|
||||||
// From the last layer to the first one:
|
// From the last layer to the first one:
|
||||||
for (auto it_lt = m_layer_tools.rbegin(); it_lt != m_layer_tools.rend(); ++ it_lt) {
|
for (auto it_lt = m_layer_tools.rbegin(); it_lt != m_layer_tools.rend(); ++ it_lt) {
|
||||||
LayerTools < = *it_lt;
|
LayerTools < = *it_lt;
|
||||||
@ -490,9 +499,16 @@ void ToolOrdering::assign_custom_gcodes(const Print &print)
|
|||||||
print_z_below = it_lt_below->print_z;
|
print_z_below = it_lt_below->print_z;
|
||||||
if (custom_gcode.print_z > print_z_below + 0.5 * EPSILON) {
|
if (custom_gcode.print_z > print_z_below + 0.5 * EPSILON) {
|
||||||
// The custom G-code applies to the current layer.
|
// The custom G-code applies to the current layer.
|
||||||
if ( tool_changes_as_color_changes || custom_gcode.gcode != ColorChangeCode ||
|
bool color_change = custom_gcode.gcode == ColorChangeCode;
|
||||||
(custom_gcode.extruder <= int(num_extruders) && extruder_printing_above[unsigned(custom_gcode.extruder - 1)]))
|
bool tool_change = custom_gcode.gcode == ToolChangeCode;
|
||||||
|
bool pause_or_custom_gcode = ! color_change && ! tool_change;
|
||||||
|
bool apply_color_change = ! ignore_tool_and_color_changes &&
|
||||||
// If it is color change, it will actually be useful as the exturder above will print.
|
// If it is color change, it will actually be useful as the exturder above will print.
|
||||||
|
(color_change ?
|
||||||
|
mode == CustomGCode::SingleExtruder ||
|
||||||
|
(custom_gcode.extruder <= int(num_extruders) && extruder_printing_above[unsigned(custom_gcode.extruder - 1)]) :
|
||||||
|
tool_change && tool_changes_as_color_changes);
|
||||||
|
if (pause_or_custom_gcode || apply_color_change)
|
||||||
lt.custom_gcode = &custom_gcode;
|
lt.custom_gcode = &custom_gcode;
|
||||||
// Consume that custom G-code event.
|
// Consume that custom G-code event.
|
||||||
++ custom_gcode_it;
|
++ custom_gcode_it;
|
||||||
|
@ -709,7 +709,11 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
|||||||
model_object_status.emplace(model_object->id(), ModelObjectStatus::New);
|
model_object_status.emplace(model_object->id(), ModelObjectStatus::New);
|
||||||
} else {
|
} else {
|
||||||
if (m_model.custom_gcode_per_print_z != model.custom_gcode_per_print_z) {
|
if (m_model.custom_gcode_per_print_z != model.custom_gcode_per_print_z) {
|
||||||
update_apply_status(custom_per_printz_gcodes_tool_changes_differ(m_model.custom_gcode_per_print_z.gcodes, model.custom_gcode_per_print_z.gcodes) ?
|
update_apply_status(num_extruders_changed ||
|
||||||
|
// Tool change G-codes are applied as color changes for a single extruder printer, no need to invalidate tool ordering.
|
||||||
|
//FIXME The tool ordering may be invalidated unnecessarily if the custom_gcode_per_print_z.mode is not applicable
|
||||||
|
// to the active print / model state, and then it is reset, so it is being applicable, but empty, thus the effect is the same.
|
||||||
|
(num_extruders > 1 && custom_per_printz_gcodes_tool_changes_differ(m_model.custom_gcode_per_print_z.gcodes, model.custom_gcode_per_print_z.gcodes)) ?
|
||||||
// The Tool Ordering and the Wipe Tower are no more valid.
|
// The Tool Ordering and the Wipe Tower are no more valid.
|
||||||
this->invalidate_steps({ psWipeTower, psGCodeExport }) :
|
this->invalidate_steps({ psWipeTower, psGCodeExport }) :
|
||||||
// There is no change in Tool Changes stored in custom_gcode_per_print_z, therefore there is no need to update Tool Ordering.
|
// There is no change in Tool Changes stored in custom_gcode_per_print_z, therefore there is no need to update Tool Ordering.
|
||||||
|
@ -5100,7 +5100,7 @@ void GLCanvas3D::_render_overlays() const
|
|||||||
|
|
||||||
#if ENABLE_SHOW_SCENE_LABELS
|
#if ENABLE_SHOW_SCENE_LABELS
|
||||||
const ConfigOptionBool* opt = dynamic_cast<const ConfigOptionBool*>(m_config->option("complete_objects"));
|
const ConfigOptionBool* opt = dynamic_cast<const ConfigOptionBool*>(m_config->option("complete_objects"));
|
||||||
bool sequential_print = (opt != nullptr) ? m_config->opt_bool("complete_objects") : false;
|
bool sequential_print = opt != nullptr && opt->value;
|
||||||
std::vector<const ModelInstance*> sorted_instances;
|
std::vector<const ModelInstance*> sorted_instances;
|
||||||
if (sequential_print) {
|
if (sequential_print) {
|
||||||
for (ModelObject* model_object : m_model->objects)
|
for (ModelObject* model_object : m_model->objects)
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
void update_hollowed_mesh(std::unique_ptr<TriangleMesh> &&mesh);
|
void update_hollowed_mesh(std::unique_ptr<TriangleMesh> &&mesh);
|
||||||
|
|
||||||
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
||||||
|
void update_clipping_plane(bool keep_normal = false) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_init() override;
|
bool on_init() override;
|
||||||
@ -96,7 +97,6 @@ private:
|
|||||||
void select_point(int i);
|
void select_point(int i);
|
||||||
void unselect_point(int i);
|
void unselect_point(int i);
|
||||||
void reload_cache();
|
void reload_cache();
|
||||||
void update_clipping_plane(bool keep_normal = false) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_set_state() override;
|
void on_set_state() override;
|
||||||
|
@ -80,6 +80,7 @@ public:
|
|||||||
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
||||||
bool has_backend_supports() const;
|
bool has_backend_supports() const;
|
||||||
void reslice_SLA_supports(bool postpone_error_messages = false) const;
|
void reslice_SLA_supports(bool postpone_error_messages = false) const;
|
||||||
|
void update_clipping_plane(bool keep_normal = false) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_init() override;
|
bool on_init() override;
|
||||||
@ -139,7 +140,6 @@ private:
|
|||||||
void switch_to_editing_mode();
|
void switch_to_editing_mode();
|
||||||
void disable_editing_mode();
|
void disable_editing_mode();
|
||||||
void reset_clipping_plane_normal() const;
|
void reset_clipping_plane_normal() const;
|
||||||
void update_clipping_plane(bool keep_normal = false) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_set_state() override;
|
void on_set_state() override;
|
||||||
|
@ -348,11 +348,22 @@ void GLGizmosManager::set_sla_support_data(ModelObject* model_object)
|
|||||||
if (!m_enabled || m_gizmos.empty())
|
if (!m_enabled || m_gizmos.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Update common data for hollowing and sla support gizmos.
|
auto* gizmo_supports = dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports].get());
|
||||||
m_common_gizmos_data->update_from_backend(m_parent, model_object);
|
auto* gizmo_hollow = dynamic_cast<GLGizmoHollow*>(m_gizmos[Hollow].get());
|
||||||
|
|
||||||
dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports].get())->set_sla_support_data(model_object, m_parent.get_selection());
|
|
||||||
dynamic_cast<GLGizmoHollow*>(m_gizmos[Hollow].get())->set_sla_support_data(model_object, m_parent.get_selection());
|
// Update common data for hollowing and sla support gizmos.
|
||||||
|
if (m_common_gizmos_data->update_from_backend(m_parent, model_object)) {
|
||||||
|
// FIXME: this is a hack to make that the clipping plane is
|
||||||
|
// updated when the update set its position to zero. The clipping
|
||||||
|
// plane itself should be common, including the update_function.
|
||||||
|
// Then update_from_backend could do it itself.
|
||||||
|
gizmo_supports->update_clipping_plane();
|
||||||
|
gizmo_hollow->update_clipping_plane();
|
||||||
|
}
|
||||||
|
|
||||||
|
gizmo_supports->set_sla_support_data(model_object, m_parent.get_selection());
|
||||||
|
gizmo_hollow->set_sla_support_data(model_object, m_parent.get_selection());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the gizmo used the event to do something, false otherwise.
|
// Returns true if the gizmo used the event to do something, false otherwise.
|
||||||
|
@ -1328,6 +1328,7 @@ void Selection::copy_to_clipboard()
|
|||||||
static_cast<DynamicPrintConfig&>(dst_object->config) = static_cast<const DynamicPrintConfig&>(src_object->config);
|
static_cast<DynamicPrintConfig&>(dst_object->config) = static_cast<const DynamicPrintConfig&>(src_object->config);
|
||||||
dst_object->sla_support_points = src_object->sla_support_points;
|
dst_object->sla_support_points = src_object->sla_support_points;
|
||||||
dst_object->sla_points_status = src_object->sla_points_status;
|
dst_object->sla_points_status = src_object->sla_points_status;
|
||||||
|
dst_object->sla_drain_holes = src_object->sla_drain_holes;
|
||||||
dst_object->layer_config_ranges = src_object->layer_config_ranges; // #ys_FIXME_experiment
|
dst_object->layer_config_ranges = src_object->layer_config_ranges; // #ys_FIXME_experiment
|
||||||
dst_object->layer_height_profile = src_object->layer_height_profile;
|
dst_object->layer_height_profile = src_object->layer_height_profile;
|
||||||
dst_object->origin_translation = src_object->origin_translation;
|
dst_object->origin_translation = src_object->origin_translation;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user