[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21466] branches/blender2.5/blender: 2.5: Buttons Window
Brecht Van Lommel
brecht at blender.org
Thu Jul 9 21:45:27 CEST 2009
Revision: 21466
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21466
Author: blendix
Date: 2009-07-09 21:45:27 +0200 (Thu, 09 Jul 2009)
Log Message:
-----------
2.5: Buttons Window
* Fix poll() callback changes in recent commit, note that these have
to work with pinned context too.
* Hide header for context panels in py layout.
* Don't jump back when collapsing a panel, allow the view to be
over some empty space until you scroll back.
* Fix follow context icon, order had to be reversed in icon file.
* ID template now has icon as part of browse button instead of
outside the buttons.
Modified Paths:
--------------
branches/blender2.5/blender/release/ui/buttons_data_armature.py
branches/blender2.5/blender/release/ui/buttons_data_bone.py
branches/blender2.5/blender/release/ui/buttons_data_camera.py
branches/blender2.5/blender/release/ui/buttons_data_curve.py
branches/blender2.5/blender/release/ui/buttons_data_lamp.py
branches/blender2.5/blender/release/ui/buttons_data_lattice.py
branches/blender2.5/blender/release/ui/buttons_data_mesh.py
branches/blender2.5/blender/release/ui/buttons_data_text.py
branches/blender2.5/blender/release/ui/buttons_material.py
branches/blender2.5/blender/release/ui/buttons_objects.py
branches/blender2.5/blender/release/ui/buttons_texture.py
branches/blender2.5/blender/release/ui/buttons_world.py
branches/blender2.5/blender/source/blender/editors/datafiles/blenderbuttons.c
branches/blender2.5/blender/source/blender/editors/interface/interface_layout.c
branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c
branches/blender2.5/blender/source/blender/editors/interface/interface_templates.c
branches/blender2.5/blender/source/blender/editors/screen/area.c
branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c
branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_ops.c
Modified: branches/blender2.5/blender/release/ui/buttons_data_armature.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_armature.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_armature.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -11,11 +11,8 @@
class DATA_PT_context_arm(DataButtonsPanel):
__idname__ = "DATA_PT_context_arm"
- __label__ = " "
+ __no_header__ = True
- def poll(self, context):
- return ((context.object and context.object.type == 'ARMATURE') or context.armature)
-
def draw(self, context):
layout = self.layout
@@ -36,9 +33,6 @@
__idname__ = "DATA_PT_skeleton"
__label__ = "Skeleton"
- def poll(self, context):
- return ((context.object and context.object.type == 'ARMATURE') or context.armature)
-
def draw(self, context):
layout = self.layout
Modified: branches/blender2.5/blender/release/ui/buttons_data_bone.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -11,7 +11,7 @@
class BONE_PT_context_bone(BoneButtonsPanel):
__idname__ = "BONE_PT_context_bone"
- __label__ = " "
+ __no_header__ = True
def draw(self, context):
layout = self.layout
Modified: branches/blender2.5/blender/release/ui/buttons_data_camera.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_camera.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_camera.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -11,11 +11,8 @@
class DATA_PT_context_camera(DataButtonsPanel):
__idname__ = "DATA_PT_context_camera"
- __label__ = " "
+ __no_header__ = True
- def poll(self, context):
- return (context.object.type == 'CAMERA')
-
def draw(self, context):
layout = self.layout
@@ -28,7 +25,7 @@
if ob:
split.template_ID(ob, "data")
split.itemS()
- elif arm:
+ elif cam:
split.template_ID(space, "pin_id")
split.itemS()
@@ -97,3 +94,4 @@
bpy.types.register(DATA_PT_context_camera)
bpy.types.register(DATA_PT_camera)
bpy.types.register(DATA_PT_camera_display)
+
Modified: branches/blender2.5/blender/release/ui/buttons_data_curve.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_curve.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_curve.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -9,14 +9,10 @@
def poll(self, context):
return (context.object and context.object.type == 'CURVE' and context.curve)
-
class DATA_PT_context_curve(DataButtonsPanel):
__idname__ = "DATA_PT_context_curve"
- __label__ = " "
+ __no_header__ = True
- def poll(self, context):
- return (context.object and context.object.type == 'CURVE')
-
def draw(self, context):
layout = self.layout
@@ -38,9 +34,6 @@
__idname__ = "DATA_PT_shape_curve"
__label__ = "Shape"
- def poll(self, context):
- return (context.object and context.object.type == 'CURVE')
-
def draw(self, context):
layout = self.layout
@@ -48,8 +41,6 @@
curve = context.curve
space = context.space_data
-
-
if curve:
layout.itemR(curve, "curve_2d")
@@ -163,3 +154,4 @@
bpy.types.register(DATA_PT_geometry_curve)
bpy.types.register(DATA_PT_pathanim)
bpy.types.register(DATA_PT_current_curve)
+
Modified: branches/blender2.5/blender/release/ui/buttons_data_lamp.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lamp.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_lamp.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -21,11 +21,8 @@
class DATA_PT_context_lamp(DataButtonsPanel):
__idname__ = "DATA_PT_context_lamp"
- __label__ = " "
+ __no_header__ = True
- def poll(self, context):
- return (context.object.type == 'LAMP')
-
def draw(self, context):
layout = self.layout
@@ -258,3 +255,4 @@
bpy.types.register(DATA_PT_sunsky)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_falloff_curve)
+
Modified: branches/blender2.5/blender/release/ui/buttons_data_lattice.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lattice.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_lattice.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -11,11 +11,8 @@
class DATA_PT_context_lattice(DataButtonsPanel):
__idname__ = "DATA_PT_context_lattice"
- __label__ = " "
+ __no_header__ = True
- def poll(self, context):
- return (context.object and context.object.type == 'LATTICE')
-
def draw(self, context):
layout = self.layout
@@ -60,3 +57,4 @@
bpy.types.register(DATA_PT_context_lattice)
bpy.types.register(DATA_PT_lattice)
+
Modified: branches/blender2.5/blender/release/ui/buttons_data_mesh.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -11,11 +11,8 @@
class DATA_PT_context_mesh(DataButtonsPanel):
__idname__ = "DATA_PT_context_mesh"
- __label__ = " "
+ __no_header__ = True
- def poll(self, context):
- return (context.object and context.object.type == 'MESH')
-
def draw(self, context):
layout = self.layout
@@ -218,3 +215,4 @@
bpy.types.register(DATA_PT_shape_keys)
bpy.types.register(DATA_PT_uv_texture)
bpy.types.register(DATA_PT_vertex_colors)
+
Modified: branches/blender2.5/blender/release/ui/buttons_data_text.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_text.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_data_text.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -8,14 +8,10 @@
def poll(self, context):
return (context.object and context.object.type == 'TEXT' and context.curve)
-
+
class DATA_PT_context_text(DataButtonsPanel):
__idname__ = "DATA_PT_context_text"
- __label__ = " "
-
- def poll(self, context):
- ob = context.object
- return (context.object and context.object.type == 'TEXT')
+ __no_header__ = True
def draw(self, context):
layout = self.layout
@@ -33,7 +29,6 @@
split.template_ID(space, "pin_id")
split.itemS()
-
class DATA_PT_shape_text(DataButtonsPanel):
__idname__ = "DATA_PT_shape_text"
__label__ = "Shape Text"
@@ -163,3 +158,4 @@
bpy.types.register(DATA_PT_font)
bpy.types.register(DATA_PT_paragraph)
#bpy.types.register(DATA_PT_textboxes)
+
Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_material.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -21,7 +21,7 @@
class MATERIAL_PT_context_material(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_context_material"
- __label__ = " "
+ __no_header__ = True
def poll(self, context):
return (context.object)
@@ -34,13 +34,14 @@
slot = context.material_slot
space = context.space_data
- row = layout.row()
+ if ob:
+ row = layout.row()
- row.template_list(ob, "materials", ob, "active_material_index")
+ row.template_list(ob, "materials", ob, "active_material_index")
- col = row.column(align=True)
- col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="")
- col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="")
+ col = row.column(align=True)
+ col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="")
split = layout.split(percentage=0.65)
@@ -188,11 +189,9 @@
split.active = mat.shadeless== False
sub = split.column()
if mat.diffuse_shader == 'OREN_NAYAR':
- sub.itemR(mat, "roughness")
- sub = split.column()
+ sub.itemR(mat, "roughness")
if mat.diffuse_shader == 'MINNAERT':
sub.itemR(mat, "darkness")
- sub = split.column()
if mat.diffuse_shader == 'TOON':
sub.itemR(mat, "diffuse_toon_size", text="Size")
sub = split.column()
@@ -232,13 +231,13 @@
sub = split.column()
if mat.spec_shader in ('COOKTORR', 'PHONG'):
sub.itemR(mat, "specular_hardness", text="Hardness")
- sub = split.column()
if mat.spec_shader == 'BLINN':
sub.itemR(mat, "specular_hardness", text="Hardness")
sub = split.column()
sub.itemR(mat, "specular_ior", text="IOR")
if mat.spec_shader == 'WARDISO':
sub.itemR(mat, "specular_slope", text="Slope")
+ sub = split.column()
sub.itemR(mat, "specular_hardness", text="Hardness")
if mat.spec_shader == 'TOON':
sub.itemR(mat, "specular_toon_size", text="Size")
Modified: branches/blender2.5/blender/release/ui/buttons_objects.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_objects.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_objects.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -8,7 +8,7 @@
class OBJECT_PT_context_object(ObjectButtonsPanel):
__idname__ = "OBJECT_PT_context_object"
- __label__ = " "
+ __no_header__ = True
def draw(self, context):
layout = self.layout
@@ -141,4 +141,4 @@
bpy.types.register(OBJECT_PT_groups)
bpy.types.register(OBJECT_PT_display)
bpy.types.register(OBJECT_PT_duplication)
-bpy.types.register(OBJECT_PT_animation)
\ No newline at end of file
+bpy.types.register(OBJECT_PT_animation)
Modified: branches/blender2.5/blender/release/ui/buttons_texture.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_texture.py 2009-07-09 18:10:35 UTC (rev 21465)
+++ branches/blender2.5/blender/release/ui/buttons_texture.py 2009-07-09 19:45:27 UTC (rev 21466)
@@ -21,7 +21,7 @@
class TEXTURE_PT_context_texture(TextureButtonsPanel):
__idname__= "TEXTURE_PT_context_texture"
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list