Merge branch 'dev' into lm_sla_supports_ui

This commit is contained in:
Lukas Matena 2018-09-17 10:26:38 +02:00
commit 37c222a54f
21 changed files with 301 additions and 44 deletions

View file

@ -608,11 +608,12 @@ sub new {
#$self->{object_info_manifold_warning_icon}->Hide;
$self->{"object_info_manifold_warning_icon_show"} = sub {
if ($self->{object_info_manifold_warning_icon}->IsShown() != $_[0]) {
# this fuction show/hide info_manifold_warning_icon on the c++ side now
Slic3r::GUI::set_show_manifold_warning_icon($_[0]);
my $mode = wxTheApp->{app_config}->get("view_mode");
return if ($mode eq "" || $mode eq "simple");
$self->{object_info_manifold_warning_icon}->Show($_[0]);
$self->Layout
#my $mode = wxTheApp->{app_config}->get("view_mode");
#return if ($mode eq "" || $mode eq "simple");
#$self->{object_info_manifold_warning_icon}->Show($_[0]);
#$self->Layout
}
};
$self->{"object_info_manifold_warning_icon_show"}->(0);
@ -2479,11 +2480,11 @@ sub select_object {
if (defined $obj_idx) {
$self->{objects}->[$obj_idx]->selected(1);
# Select current object in the list on c++ side, if item isn't child
if (!defined $child){
Slic3r::GUI::select_current_object($obj_idx);}
# if (!defined $child){
# Slic3r::GUI::select_current_object($obj_idx);} # all selections in the object list is on c++ side
} else {
# Unselect all objects in the list on c++ side
Slic3r::GUI::unselect_objects();
# Slic3r::GUI::unselect_objects(); # all selections in the object list is on c++ side
}
$self->selection_changed(1);
}

View file

@ -362,13 +362,17 @@ sub on_btn_load {
}
foreach my $object (@{$model->objects}) {
$object->center_around_origin;
foreach my $volume (@{$object->volumes}) {
my $new_volume = $self->{model_object}->add_volume($volume);
$new_volume->set_modifier($is_modifier);
$new_volume->set_name(basename($input_file));
# apply the same translation we applied to the object
$new_volume->mesh->translate(@{$self->{model_object}->origin_translation});
my $delta_x = $self->{model_object}->origin_translation->x - $object->origin_translation->x;
my $delta_y = $self->{model_object}->origin_translation->y - $object->origin_translation->y;
my $delta_z = $self->{model_object}->origin_translation->z - $object->origin_translation->z;
$new_volume->mesh->translate($delta_x, $delta_y, $delta_z);
# set a default extruder value, since user can't add it manually
$new_volume->config->set_ifndef('extruder', 0);