diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
commit | dd75ec490761640571a0d8e53a0d439091f2736f (patch) | |
tree | 25b3966862febbf3ee8c81ed45f7045c99f84016 /release/scripts/ui/space_view3d.py | |
parent | 02b0967bd11dd6fd2454b37182d9f94ea451b603 (diff) | |
parent | c026b8066ddc1c42144d2e5132384ea7c1211050 (diff) |
Merged changes in the trunk up to revision 31190.
Diffstat (limited to 'release/scripts/ui/space_view3d.py')
-rw-r--r-- | release/scripts/ui/space_view3d.py | 171 |
1 files changed, 38 insertions, 133 deletions
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 7b59b00dc56..a3e945f460a 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -75,11 +75,16 @@ class VIEW3D_HT_header(bpy.types.Header): row.prop(view, "occlude_geometry", text="") # Proportional editing - if obj.mode in ('OBJECT', 'EDIT', 'PARTICLE_EDIT'): + if obj.mode in ('EDIT', 'PARTICLE_EDIT'): row = layout.row(align=True) row.prop(toolsettings, "proportional_editing", text="", icon_only=True) if toolsettings.proportional_editing != 'DISABLED': row.prop(toolsettings, "proportional_editing_falloff", text="", icon_only=True) + elif obj.mode == 'OBJECT': + row = layout.row(align=True) + row.prop(toolsettings, "proportional_editing_objects", text="", icon_only=True) + if toolsettings.proportional_editing_objects: + row.prop(toolsettings, "proportional_editing_falloff", text="", icon_only=True) # Snap row = layout.row(align=True) @@ -114,7 +119,7 @@ class VIEW3D_HT_header(bpy.types.Header): # ********** Utilities ********** -class VIEW3D_MT_showhide(bpy.types.Menu): +class ShowHideMenu(): bl_label = "Show/Hide" _operator_name = "" @@ -709,7 +714,8 @@ class VIEW3D_MT_object_clear(bpy.types.Menu): class VIEW3D_MT_object_specials(bpy.types.Menu): bl_label = "Specials" - def poll(self, context): + @classmethod + def poll(cls, context): # add more special types return context.object @@ -1025,7 +1031,7 @@ class VIEW3D_MT_sculpt(bpy.types.Menu): layout.prop(brush, "use_anchor") if sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'): - layout.prop(brush, "direction") + layout.prop_menu_enum(brush, "direction") if sculpt_tool == 'LAYER': layout.prop(brush, "use_persistent") @@ -1086,7 +1092,7 @@ class VIEW3D_MT_particle_specials(bpy.types.Menu): layout.operator("particle.remove_doubles") -class VIEW3D_MT_particle_showhide(VIEW3D_MT_showhide): +class VIEW3D_MT_particle_showhide(ShowHideMenu, bpy.types.Menu): _operator_name = "particle" # ********** Pose Menu ********** @@ -1236,7 +1242,7 @@ class VIEW3D_MT_pose_constraints(bpy.types.Menu): layout.operator("pose.constraints_clear") -class VIEW3D_MT_pose_showhide(VIEW3D_MT_showhide): +class VIEW3D_MT_pose_showhide(ShowHideMenu, bpy.types.Menu): _operator_name = "pose" @@ -1602,7 +1608,7 @@ class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu): layout.operator("mesh.flip_normals") -class VIEW3D_MT_edit_mesh_showhide(VIEW3D_MT_showhide): +class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, bpy.types.Menu): _operator_name = "mesh" # Edit Curve @@ -1694,7 +1700,7 @@ class VIEW3D_MT_edit_curve_specials(bpy.types.Menu): layout.operator("curve.smooth_radius") -class VIEW3D_MT_edit_curve_showhide(VIEW3D_MT_showhide): +class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, bpy.types.Menu): _operator_name = "curve" @@ -1934,7 +1940,8 @@ class VIEW3D_PT_view3d_properties(bpy.types.Panel): bl_region_type = 'UI' bl_label = "View" - def poll(self, context): + @classmethod + def poll(cls, context): view = context.space_data return (view) @@ -1970,7 +1977,8 @@ class VIEW3D_PT_view3d_name(bpy.types.Panel): bl_region_type = 'UI' bl_label = "Item" - def poll(self, context): + @classmethod + def poll(cls, context): return (context.space_data and context.active_object) def draw(self, context): @@ -1995,7 +2003,8 @@ class VIEW3D_PT_view3d_display(bpy.types.Panel): bl_label = "Display" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): view = context.space_data return (view) @@ -2062,7 +2071,8 @@ class VIEW3D_PT_view3d_meshdisplay(bpy.types.Panel): bl_region_type = 'UI' bl_label = "Mesh Display" - def poll(self, context): + @classmethod + def poll(cls, context): # The active object check is needed because of localmode return (context.active_object and (context.mode == 'EDIT_MESH')) @@ -2098,7 +2108,8 @@ class VIEW3D_PT_view3d_curvedisplay(bpy.types.Panel): bl_region_type = 'UI' bl_label = "Curve Display" - def poll(self, context): + @classmethod + def poll(cls, context): editmesh = context.mode == 'EDIT_CURVE' return (editmesh) @@ -2120,7 +2131,8 @@ class VIEW3D_PT_background_image(bpy.types.Panel): bl_label = "Background Images" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): view = context.space_data # bg = context.space_data.background_image return (view) @@ -2169,7 +2181,8 @@ class VIEW3D_PT_transform_orientations(bpy.types.Panel): bl_label = "Transform Orientations" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): view = context.space_data return (view) @@ -2196,7 +2209,8 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel): bl_label = "Skeleton Sketching" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): scene = context.space_data ob = context.active_object return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT' @@ -2239,7 +2253,7 @@ class VIEW3D_PT_context_properties(bpy.types.Panel): bl_label = "Properties" bl_default_closed = True - def _active_context_member(self, context): + def _active_context_member(context): obj = context.object if obj: mode = obj.mode @@ -2252,8 +2266,9 @@ class VIEW3D_PT_context_properties(bpy.types.Panel): return "" - def poll(self, context): - member = self._active_context_member(context) + @classmethod + def poll(cls, context): + member = cls._active_context_member(context) if member: context_member = getattr(context, member) return context_member and context_member.keys() @@ -2263,129 +2278,19 @@ class VIEW3D_PT_context_properties(bpy.types.Panel): def draw(self, context): import rna_prop_ui # reload(rna_prop_ui) - member = self._active_context_member(context) + member = __class__._active_context_member(context) if member: # Draw with no edit button rna_prop_ui.draw(self.layout, context, member, False) -classes = [ - VIEW3D_OT_edit_mesh_extrude_move, # detects constraints setup and extrude region - VIEW3D_OT_edit_mesh_extrude_individual_move, - - VIEW3D_HT_header, # Header - - VIEW3D_MT_view, #View Menus - VIEW3D_MT_view_navigation, - VIEW3D_MT_view_align, - VIEW3D_MT_view_align_selected, - VIEW3D_MT_view_cameras, - - VIEW3D_MT_select_object, # Select Menus - VIEW3D_MT_select_pose, - VIEW3D_MT_select_particle, - VIEW3D_MT_select_edit_mesh, - VIEW3D_MT_select_edit_curve, - VIEW3D_MT_select_edit_surface, - VIEW3D_MT_select_edit_metaball, - VIEW3D_MT_select_edit_lattice, - VIEW3D_MT_select_edit_armature, - VIEW3D_MT_select_face, # XXX todo - - VIEW3D_MT_transform, # Object/Edit Menus - VIEW3D_MT_mirror, # Object/Edit Menus - VIEW3D_MT_snap, # Object/Edit Menus - VIEW3D_MT_uv_map, # Edit Menus - - VIEW3D_MT_object, # Object Menu - VIEW3D_MT_object_specials, - VIEW3D_MT_object_apply, - VIEW3D_MT_object_clear, - VIEW3D_MT_object_parent, - VIEW3D_MT_object_track, - VIEW3D_MT_object_group, - VIEW3D_MT_object_constraints, - VIEW3D_MT_object_showhide, - VIEW3D_MT_make_single_user, - VIEW3D_MT_make_links, - VIEW3D_MT_object_game_properties, - VIEW3D_MT_object_game_logicbricks, - - VIEW3D_MT_hook, - VIEW3D_MT_vertex_group, - - VIEW3D_MT_sculpt, # Sculpt Menu - VIEW3D_MT_paint_vertex, - VIEW3D_MT_paint_weight, - - VIEW3D_MT_particle, # Particle Menu - VIEW3D_MT_particle_specials, - VIEW3D_MT_particle_showhide, - - VIEW3D_MT_pose, # POSE Menu - VIEW3D_MT_pose_transform, - VIEW3D_MT_pose_pose, - VIEW3D_MT_pose_motion, - VIEW3D_MT_pose_group, - VIEW3D_MT_pose_ik, - VIEW3D_MT_pose_constraints, - VIEW3D_MT_pose_showhide, - VIEW3D_MT_pose_apply, - - VIEW3D_MT_edit_mesh, - VIEW3D_MT_edit_mesh_specials, # Only as a menu for keybindings - VIEW3D_MT_edit_mesh_selection_mode, # Only as a menu for keybindings - VIEW3D_MT_edit_mesh_vertices, - VIEW3D_MT_edit_mesh_edges, - VIEW3D_MT_edit_mesh_faces, - VIEW3D_MT_edit_mesh_normals, - VIEW3D_MT_edit_mesh_showhide, - VIEW3D_MT_edit_mesh_extrude, # use with VIEW3D_OT_edit_mesh_extrude_menu - - VIEW3D_MT_edit_curve, - VIEW3D_MT_edit_curve_ctrlpoints, - VIEW3D_MT_edit_curve_segments, - VIEW3D_MT_edit_curve_specials, - VIEW3D_MT_edit_curve_showhide, - - VIEW3D_MT_edit_surface, - - VIEW3D_MT_edit_text, - VIEW3D_MT_edit_text_chars, - - VIEW3D_MT_edit_meta, - VIEW3D_MT_edit_meta_showhide, - - VIEW3D_MT_edit_lattice, - - VIEW3D_MT_edit_armature, - VIEW3D_MT_edit_armature_parent, - VIEW3D_MT_edit_armature_roll, - - VIEW3D_MT_armature_specials, # Only as a menu for keybindings - - # Panels - VIEW3D_PT_view3d_properties, - VIEW3D_PT_view3d_display, - VIEW3D_PT_view3d_name, - VIEW3D_PT_view3d_meshdisplay, - VIEW3D_PT_view3d_curvedisplay, - VIEW3D_PT_background_image, - VIEW3D_PT_transform_orientations, - VIEW3D_PT_etch_a_ton, - VIEW3D_PT_context_properties] - def register(): - register = bpy.types.register - for cls in classes: - register(cls) + pass def unregister(): - unregister = bpy.types.unregister - for cls in classes: - unregister(cls) + pass if __name__ == "__main__": - register()
\ No newline at end of file + register() |