mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 12:11:15 -06:00 
			
		
		
		
	Performance improvements in reloading the 3D scene.
Now the 3D scene loading is postponed until the page is visible.
This commit is contained in:
		
							parent
							
								
									556f40bf00
								
							
						
					
					
						commit
						ee5ee5f432
					
				
					 4 changed files with 57 additions and 40 deletions
				
			
		|  | @ -100,11 +100,18 @@ sub set_on_model_update { | |||
| } | ||||
| 
 | ||||
| sub reload_scene { | ||||
|     my ($self) = @_; | ||||
|     my ($self, $force) = @_; | ||||
| 
 | ||||
|     $self->reset_objects; | ||||
|     $self->update_bed_size; | ||||
|      | ||||
| 
 | ||||
|     if (! $self->IsShown && ! $force) { | ||||
|         $self->{reload_delayed} = 1; | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     $self->{reload_delayed} = 0; | ||||
| 
 | ||||
|     foreach my $obj_idx (0..$#{$self->{model}->objects}) { | ||||
|         my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx); | ||||
|         if ($self->{objects}[$obj_idx]->selected) { | ||||
|  | @ -133,4 +140,10 @@ sub update_bed_size { | |||
|     $self->set_bed_shape($self->{config}->bed_shape); | ||||
| } | ||||
| 
 | ||||
| 1; | ||||
| # Called by the Platter wxNotebook when this page is activated. | ||||
| sub OnActivate { | ||||
|     my ($self) = @_; | ||||
|     $self->reload_scene(1) if ($self->{reload_delayed}); | ||||
| } | ||||
| 
 | ||||
| 1; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv