From ae1a015494b0ac1d50f7931b71f09ba560e3a984 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 11 May 2018 16:03:07 +0200 Subject: [PATCH] Fixed Perl array addressing issues, leading to crashes when loading additional objects at the 3D path preview window. --- lib/Slic3r/GUI/Plater/3D.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/GUI/Plater/3D.pm b/lib/Slic3r/GUI/Plater/3D.pm index ced6fb82e..c9c954276 100644 --- a/lib/Slic3r/GUI/Plater/3D.pm +++ b/lib/Slic3r/GUI/Plater/3D.pm @@ -32,7 +32,7 @@ sub new { $self->{on_instances_moved} = sub {}; $self->{on_wipe_tower_moved} = sub {}; - $self->{objects_volumes_idxs} = (); + $self->{objects_volumes_idxs} = []; $self->on_select(sub { my ($volume_idx) = @_; @@ -188,8 +188,8 @@ sub update_volumes_selection { foreach my $obj_idx (0..$#{$self->{model}->objects}) { if ($self->{objects}[$obj_idx]->selected) { - my @volume_idxs = @{$self->{objects_volumes_idxs}[$obj_idx]}; - $self->select_volume($_) for @volume_idxs; + my $volume_idxs = $self->{objects_volumes_idxs}->[$obj_idx]; + $self->select_volume($_) for @{$volume_idxs}; } } } @@ -207,7 +207,7 @@ sub reload_scene { $self->{reload_delayed} = 0; - $self->{objects_volumes_idxs} = (); + $self->{objects_volumes_idxs} = []; foreach my $obj_idx (0..$#{$self->{model}->objects}) { my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx); push(@{$self->{objects_volumes_idxs}}, \@volume_idxs);