diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-21 04:55:20 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-21 04:55:20 +0400 |
commit | 1f4fa869e4877202fd91825f85be748fc3dfe50b (patch) | |
tree | c3fbbaf23568abe2b7c5d15d93ebb778f0ac003b /release | |
parent | 0aebd5f14475ef84b0095de4a8f034170b9aee75 (diff) |
2.5: RNA & UI
* Revert lamp sampling/buffers change. The right enum items should
be defined in RNA, not the layout, so that it works in outliner,
python api too.
* Also changed type popup to radio buttons again, and removed the
icons. This is more consistent, and I don't think it's a good idea
to start using icons for these things, too much clutter.
* Replace Mesh with Normals panel in the mesh buttons.
* Remove Material panel from mesh buttons.
* Added name fields for shape/vgroup/vcol/uv.
* Spacing tweak to Object and Bone names.
* Fix some naming conflicts in RNA, with "name" and "type" properties
being defined twice in the same struct.
* context.scene.tool_settings -> context.tool_settings.
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_data_bone.py | 6 | ||||
-rw-r--r-- | release/ui/buttons_data_lamp.py | 22 | ||||
-rw-r--r-- | release/ui/buttons_data_mesh.py | 82 | ||||
-rw-r--r-- | release/ui/buttons_material.py | 9 | ||||
-rw-r--r-- | release/ui/buttons_objects.py | 7 | ||||
-rw-r--r-- | release/ui/buttons_physics_cloth.py | 1 | ||||
-rw-r--r-- | release/ui/buttons_scene.py | 4 | ||||
-rw-r--r-- | release/ui/space_console.py | 2 | ||||
-rw-r--r-- | release/ui/space_image.py | 10 | ||||
-rw-r--r-- | release/ui/space_view3d.py | 3 | ||||
-rw-r--r-- | release/ui/space_view3d_toolbar.py | 6 |
11 files changed, 68 insertions, 84 deletions
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index fae3d24839c..b31cac15425 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -19,9 +19,9 @@ class BONE_PT_context_bone(BoneButtonsPanel): if not bone: bone = context.edit_bone - split = layout.split(percentage=0.06) - split.itemL(text="", icon="ICON_BONE_DATA") - split.itemR(bone, "name", text="") + row = layout.row() + row.itemL(text="", icon="ICON_BONE_DATA") + row.itemR(bone, "name", text="") class BONE_PT_transform(BoneButtonsPanel): __idname__ = "BONE_PT_transform" diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index aa1b9db8334..2155830e568 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -48,9 +48,7 @@ class DATA_PT_lamp(DataButtonsPanel): lamp = context.lamp - split = layout.split(percentage=0.2) - split.itemL(text="Type:") - split.itemR(lamp, "type", text="") + layout.itemR(lamp, "type", expand=True) split = layout.split() @@ -165,13 +163,8 @@ class DATA_PT_shadow(DataButtonsPanel): def draw(self, context): layout = self.layout lamp = context.lamp - - row = layout.row(align=True) - row.item_enumR(lamp, "shadow_method", 'NOSHADOW') - row.item_enumR(lamp, "shadow_method", 'RAY_SHADOW') - if lamp.type == 'SPOT': - row.item_enumR(lamp, "shadow_method", 'BUFFER_SHADOW') - + + layout.itemR(lamp, "shadow_method", expand=True) if lamp.shadow_method != 'NOSHADOW': @@ -186,12 +179,9 @@ class DATA_PT_shadow(DataButtonsPanel): if lamp.shadow_method == 'RAY_SHADOW': - row = layout.row(align=True) - layout.itemL(text="Sampling:") - row.item_enumR(lamp, "shadow_ray_sampling_method", 'ADAPTIVE_QMC') - row.item_enumR(lamp, "shadow_ray_sampling_method", 'CONSTANT_QMC') - if lamp.type == 'AREA': - row.item_enumR(lamp, "shadow_ray_sampling_method", 'CONSTANT_JITTERED') + col = layout.column() + col.itemL(text="Sampling:") + col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True) if lamp.type in ('POINT', 'SUN', 'SPOT'): flow = layout.column_flow() diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index fba150c48ad..757745d039e 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -29,9 +29,9 @@ class DATA_PT_context_mesh(DataButtonsPanel): split.template_ID(space, "pin_id") split.itemS() -class DATA_PT_mesh(DataButtonsPanel): - __idname__ = "DATA_PT_mesh" - __label__ = "Mesh" +class DATA_PT_normals(DataButtonsPanel): + __idname__ = "DATA_PT_normals" + __label__ = "Normals" def draw(self, context): layout = self.layout @@ -48,48 +48,14 @@ class DATA_PT_mesh(DataButtonsPanel): sub = split.column() sub.itemR(mesh, "vertex_normal_flip") sub.itemR(mesh, "double_sided") - - layout.itemS() - layout.itemR(mesh, "texco_mesh") - -class DATA_PT_materials(DataButtonsPanel): - __idname__ = "DATA_PT_materials" - __label__ = "Materials" - - def poll(self, context): - return (context.object and context.object.type in ('MESH', 'CURVE', 'FONT', 'SURFACE')) - - def draw(self, context): - layout = self.layout - ob = context.object - - row = layout.row() - - row.template_list(ob, "materials", ob, "active_material_index") - - col = row.column(align=True) - col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="") - col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="") + row = layout.row(align=True) if context.edit_object: - row = layout.row(align=True) - - row.itemO("object.material_slot_assign", text="Assign") - row.itemO("object.material_slot_select", text="Select") - row.itemO("object.material_slot_deselect", text="Deselect") - - """ - layout.itemS() - - box= layout.box() - - row = box.row() - row.template_list(ob, "materials", ob, "active_material_index", compact=True) - - subrow = row.row(align=True) - subrow.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="") - subrow.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="") - """ + row.itemO("MESH_OT_faces_shade_smooth") + row.itemO("MESH_OT_faces_shade_flat") + else: + row.itemO("OBJECT_OT_shade_smooth") + row.itemO("OBJECT_OT_shade_flat") class DATA_PT_vertex_groups(DataButtonsPanel): __idname__ = "DATA_PT_vertex_groups" @@ -114,6 +80,11 @@ class DATA_PT_vertex_groups(DataButtonsPanel): if ob.data.users > 1: col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="") + group = ob.active_vertex_group + if group: + row = layout.row() + row.itemR(group, "name") + if context.edit_object: row = layout.row(align=True) @@ -150,7 +121,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): col.itemS() subcol = col.column(align=True) - subcol.itemR(ob, "shape_key_lock", icon="ICON_PINNED", text="") + subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="") subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="") if key.relative: @@ -158,6 +129,9 @@ class DATA_PT_shape_keys(DataButtonsPanel): row.itemR(key, "relative") row.itemL() + row = layout.row() + row.itemR(kb, "name") + if ob.active_shape_key_index != 0: if not ob.shape_key_lock: row = layout.row(align=True) @@ -173,6 +147,9 @@ class DATA_PT_shape_keys(DataButtonsPanel): row.itemR(key, "relative") row.itemR(key, "slurph") + row = layout.row() + row.itemR(kb, "name") + if context.edit_object: layout.enabled = False @@ -186,12 +163,17 @@ class DATA_PT_uv_texture(DataButtonsPanel): row = layout.row() - row.template_list(me, "uv_textures", me, "active_uv_texture_index") + col = row.column() + col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2) col = row.column(align=True) col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="") col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="") + lay = me.active_uv_texture + if lay: + layout.itemR(lay, "name") + class DATA_PT_vertex_colors(DataButtonsPanel): __idname__ = "DATA_PT_vertex_colors" __label__ = "Vertex Colors" @@ -201,16 +183,20 @@ class DATA_PT_vertex_colors(DataButtonsPanel): me = context.mesh row = layout.row() + col = row.column() - row.template_list(me, "vertex_colors", me, "active_vertex_color_index") + col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2) col = row.column(align=True) col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="") col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="") + lay = me.active_vertex_color + if lay: + layout.itemR(lay, "name") + bpy.types.register(DATA_PT_context_mesh) -bpy.types.register(DATA_PT_mesh) -bpy.types.register(DATA_PT_materials) +bpy.types.register(DATA_PT_normals) bpy.types.register(DATA_PT_vertex_groups) bpy.types.register(DATA_PT_shape_keys) bpy.types.register(DATA_PT_uv_texture) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 52a10f1e37e..ceb492b198e 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -37,12 +37,19 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): if ob: row = layout.row() - row.template_list(ob, "materials", ob, "active_material_index") + row.template_list(ob, "materials", ob, "active_material_index", rows=2) col = row.column(align=True) col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="") col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="") + if context.edit_object: + row = layout.row(align=True) + + row.itemO("object.material_slot_assign", text="Assign") + row.itemO("object.material_slot_select", text="Select") + row.itemO("object.material_slot_deselect", text="Deselect") + split = layout.split(percentage=0.65) if ob and slot: diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py index c8f2101eca9..27ce093af6d 100644 --- a/release/ui/buttons_objects.py +++ b/release/ui/buttons_objects.py @@ -14,9 +14,9 @@ class OBJECT_PT_context_object(ObjectButtonsPanel): layout = self.layout ob = context.object - split = layout.split(percentage=0.06) - split.itemL(text="", icon="ICON_OBJECT_DATA") - split.itemR(ob, "name", text="") + row = layout.row() + row.itemL(text="", icon="ICON_OBJECT_DATA") + row.itemR(ob, "name", text="") class OBJECT_PT_transform(ObjectButtonsPanel): __idname__ = "OBJECT_PT_transform" @@ -176,3 +176,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) + diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index b3de2fccd42..08911b0195c 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -196,3 +196,4 @@ bpy.types.register(PHYSICS_PT_cloth) bpy.types.register(PHYSICS_PT_cloth_cache) bpy.types.register(PHYSICS_PT_cloth_collision) bpy.types.register(PHYSICS_PT_cloth_stiffness) + diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 2b47003e970..5f686469292 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -114,9 +114,9 @@ class RENDER_PT_shading(RenderButtonsPanel): col.itemR(rd, "render_textures", text="Textures") col.itemR(rd, "render_shadows", text="Shadows") col.itemR(rd, "render_sss", text="Subsurface Scattering") + col.itemR(rd, "render_envmaps", text="Environment Map") col = split.column() - col.itemR(rd, "render_envmaps", text="Environment Map") col.itemR(rd, "render_raytracing", text="Ray Tracing") col.itemR(rd, "color_management") col.itemR(rd, "alpha_mode", text="Alpha") @@ -330,7 +330,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel): col.itemR(rd, "full_sample") col = split.column() - col.itemR(rd, "pixel_filter", text="Filter") + col.itemR(rd, "pixel_filter", text="") col.itemR(rd, "filter_size", text="Size", slider=True) class RENDER_PT_dimensions(RenderButtonsPanel): diff --git a/release/ui/space_console.py b/release/ui/space_console.py index d6078b1db80..880cce82a27 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -16,7 +16,7 @@ class CONSOLE_HT_header(bpy.types.Header): layout.template_header() row = layout.row() - row.itemR(sc, "type", expand=True) + row.itemR(sc, "console_type", expand=True) if sc.type == 'REPORT': diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 3bd8c4ceb57..cdb22fb0442 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -9,7 +9,7 @@ class IMAGE_MT_view(bpy.types.Menu): layout = self.layout sima = context.space_data uv = sima.uv_editor - settings = context.scene.tool_settings + settings = context.tool_settings show_uvedit = sima.show_uvedit @@ -78,7 +78,7 @@ class IMAGE_MT_image(bpy.types.Menu): show_render = sima.show_render if ima: - if show_render: + if not show_render: layout.itemO("image.replace") layout.itemO("image.reload") @@ -157,7 +157,7 @@ class IMAGE_MT_uvs(bpy.types.Menu): layout = self.layout sima = context.space_data uv = sima.uv_editor - settings = context.scene.tool_settings + settings = context.tool_settings layout.itemR(uv, "snap_to_pixels") layout.itemR(uv, "constrain_to_image_bounds") @@ -199,7 +199,7 @@ class IMAGE_HT_header(bpy.types.Header): ima = sima.image iuser = sima.image_user layout = self.layout - settings = context.scene.tool_settings + settings = context.tool_settings show_render = sima.show_render show_paint = sima.show_paint @@ -223,7 +223,7 @@ class IMAGE_HT_header(bpy.types.Header): if show_uvedit: row.itemM("IMAGE_MT_uvs") - layout.template_ID(sima, "image", new="image.new") # open="image.open" + layout.template_ID(sima, "image", new="image.new") """ /* image select */ diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index e28fdd6641f..39d8b86613f 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -170,8 +170,6 @@ class VIEW3D_PT_background_image(bpy.types.Panel): col.itemR(bg, "x_offset", text="X") col.itemR(bg, "y_offset", text="Y") - - bpy.types.register(VIEW3D_MT_view_navigation) bpy.types.register(VIEW3D_MT_view) bpy.types.register(VIEW3D_HT_header) @@ -179,3 +177,4 @@ bpy.types.register(VIEW3D_PT_3dview_properties) bpy.types.register(VIEW3D_PT_3dview_display) bpy.types.register(VIEW3D_PT_background_image) + diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index f4a2682f111..abffb7037c9 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -194,7 +194,7 @@ class VIEW3D_PT_tools_brush(bpy.types.Panel): __label__ = "Brush" def brush_src(self, context): - ts = context.scene.tool_settings + ts = context.tool_settings if context.sculpt_object: return ts.sculpt elif context.vpaint_object: @@ -220,7 +220,7 @@ class VIEW3D_PT_tools_brush(bpy.types.Panel): col = split.column() col.itemR(brush, "size", slider=True) if context.wpaint_object: - col.itemR(context.scene.tool_settings, "vertex_group_weight", text="Weight", slider=True) + col.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True) col.itemR(brush, "strength", slider=True) @@ -247,7 +247,7 @@ class VIEW3D_PT_sculptoptions(bpy.types.Panel): return context.sculpt_object def draw(self, context): - sculpt = context.scene.tool_settings.sculpt + sculpt = context.tool_settings.sculpt split = self.layout.split() |