Can you change the tooltip for an operator (button) at run time.
I can’t see a way to do it.
Thanks
Can you change the tooltip for an operator (button) at run time.
I can’t see a way to do it.
Thanks
>>> bpy.ops.render.render.__doc__
'bpy.ops.render.render(animation=False, write_still=False, layer="", scene="")'
>>> bpy.ops.render.render.__doc__ = "hello"
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: can't set attribute
>>> bpy.ops.render.render._get_doc.__self__
# Render active scene
bpy.ops.render.render(animation=False, write_still=False, layer="", scene="")
>>> bpy.ops.render.render._get_doc.__self__ = None
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: readonly attribute
What seems to work for python defined classes however is the following:
c = bpy.types.OBJECT_OT_simple_operator
c.bl_label = "New label"
c.__doc__ = "New docstring"
bpy.utils.unregister_class(c)
bpy.utils.register_class(c)
But that’s really a hack, i can’t recommend it.