[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48086] trunk/blender/release/scripts/ startup/bl_operators/object_quick_effects.py: Fix part 1 of [#31840] Quick Explode Bugs related to it's fade option.

Bastien Montagne montagne29 at wanadoo.fr
Tue Jun 19 18:45:49 CEST 2012


Revision: 48086
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48086
Author:   mont29
Date:     2012-06-19 16:45:48 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------
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!

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/object_quick_effects.py

Modified: trunk/blender/release/scripts/startup/bl_operators/object_quick_effects.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/object_quick_effects.py	2012-06-19 16:26:01 UTC (rev 48085)
+++ trunk/blender/release/scripts/startup/bl_operators/object_quick_effects.py	2012-06-19 16:45:48 UTC (rev 48086)
@@ -174,6 +174,7 @@
 
         if self.style == 'BLEND' and len(mesh_objects) != 2:
             self.report({'ERROR'}, "Select two mesh objects")
+            self.style = 'EXPLODE'
             return {'CANCELLED'}
         elif not mesh_objects:
             self.report({'ERROR'}, "Select at least one mesh object")
@@ -241,10 +242,10 @@
                     if obj == to_obj:
                         tex_slot.alpha_factor = -1.0
                         elem = tex.color_ramp.elements[1]
-                        elem.color = mat.diffuse_color
                     else:
                         elem = tex.color_ramp.elements[0]
-                        elem.color = mat.diffuse_color
+                    # Keep already defined alpha!
+                    elem.color[:3] = mat.diffuse_color
                 else:
                     tex_slot.use_map_color_diffuse = False
 




More information about the Bf-blender-cvs mailing list