diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-01 17:48:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-01 17:48:36 +0300 |
commit | 6372c63ae96da1b762c79cfe18299e3c72e188ac (patch) | |
tree | bfde51deccf87cce2b2c0ac74b3429dc87889c6d /release | |
parent | 48398c978e2c00a8484a9e228671a7c7c7d7b831 (diff) |
select pattern for bones
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/object.py | 19 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d.py | 4 |
2 files changed, 17 insertions, 6 deletions
diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 89ba38860b3..af864edee4f 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -40,11 +40,20 @@ class SelectPattern(bpy.types.Operator): else: pattern_match = lambda a, b: fnmatch.fnmatchcase(a.upper(), b.upper()) - for ob in context.visible_objects: - if pattern_match(ob.name, self.properties.pattern): - ob.selected = True + obj = context.object + if obj and obj.mode == 'POSE': + items = obj.data.bones + elif obj and obj.type == 'ARMATURE' and obj.mode == 'EDIT': + items = obj.data.edit_bones + else: + items = context.visible_objects + + # Can be pose bones or objects + for item in items: + if pattern_match(item.name, self.properties.pattern): + item.selected = True elif not self.properties.extend: - ob.selected = False + item.selected = False return ('FINISHED',) @@ -54,7 +63,6 @@ class SelectPattern(bpy.types.Operator): return ('RUNNING_MODAL',) def draw(self, context): - print("WoW") layout = self.layout props = self.properties @@ -62,7 +70,6 @@ class SelectPattern(bpy.types.Operator): row = layout.row() row.prop(props, "case_sensitive") row.prop(props, "extend") - class SubsurfSet(bpy.types.Operator): diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index c100cde5a20..871f0e30270 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -407,6 +407,8 @@ class VIEW3D_MT_select_pose(bpy.types.Menu): props = layout.operator("pose.select_hierarchy", text="Extend Child") props.extend = True props.direction = 'CHILD' + + layout.operator("object.select_pattern", text="Select Pattern...") class VIEW3D_MT_select_particle(bpy.types.Menu): @@ -597,6 +599,8 @@ class VIEW3D_MT_select_edit_armature(bpy.types.Menu): props = layout.operator("armature.select_hierarchy", text="Extend Child") props.extend = True props.direction = 'CHILD' + + layout.operator("object.select_pattern", text="Select Pattern...") class VIEW3D_MT_select_face(bpy.types.Menu):# XXX no matching enum |