Fix part 1 of [#31840] Quick Explode Bugs related to it's fade option.
Patch by Philipp Oeser (lichtwerk), just did style change (better to not define a value twice, so only affecting the three color components, not the alpha, also using the slice syntax makes things much more compact ;) ), thanks!
This commit is contained in:
		@@ -174,6 +174,7 @@ class QuickExplode(Operator):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if self.style == 'BLEND' and len(mesh_objects) != 2:
 | 
					        if self.style == 'BLEND' and len(mesh_objects) != 2:
 | 
				
			||||||
            self.report({'ERROR'}, "Select two mesh objects")
 | 
					            self.report({'ERROR'}, "Select two mesh objects")
 | 
				
			||||||
 | 
					            self.style = 'EXPLODE'
 | 
				
			||||||
            return {'CANCELLED'}
 | 
					            return {'CANCELLED'}
 | 
				
			||||||
        elif not mesh_objects:
 | 
					        elif not mesh_objects:
 | 
				
			||||||
            self.report({'ERROR'}, "Select at least one mesh object")
 | 
					            self.report({'ERROR'}, "Select at least one mesh object")
 | 
				
			||||||
@@ -241,10 +242,10 @@ class QuickExplode(Operator):
 | 
				
			|||||||
                    if obj == to_obj:
 | 
					                    if obj == to_obj:
 | 
				
			||||||
                        tex_slot.alpha_factor = -1.0
 | 
					                        tex_slot.alpha_factor = -1.0
 | 
				
			||||||
                        elem = tex.color_ramp.elements[1]
 | 
					                        elem = tex.color_ramp.elements[1]
 | 
				
			||||||
                        elem.color = mat.diffuse_color
 | 
					 | 
				
			||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        elem = tex.color_ramp.elements[0]
 | 
					                        elem = tex.color_ramp.elements[0]
 | 
				
			||||||
                        elem.color = mat.diffuse_color
 | 
					                    # Keep already defined alpha!
 | 
				
			||||||
 | 
					                    elem.color[:3] = mat.diffuse_color
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    tex_slot.use_map_color_diffuse = False
 | 
					                    tex_slot.use_map_color_diffuse = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user