mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 20:51:12 -06:00 
			
		
		
		
	Some fixes after the recent Model refactoring
This commit is contained in:
		
							parent
							
								
									65b7d27def
								
							
						
					
					
						commit
						27c73f5983
					
				
					 6 changed files with 37 additions and 9 deletions
				
			
		|  | @ -403,7 +403,7 @@ sub load_model_objects { | |||
|         ); | ||||
|         push @obj_idx, $#{ $self->{objects} }; | ||||
|      | ||||
|         if (!defined $model_object->instances) { | ||||
|         if ($model_object->instances_count == 0) { | ||||
|             # if object has no defined position(s) we need to rearrange everything after loading | ||||
|             $need_arrange = 1; | ||||
|          | ||||
|  |  | |||
|  | @ -104,8 +104,9 @@ sub apply_config { | |||
|     if ($rearrange_regions) { | ||||
|         # the current subdivision of regions does not make sense anymore. | ||||
|         # we need to remove all objects and re-add them | ||||
|         my @model_objects = map $_->model_object, @{$self->objects}; | ||||
|         $self->clear_objects; | ||||
|         $self->add_model_object($_->model_object) for @{$self->objects}; | ||||
|         $self->add_model_object($_) for @model_objects; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | @ -137,7 +138,7 @@ sub add_model_object { | |||
|         $config->apply_dynamic($object_config); | ||||
|          | ||||
|         if (defined $volume->material_id) { | ||||
|             my $material_config = $object->model->get_material($volume->material_id)->config->clone; | ||||
|             my $material_config = $volume->material->config->clone; | ||||
|             $material_config->normalize; | ||||
|             $config->apply_dynamic($material_config); | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci