diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-02 02:25:49 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-02 02:25:49 +0400 |
commit | 421f44278cebff49a1485251f92a4277934c4e4c (patch) | |
tree | cdc18b03a3d2c3f17c892f0c4e1e894e91a9610a /release | |
parent | cda566d6464cac92a766df0b065d43d8240e23f2 (diff) |
2.5: Lists for vertex groups, shape keys, uvs, vertex colors.
RNA
* Added the relevant active_*_index properties, with proper
get/set/range, updates and notifiers.
* Context.tool_settings.
* ToolSettings.vertex_group_weight.
Operators
* MESH_OT_uv_texture_add/remove
* MESH_OT_vertex_color_add/remove
* MESH_OT_sticky_add/remove
* OBJECT_OT_vertex_group_add/remove/assign/remove_from/
select/deselect/copy/copy_to_linked
* OBJECT_OT_shape_key_add/remove
UI
* Some updates and cleanups in list template code.
Known issue: when going in & out of editmode, uv textures and vertex
colors dissappear. I thought me->edit_mesh would be NULL when not in
edit mode but it is not?
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_data_mesh.py | 107 | ||||
-rw-r--r-- | release/ui/buttons_data_modifier.py | 2 | ||||
-rw-r--r-- | release/ui/buttons_particle.py | 2 |
3 files changed, 103 insertions, 8 deletions
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index 3360f4c47ad..c7e253d5084 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -62,30 +62,125 @@ class DATA_PT_materials(DataButtonsPanel): row = layout.row() - row.template_list(ob, "materials", "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="") - row = layout.row(align=True) + if context.edit_object: + row = layout.row(align=True) - row.itemO("OBJECT_OT_material_slot_assign", text="Assign"); - row.itemO("OBJECT_OT_material_slot_select", text="Select"); - row.itemO("OBJECT_OT_material_slot_deselect", text="Deselect"); + row.itemO("OBJECT_OT_material_slot_assign", text="Assign") + row.itemO("OBJECT_OT_material_slot_select", text="Select") + row.itemO("OBJECT_OT_material_slot_deselect", text="Deselect") + """ layout.itemS() box= layout.box() row = box.row() - row.template_list(ob, "materials", "active_material_index", compact=True) + row.template_list(ob, "materials", ob, "active_material_index", compact=True) subrow = row.row(align=True) subrow.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="") subrow.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="") + """ +class DATA_PT_vertex_groups(DataButtonsPanel): + __idname__ = "DATA_PT_vertex_groups" + __label__ = "Vertex Groups" + + def poll(self, context): + return (context.object and context.object.type in ('MESH', 'LATTICE')) + + def draw(self, context): + layout = self.layout + ob = context.object + + row = layout.row() + + row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index") + + col = row.column(align=True) + col.itemO("OBJECT_OT_vertex_group_add", icon="ICON_ZOOMIN", text="") + col.itemO("OBJECT_OT_vertex_group_remove", icon="ICON_ZOOMOUT", text="") + + col.itemO("OBJECT_OT_vertex_group_copy", icon="ICON_BLANK1", text="") + if ob.data.users > 1: + col.itemO("OBJECT_OT_vertex_group_copy_to_linked", icon="ICON_BLANK1", text="") + + if context.edit_object: + row = layout.row(align=True) + + row.itemO("OBJECT_OT_vertex_group_assign", text="Assign") + row.itemO("OBJECT_OT_vertex_group_remove_from", text="Remove") + row.itemO("OBJECT_OT_vertex_group_select", text="Select") + row.itemO("OBJECT_OT_vertex_group_deselect", text="Deselect") + + layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight") + +class DATA_PT_shape_keys(DataButtonsPanel): + __idname__ = "DATA_PT_shape_keys" + __label__ = "Shape Keys" + + def poll(self, context): + return (context.object and context.object.type in ('MESH', 'LATTICE')) + + def draw(self, context): + layout = self.layout + ob = context.object + + row = layout.row() + + key = ob.data.shape_keys + + row.template_list(key, "keys", ob, "active_shape_key_index") + + col = row.column(align=True) + col.itemO("OBJECT_OT_shape_key_add", icon="ICON_ZOOMIN", text="") + col.itemO("OBJECT_OT_shape_key_remove", icon="ICON_ZOOMOUT", text="") + + if context.edit_object: + layout.enabled = False + +class DATA_PT_uv_texture(DataButtonsPanel): + __idname__ = "DATA_PT_uv_texture" + __label__ = "UV Texture" + + def draw(self, context): + layout = self.layout + me = context.mesh + + row = layout.row() + + row.template_list(me, "uv_textures", me, "active_uv_texture_index") + + col = row.column(align=True) + col.itemO("MESH_OT_uv_texture_add", icon="ICON_ZOOMIN", text="") + col.itemO("MESH_OT_uv_texture_remove", icon="ICON_ZOOMOUT", text="") + +class DATA_PT_vertex_colors(DataButtonsPanel): + __idname__ = "DATA_PT_vertex_colors" + __label__ = "Vertex Colors" + + def draw(self, context): + layout = self.layout + me = context.mesh + + row = layout.row() + + row.template_list(me, "vertex_colors", me, "active_vertex_color_index") + + col = row.column(align=True) + col.itemO("MESH_OT_vertex_color_add", icon="ICON_ZOOMIN", text="") + col.itemO("MESH_OT_vertex_color_remove", icon="ICON_ZOOMOUT", text="") bpy.types.register(DATA_PT_mesh) bpy.types.register(DATA_PT_materials) +bpy.types.register(DATA_PT_vertex_groups) +bpy.types.register(DATA_PT_shape_keys) +bpy.types.register(DATA_PT_uv_texture) +bpy.types.register(DATA_PT_vertex_colors) diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 366f2b8a86b..953fc1f0974 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -350,7 +350,7 @@ class DATA_PT_modifiers(DataButtonsPanel): sub.itemR(md, "factor") sub.itemR(md, "repeat") - layout.template_pointer(md, "vertex_group", ob, "vertex_groups") + layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") def softbody(self, layout, ob, md): layout.itemL(text="See Softbody panel.") diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index 85580c9be69..49ceaf6aae1 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -33,7 +33,7 @@ class PARTICLE_PT_particles(ParticleButtonsPanel): if ob: row = layout.row() - row.template_list(ob, "particle_systems", "active_particle_system_index") + row.template_list(ob, "particle_systems", ob, "active_particle_system_index") col = row.column(align=True) col.itemO("OBJECT_OT_particle_system_add", icon="ICON_ZOOMIN", text="") |