3
$\begingroup$

It is possible to assign custom documentation webpages for operators by using a manual map:

def my_addon_docs():
    map = (
        ("bpy.ops.myaddon.bone_preset_*",            "/workflowpresets/"), # <== works
        # ...
    )  
    return "https://some.website", map

bpy.utils.register_manual_map(my_addon_docs)

I have seen that i can also RMB on object properties and then call the "Online Manual" entry. However i can not see how i have to do the mapping from a custom object attribute to the webpage. I tried this:

def my_addon_docs():
    map = (
        ("bpy.data.*.RigProps.rig_use_bind_pose",    "/posing/"), # <== breaks
    )  
    return "https://some.website", map

bpy.utils.register_manual_map(my_addon_docs)

But then i get an error when i try to call the online manual:

AttributeError: 'RNA_Types' object has no attribute 'RigProps'
$\endgroup$
1
$\begingroup$

bpy.data.* has attributes like objects, meshes, speakers, cameras etc. None of these collections have a RigProps pointer property. Use the type that the custom property has been registered on.

Small example, Object has an IntProperty named "example" registered. Added UI in object properties name panel to test.

import bpy
from bpy.props import IntProperty
bpy.types.Object.example = IntProperty()

def draw(self, context):
    self.layout.prop(context.object, "example")

def my_addon_docs():
    map = (
        ("bpy.types.Object.example",    "/posing/"),
    )  
    return "https://some.website", map

bpy.types.OBJECT_PT_context_object.append(draw)
bpy.utils.register_manual_map(my_addon_docs)

In your case, I'd suggest using the map

    map = (
        ("bpy.types.Object.RigProps.*",    "/posing/"),
    )  
    return "https://some.website", map

Or if you have anchors (or query strings)

def my_addon_docs():
    props = ("use_xxx", "use_yyy", "use_zzz")
    map = [
        ("bpy.types.Object.RigProps.%s" % prop,    
          "#%s" % prop) for prop in props]
    return "https://some.website/posing", map
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.