0
$\begingroup$

So I have a series of operators I would like to link to documentation wherever I right click and choose online manual. How do I set up operators to link to them or configure it? Is there a way I can do it on the operators themselves?

$\endgroup$

1 Answer 1

1
$\begingroup$

In the file 2.77/scripts/startup/bl_operators/wm.py you will find all the wm.doc_* operators,

class WM_OT_doc_view_manual(Operator):
    """Load online manual"""
    bl_idname = "wm.doc_view_manual"
    bl_label = "View Manual"

    doc_id = doc_id
    ...

We can override this operator to call our own. Here the doc_id is

import bpy
from bl_operators.wm import WM_OT_doc_view_manual, doc_id

class Overide_doc_view_manual(WM_OT_doc_view_manual):
    doc_id = doc_id
    def invoke(self, context, event):
        print("Invoke")
        return {'FINISHED'}

    def execute(self, context):
        print("Online manual", self.doc_id)
        return {'FINISHED'}

def execute(self, context):
    print("Called myClass")
    return {'FINISHED'}
# lazy register
bpy.utils.register_class(Overide_doc_view_manual)
$\endgroup$
1
  • $\begingroup$ what about adding this to custom operators on a per operator basis? $\endgroup$ Commented Jul 29, 2016 at 22:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .