Assorted UI tweaks/cleanups
authorMatt Ebb <matt@mke3.net>
Wed, 20 May 2009 13:56:22 +0000 (13:56 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 20 May 2009 13:56:22 +0000 (13:56 +0000)
release/ui/buttons_data_armature.py
release/ui/buttons_data_camera.py
release/ui/buttons_scene.py
release/ui/buttons_world.py
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_widgets.c
source/blender/makesrna/intern/rna_world.c

index 5a54b4dcc8e604d0aabfd1cb042a761aaf4d7c33..2982ad52a6d0a8353ba67e59f7fb249a3cd12e4b 100644 (file)
@@ -14,7 +14,7 @@ class DATA_PT_skeleton(DataButtonsPanel):
        __label__ = "Skeleton"
 
        def draw(self, context):
-               arm = context.main.armatures[0]
+               arm = context.active_object.data
                layout = self.layout
                
                row = layout.row()
@@ -44,7 +44,7 @@ class DATA_PT_display(DataButtonsPanel):
        __label__ = "Display"
        
        def draw(self, context):
-               arm = context.main.armatures[0]
+               arm = context.active_object.data
                layout = self.layout
 
                split = layout.split()
@@ -65,7 +65,7 @@ class DATA_PT_paths(DataButtonsPanel):
        __label__ = "Paths"
 
        def draw(self, context):
-               arm = context.main.armatures[0]
+               arm = context.active_object.data
                layout = self.layout
 
                split = layout.split()
@@ -95,7 +95,7 @@ class DATA_PT_ghost(DataButtonsPanel):
        __label__ = "Ghost"
 
        def draw(self, context):
-               arm = context.main.armatures[0]
+               arm = context.active_object.data
                layout = self.layout
 
                split = layout.split()
index 3bca07c319de9cce86599e588836f3b0895a1724..bb87bdf3d068826c46f4f9ca0d9e4518b5d0dc2d 100644 (file)
@@ -72,7 +72,7 @@ class DATA_PT_cameradisplay(DataButtonsPanel):
                sub = split.column()
                sub.itemR(cam, "show_passepartout", text="Passepartout")
                if (cam.show_passepartout):
-                       sub.itemR(cam, "passepartout_alpha", text="Alpha")
+                       sub.itemR(cam, "passepartout_alpha", text="Alpha", slider="True")
                sub.itemR(cam, "draw_size", text="Size")
                
 bpy.types.register(DATA_PT_cameralens)
index bc9813eb1663d2c515691863ac9859fbef6a652d..b5cba23f989c34091b4cd11137691c918785a417 100644 (file)
@@ -103,23 +103,9 @@ class RENDER_PT_render(RenderButtonsPanel):
                rd = scene.render_data
 
                row = layout.row()
-               row.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE
-               row.item_booleanO("SCREEN_OT_render", "anim", True, text="ANIM", icon=0)
+               row.itemO("SCREEN_OT_render", text="Render Still")
+               row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation")
                
-               split = layout.split()
-               
-               sub = split.column(align=True)
-               sub.itemR(scene, "start_frame", text="Start")
-               sub.itemR(scene, "end_frame", text="End")
-               
-               sub = split.column(align=True)
-               sub.itemR(rd, "fps")
-               sub.itemR(rd, "fps_base",text="/")
-               
-               sub = split.column(align=True)
-               sub.itemR(scene, "current_frame", text="Frame")
-               sub.itemR(scene, "frame_step", text="Step")
-
                row = layout.row()
                row.itemR(rd, "do_composite")
                row.itemR(rd, "do_sequence")
@@ -156,27 +142,32 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
 
                rd = scene.render_data
                
-               row = layout.row()
-               row.itemL(text="Resolution:")
-               row.itemL(text="Aspect Ratio:")
-               
                split = layout.split()
-
+               
                col = split.column(align=True)
+               col.itemL(text="Resolution:")
                col.itemR(rd, "resolution_x", text="X")
                col.itemR(rd, "resolution_y", text="Y")
                col.itemR(rd, "resolution_percentage", text="")
                
-               col = split.column()
-               sub = col.column(align=True)
-               sub.itemR(rd, "pixel_aspect_x", text="X")
-               sub.itemR(rd, "pixel_aspect_y", text="Y")
+               col.itemL(text="Aspect Ratio:")
+               col.itemR(rd, "pixel_aspect_x", text="X")
+               col.itemR(rd, "pixel_aspect_y", text="Y")
                
-               sub = col.column()
-               sub.itemR(rd, "border", text="Border")
+               col.itemR(rd, "border", text="Border")
                if rd.border:
-                       sub.itemR(rd, "crop_to_border")
+                       col.itemR(rd, "crop_to_border")
 
+               col = split.column(align=True)
+               col.itemL(text="Frame Range:")
+               col.itemR(scene, "start_frame", text="Start")
+               col.itemR(scene, "end_frame", text="End")
+               col.itemR(scene, "frame_step", text="Step")
+               
+               col.itemL(text="Frame Rate:")
+               col.itemR(rd, "fps")
+               col.itemR(rd, "fps_base",text="/")
+               
 bpy.types.register(RENDER_PT_render)
 bpy.types.register(RENDER_PT_dimensions)
 bpy.types.register(RENDER_PT_antialiasing)
index 124c9d3d766131f2ab5d64c44f34353dc69538b8..f8ccf4f329f958f6f4eb7611c6f71e33ff4d46af 100644 (file)
@@ -46,16 +46,15 @@ class WORLD_PT_mist(WorldButtonsPanel):
 
                row = layout.row()
                row.itemR(world.mist, "enabled", text="Enable")
-               if (world.mist.enabled):
-       
-                       flow = layout.column_flow()
-                       flow.itemR(world.mist, "start")
-                       flow.itemR(world.mist, "depth")
-                       flow.itemR(world.mist, "height")
-                       flow.itemR(world.mist, "intensity")
-                       col = layout.column()
-                       col.itemL(text="Fallof:")
-                       col.row().itemR(world.mist, "falloff", expand=True)
+
+               flow = layout.column_flow()
+               flow.itemR(world.mist, "start")
+               flow.itemR(world.mist, "depth")
+               flow.itemR(world.mist, "height")
+               flow.itemR(world.mist, "intensity")
+               col = layout.column()
+               col.itemL(text="Fallof:")
+               col.row().itemR(world.mist, "falloff", expand=True)
                
 class WORLD_PT_stars(WorldButtonsPanel):
        __label__ = "Stars"
@@ -66,13 +65,12 @@ class WORLD_PT_stars(WorldButtonsPanel):
 
                row = layout.row()
                row.itemR(world.stars, "enabled", text="Enable")
-               if (world.stars.enabled):
 
-                       flow = layout.column_flow()
-                       flow.itemR(world.stars, "size")
-                       flow.itemR(world.stars, "min_distance", text="MinDist")
-                       flow.itemR(world.stars, "average_separation", text="StarDist")
-                       flow.itemR(world.stars, "color_randomization", text="Colnoise")
+               flow = layout.column_flow()
+               flow.itemR(world.stars, "size")
+               flow.itemR(world.stars, "min_distance", text="Min. Dist")
+               flow.itemR(world.stars, "average_separation", text="Separation")
+               flow.itemR(world.stars, "color_randomization", text="Random:")
                
 class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
        __label__ = "Ambient Occlusion"
@@ -85,51 +83,49 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
                
                row = layout.row()
                row.itemR(ao, "enabled", text="Enable")
-               if (ao.enabled):
-
+               row = layout.row()
+               row.itemR(ao, "gather_method", expand=True)
+               
+               if ao.gather_method == 'RAYTRACE':
                        row = layout.row()
-                       row.itemR(ao, "gather_method", expand=True)
+                       row.itemR(ao, "samples")
+                       row.itemR(ao, "distance")
                        
-                       if ao.gather_method == 'RAYTRACE':
-                               row = layout.row()
-                               row.itemR(ao, "samples")
-                               row.itemR(ao, "distance")
-                               
-                               row = layout.row()
-                               row.itemR(ao, "sample_method")
-                               if ao.sample_method == 'ADAPTIVE_QMC':
-                                       row = layout.row()
-                                       row.itemR(ao, "threshold")
-                                       row.itemR(ao, "adapt_to_speed")
-                                       
-                               if ao.sample_method == 'CONSTANT_JITTERED':
-                                       row = layout.row()
-                                       row.itemR(ao, "bias")
-                                                       
-                       if ao.gather_method == 'APPROXIMATE':
+                       row = layout.row()
+                       row.itemR(ao, "sample_method")
+                       if ao.sample_method == 'ADAPTIVE_QMC':
                                row = layout.row()
-                               row.itemR(ao, "passes")
-                               row.itemR(ao, "error_tolerance")
+                               row.itemR(ao, "threshold")
+                               row.itemR(ao, "adapt_to_speed")
                                
+                       if ao.sample_method == 'CONSTANT_JITTERED':
                                row = layout.row()
-                               row.itemR(ao, "correction")
-                               row.itemR(ao, "pixel_cache")
-
+                               row.itemR(ao, "bias")
+                                               
+               if ao.gather_method == 'APPROXIMATE':
                        row = layout.row()
-                       row.itemS()
-                               
+                       row.itemR(ao, "passes")
+                       row.itemR(ao, "error_tolerance", text="Error")
+                       
                        row = layout.row()
-                       row.itemR(ao, "falloff")        
-                       row.itemR(ao, "strength")
+                       row.itemR(ao, "correction")
+                       row.itemR(ao, "pixel_cache")
+
+               row = layout.row()
+               row.itemS()
                        
-                       col = layout.column()
-                       col.row().itemR(ao, "blend_mode", expand=True)
-                       col.row().itemR(ao, "color", expand=True)
-                       col.itemR(ao, "energy")
+               row = layout.row()
+               row.itemR(ao, "falloff")        
+               row.itemR(ao, "strength")
+               
+               col = layout.column()
+               col.row().itemR(ao, "blend_mode", expand=True)
+               col.row().itemR(ao, "color", expand=True)
+               col.itemR(ao, "energy")
        
 bpy.types.register(WORLD_PT_world)
+bpy.types.register(WORLD_PT_ambient_occlusion)
 bpy.types.register(WORLD_PT_mist)
 bpy.types.register(WORLD_PT_stars)
-bpy.types.register(WORLD_PT_ambient_occlusion)
 bpy.types.register(WORLD_PT_color_correction)
 
index e937ab0c50ad2b5b3c2ec3aa8500be426322896d..2bcc1a03923fadbb93641504cb47a870083464ed 100644 (file)
@@ -1986,7 +1986,7 @@ void uiBlockEndAlign(uiBlock *block)
 
 int ui_but_can_align(uiBut *but)
 {
-       return !ELEM(but->type, LABEL, ROUNDBOX);
+       return !ELEM3(but->type, LABEL, ROUNDBOX, TOG);
 }
 
 static void ui_block_do_align_but(uiBlock *block, uiBut *first, int nr)
index f789f81e0d3504aa30e9b149551120e9d266a003..34f4d7294ee0ca4f01a7e24b97b3ed6ca681104b 100644 (file)
@@ -90,7 +90,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
        BLI_strncpy(style->name, name, MAX_STYLE_NAME);
        
        style->paneltitle.uifont_id= UIFONT_DEFAULT;
-       style->paneltitle.points= 14;
+       style->paneltitle.points= 13;
        style->paneltitle.shadow= 5;
        style->paneltitle.shadx= 2;
        style->paneltitle.shady= -2;
index 7bc63c5c676480a04e070e9c8039f253ec35f377..18b39518ee673fea087922b849341f76bb9a36c6 100644 (file)
@@ -1378,6 +1378,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
        double value;
        float offs, fac;
        char outline[3];
+       int slideralign;
        
        widget_init(&wtb);
        widget_init(&wtb1);
@@ -1395,10 +1396,12 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
        rect1= *rect;
        
        value= ui_get_but_val(but);
-       fac= (value-but->softmin)*(rect1.xmax - rect1.xmin - 2.0f*offs)/(but->softmax - but->softmin);
+       fac= (value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
        
-       rect1.xmax= rect1.xmin + fac + 2.0f*offs;
-       round_box_edges(&wtb1, roundboxalign, &rect1, offs);
+       rect1.xmax= rect1.xmin + fac + offs;
+       slideralign = roundboxalign;
+       slideralign &= ~(2|4);
+       round_box_edges(&wtb1, slideralign, &rect1, offs);
        
        VECCOPY(outline, wcol->outline);
        VECCOPY(wcol->outline, wcol->item);
index 7a9638af314c6429fe8bdef7f4ea974a960276fe..eb764e4bc2d38b93e28b12951ebd82e770257ea7 100644 (file)
@@ -156,17 +156,15 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "aodist");
-       RNA_def_property_range(prop, 0.001, 5000);
        RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect.");
 
        prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "aodistfac");
-       RNA_def_property_range(prop, 0.00001, 10);
        RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows.");
 
        prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "aoenergy");
-       RNA_def_property_range(prop, 0.01, 3);
+       RNA_def_property_ui_range(prop, 0, 10, 0.1, 3);
        RNA_def_property_ui_text(prop, "Energy", "Global energy scale for ambient occlusion.");
 
        prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
@@ -192,6 +190,7 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
        prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
        RNA_def_property_range(prop, 0, 1);
+       RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
        RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation (for Approximate).");
 
        prop= RNA_def_property(srna, "falloff", PROP_BOOLEAN, PROP_NONE);