[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41746] trunk/blender/release/scripts/ startup/bl_ui/properties_physics_dynamicpaint.py: Dynamic Paint UI:

Thomas Dinges blender at dingto.org
Thu Nov 10 21:31:53 CET 2011


Revision: 41746
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41746
Author:   dingto
Date:     2011-11-10 20:31:50 +0000 (Thu, 10 Nov 2011)
Log Message:
-----------
Dynamic Paint UI:
* Code cleanup, changed some splits to row's, much nicer when you only use 2 properties in a row.
* if > elif
* Removed some duplicated code for an if/elif/else check

Did some minor separator() changes too. 

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-11-10 19:10:23 UTC (rev 41745)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-11-10 20:31:50 UTC (rev 41746)
@@ -54,8 +54,9 @@
                 layout.operator("dpaint.type_toggle", text="Add Canvas").type = 'CANVAS'
             else:
                 layout.operator("dpaint.type_toggle", text="Remove Canvas", icon='X').type = 'CANVAS'
-
+                
                 surface = canvas.canvas_surfaces.active
+
                 row = layout.row()
                 row.template_list(canvas, "canvas_surfaces", canvas.canvas_surfaces, "active_index", rows=2)
 
@@ -65,9 +66,9 @@
                 
                 if surface:
                     layout.prop(surface, "name")
-                    layout.prop(surface, "surface_format", expand=False)
-                    col = layout.column()
+                    layout.prop(surface, "surface_format")
                     
+                    col = layout.column()
                     if surface.surface_format != "VERTEX":
                         col.label(text="Quality:")
                         col.prop(surface, "image_resolution")
@@ -81,8 +82,7 @@
                     col.prop(surface, "frame_start", text="Start")
                     col.prop(surface, "frame_end", text="End")
                 
-                    col = split.column()
-                    col.prop(surface, "frame_substeps")
+                    split.prop(surface, "frame_substeps")
 
         elif (md.ui_type == "BRUSH"):
             brush = md.brush_settings
@@ -128,47 +128,39 @@
         surface = canvas.canvas_surfaces.active
         ob = context.object
 
-        layout.prop(surface, "surface_type", expand=False)
+        layout.prop(surface, "surface_type")
         layout.separator()
 
         # dissolve
         if (surface.surface_type == "PAINT"):
             split = layout.split(percentage=0.35)
+            split.label(text="Wetmap drying:")
+            
             col = split.column()
-            col.label(text="Wetmap drying:")
-            col = split.column()
             split = col.split(percentage=0.7)
-            col = split.column()
-            col.prop(surface, "dry_speed", text="Time")
-            col = split.column()
-            col.prop(surface, "use_dry_log", text="Slow")
+            split.prop(surface, "dry_speed", text="Time")
+            split.prop(surface, "use_dry_log", text="Slow")
             
         if (surface.surface_type != "WAVE"):
             split = layout.split(percentage=0.35)
             col = split.column()
-            if (surface.surface_type == "DISPLACE"):
-                col.prop(surface, "use_dissolve", text="Dissolve:")
-            elif (surface.surface_type == "WEIGHT"):
+            if (surface.surface_type == "WEIGHT"):
                 col.prop(surface, "use_dissolve", text="Fade:")
             else:
                 col.prop(surface, "use_dissolve", text="Dissolve:")
             col = split.column()
             col.active = surface.use_dissolve
             split = col.split(percentage=0.7)
-            col = split.column()
-            col.prop(surface, "dissolve_speed", text="Time")
-            col = split.column()
-            col.prop(surface, "use_dissolve_log", text="Slow")
+            split.prop(surface, "dissolve_speed", text="Time")
+            split.prop(surface, "use_dissolve_log", text="Slow")
         
         # per type settings
         if (surface.surface_type == "DISPLACE"):
             layout.prop(surface, "use_incremental_displace")
             if (surface.surface_format == "VERTEX"):
-                split = layout.split()
-                col = split.column()
-                col.prop(surface, "depth_clamp")
-                col = split.column()
-                col.prop(surface, "displace_factor")
+                row = layout.row()
+                row.prop(surface, "depth_clamp")
+                row.prop(surface, "displace_factor")
             
         if (surface.surface_type == "WAVE"):
             layout.prop(surface, "wave_open_borders")
@@ -214,58 +206,54 @@
                 # paintmap output
                 row = layout.row()
                 row.prop_search(surface, "output_name", ob.data, "vertex_colors", text="Paintmap layer: ")
-                ic = 'ZOOMIN'
                 if (surface.output_exists(object=ob, index=0)):
                     ic = 'ZOOMOUT'
-                col = row.column(align=True)
-                col.operator("dpaint.output_toggle", icon=ic, text="").index = 0
+                else:
+                    ic = 'ZOOMIN'
                 
+                row.operator("dpaint.output_toggle", icon=ic, text="").index = 0
+                
                 # wetmap output
                 row = layout.row()
                 row.prop_search(surface, "output_name2", ob.data, "vertex_colors", text="Wetmap layer: ")
-                ic = 'ZOOMIN'
                 if (surface.output_exists(object=ob, index=1)):
                     ic = 'ZOOMOUT'
-                col = row.column(align=True)
-                col.operator("dpaint.output_toggle", icon=ic, text="").index = 1
-            if (surface.surface_type == "WEIGHT"):
+                else:
+                    ic = 'ZOOMIN'
+ 
+                row.operator("dpaint.output_toggle", icon=ic, text="").index = 1
+                
+            elif (surface.surface_type == "WEIGHT"):
                 row = layout.row()
                 row.prop_search(surface, "output_name", ob, "vertex_groups", text="Vertex Group: ")
-                ic = 'ZOOMIN'
                 if (surface.output_exists(object=ob, index=0)):
                     ic = 'ZOOMOUT'
-                col = row.column(align=True)
-                col.operator("dpaint.output_toggle", icon=ic, text="").index = 0
+                else:
+                    ic = 'ZOOMIN'
 
+                row.operator("dpaint.output_toggle", icon=ic, text="").index = 0
+
         # image format outputs
         if (surface.surface_format == "IMAGE"):
-            col = layout.column()
-            col.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
-            col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="UV layer:")
+            layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
+            layout.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="UV layer:")
             layout.separator()
             
-            col.separator()
-            col = layout.column()
-            col.prop(surface, "image_output_path", text="")
-            split = layout.split()
-            col = split.column()
-            col.prop(surface, "image_fileformat", text="")
-            col = split.column()
-            col.prop(surface, "premultiply", text="Premultiply alpha")
-            col.separator()
+            layout.prop(surface, "image_output_path", text="")
+            row = layout.row()
+            row.prop(surface, "image_fileformat", text="")
+            row.prop(surface, "premultiply", text="Premultiply alpha")
             
             if (surface.surface_type == "PAINT"):
                 split = layout.split(percentage=0.4)
-                col = split.column()
-                col.prop(surface, "do_output1", text="Paintmaps:")
-                sub = split.column()
+                split.prop(surface, "do_output1", text="Paintmaps:")
+                sub = split.row()
                 sub.active = surface.do_output1
                 sub.prop(surface, "output_name", text="")
                 
                 split = layout.split(percentage=0.4)
-                col = split.column()
-                col.prop(surface, "do_output2", text="Wetmaps:")
-                sub = split.column()
+                split.prop(surface, "do_output2", text="Wetmaps:")
+                sub = split.row()
                 sub.active = surface.do_output2
                 sub.prop(surface, "output_name2", text="")
             else:
@@ -274,7 +262,7 @@
                 if (surface.surface_type == "DISPLACE"):
                     col.prop(surface, "displace_type", text="Displace Type")
                     col.prop(surface, "depth_clamp")
-                if (surface.surface_type == "WAVE"):
+                elif (surface.surface_type == "WAVE"):
                     col.prop(surface, "depth_clamp", text="Wave Clamp")
 
 class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel):
@@ -303,11 +291,11 @@
         if (surface.init_color_type == "COLOR"):
             layout.prop(surface, "init_color")
             
-        if (surface.init_color_type == "TEXTURE"):
+        elif (surface.init_color_type == "TEXTURE"):
             layout.prop(surface, "init_texture")
             layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:")
         
-        if (surface.init_color_type == "VERTEX_COLOR"):
+        elif (surface.init_color_type == "VERTEX_COLOR"):
             layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ")
 
 class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
@@ -332,33 +320,30 @@
 
         if surface.effect_ui == "SPREAD":
             layout.prop(surface, "use_spread")
-            col = layout.column()
-            col.active = surface.use_spread
-            split = col.split()
-            sub = split.column()
-            sub.prop(surface, "spread_speed")
-            sub = split.column()
-            sub.prop(surface, "color_spread_speed")
+            
+            row = layout.row()
+            row.active = surface.use_spread
+            row.prop(surface, "spread_speed")
+            row.prop(surface, "color_spread_speed")
 
         elif surface.effect_ui == "DRIP":
             layout.prop(surface, "use_drip")
+            
             col = layout.column()
             col.active = surface.use_drip
             effector_weights_ui(self, context, surface.effector_weights)
-            split = layout.split()
 
             layout.label(text="Surface Movement:")
-            split = layout.split()
-            col = split.column()

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list