diff options
author | bubnikv <bubnikv@gmail.com> | 2018-05-11 17:03:07 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-05-11 17:03:07 +0300 |
commit | ae1a015494b0ac1d50f7931b71f09ba560e3a984 (patch) | |
tree | ba1e5c7e6cf7629451de5a3e511f75faf37b02ee | |
parent | 03c6efe0d6f6f237566b26f97b1fb44958b38f40 (diff) |
Fixed Perl array addressing issues, leading to crashes when loading
additional objects at the 3D path preview window.
-rw-r--r-- | lib/Slic3r/GUI/Plater/3D.pm | 8 |
1 files 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); |