From 9b19c564ef9e41f8892b0174196cb0e41e9d2d30 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Mar 2011 06:15:55 +0000 Subject: fix for 'View Docs' with inherited properties, eg: "Object.name", is inherited and needs to open the URL of "ID.name". --- release/scripts/startup/bl_operators/wm.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'release/scripts') diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index df51af25b02..bb5f3a3a2a9 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -617,6 +617,15 @@ class WM_OT_doc_view(bpy.types.Operator): url = '%s/bpy.ops.%s.html#bpy.ops.%s.%s' % \ (self._prefix, class_name, class_name, class_prop) else: + + # detect if this is a inherited member and use that name instead + rna_parent = getattr(bpy.types, class_name).bl_rna + rna_prop = rna_parent.properties[class_prop] + rna_parent = rna_parent.base + while rna_parent and rna_prop == rna_parent.properties.get(class_prop): + class_name = rna_parent.identifier + rna_parent = rna_parent.base + # It so happens that epydoc nests these, not sphinx # class_name_full = self._nested_class_string(class_name) url = '%s/bpy.types.%s.html#bpy.types.%s.%s' % \ -- cgit v1.2.3