clean poll with the func is_picker_space

blender3.6
christopheseux 2022-09-06 15:58:16 +02:00
parent 8e4d82fd1d
commit 450d029dc4
1 changed files with 15 additions and 10 deletions

View File

@ -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"}