tooltip for operator

blender3.6
ChristopheSeux 2022-04-24 08:55:35 +02:00
parent ee03c36c01
commit 2303d32c29
1 changed files with 11 additions and 6 deletions

View File

@ -254,9 +254,9 @@ class BoneShape(Shape):
border_tri2 = border[2], border[3], border[0] border_tri2 = border[2], border[3], border[0]
if (not intersect_tri_tri_2d(*border_tri1, *bound_tri1) and if (not intersect_tri_tri_2d(*border_tri1, *bound_tri1) and
not intersect_tri_tri_2d(*border_tri1, *border_tri2) and not intersect_tri_tri_2d(*border_tri1, *bound_tri2) and
not intersect_tri_tri_2d(*border_tri2, *border_tri2) and not intersect_tri_tri_2d(*border_tri2, *bound_tri1) and
not intersect_tri_tri_2d(*border_tri2, *border_tri2)): not intersect_tri_tri_2d(*border_tri2, *bound_tri2)):
return return
select = True select = True
@ -297,6 +297,9 @@ class OperatorShape(Shape):
#self.arguments = arguments#{k:eval(v)} #self.arguments = arguments#{k:eval(v)}
#self.operator = get_operator_from_id(self.operator) #self.operator = get_operator_from_id(self.operator)
if not tooltip:
self.tooltip = self.operator.replace('bpy.ops.', '').replace("'INVOKE_DEFAULT', ", '')
#self.reg_args = re.compile(r'(\w+)=') #self.reg_args = re.compile(r'(\w+)=')
''' '''
def parse_args(self): def parse_args(self):
@ -421,11 +424,13 @@ class Picker:
def tooltip_event(self): def tooltip_event(self):
print('Tooltip Event', self) #print('Tooltip Event', self)
if self.hover_shape: if self.hover_shape and self.hover_shape.type != 'display':
if self.hover_shape.type == 'bone': if self.hover_shape.type == 'bone':
self.tooltip = self.hover_shape.bone.name self.tooltip = self.hover_shape.bone.name
else:
self.tooltip = self.hover_shape.tooltip
self.tooltip_shape = self.hover_shape self.tooltip_shape = self.hover_shape
else: else:
self.tooltip = '' self.tooltip = ''