diff --git a/op_picker.py b/op_picker.py index 182f001..cb45942 100644 --- a/op_picker.py +++ b/op_picker.py @@ -195,18 +195,11 @@ class RP_OT_move_bone(bpy.types.Operator): bl_idname = "node.move_bone" bl_label = "Move Bone in Picker View" - ''' @classmethod def poll(cls, context): - sp = context.space_data - - if not sp.tree_type == 'RigPickerTree': + if not is_picker_space(context): return - - ob = context.object - return ob and ob in PICKERS - ''' - + def invoke(self, context, event): self.mouse = event.mouse_region_x, event.mouse_region_y @@ -246,6 +239,11 @@ class RP_OT_function_execute(bpy.types.Operator): shape_index = bpy.props.IntProperty() + @classmethod + def poll(cls, context): + if not is_picker_space(context): + return + def execute(self,context): event = self.event ob = context.object @@ -271,9 +269,16 @@ class RP_OT_reload_picker(bpy.types.Operator): bl_idname = "rigpicker.reload_picker" bl_label = 'Reload Picker' + #@classmethod + #def poll(cls, context): + # if not is_picker_space(context): + # return + def execute(self,context): PICKERS.clear() - context.region.tag_redraw() + + for a in context.screen.areas: + a.tag_redraw() return {"FINISHED"}