[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35811] trunk/blender/release/scripts/ startup/bl_operators/wm.py: fix for 'View Docs' with inherited properties, eg: "Object.name", is inherited and needs to open the URL of "ID.name".

Campbell Barton ideasman42 at gmail.com
Sun Mar 27 08:15:56 CEST 2011


Revision: 35811
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35811
Author:   campbellbarton
Date:     2011-03-27 06:15:55 +0000 (Sun, 27 Mar 2011)
Log Message:
-----------
fix for 'View Docs' with inherited properties, eg: "Object.name", is inherited and needs to open the URL of "ID.name".

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/wm.py

Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py	2011-03-27 05:23:14 UTC (rev 35810)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2011-03-27 06:15:55 UTC (rev 35811)
@@ -617,6 +617,14 @@
                 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
+                class_parent = getattr(bpy.types, class_name).bl_rna.base
+                while class_parent and class_prop in class_parent.properties:
+                    class_name = class_parent.identifier
+                    class_parent = class_parent.base
+                # done!
+
                 # 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' % \




More information about the Bf-blender-cvs mailing list