[Bf-blender-cvs] [0c6e744] master: Fix T39158: Help > Operator Cheat Sheet causes a python recursive loop.

Bastien Montagne noreply at git.blender.org
Thu Mar 13 17:43:07 CET 2014


Commit: 0c6e74436fd8aba1a8d015d3427a751480f9530c
Author: Bastien Montagne
Date:   Thu Mar 13 17:37:19 2014 +0100
https://developer.blender.org/rB0c6e74436fd8aba1a8d015d3427a751480f9530c

Fix T39158: Help > Operator Cheat Sheet causes a python recursive loop.

Core issue exists since ages - the thing you get from bpy.types.YOUR_OT_operator is fuzzy, and may change,
due to the fact that both Operator and OperatorProperties share the same name...
Would be cool to get rid of this issue one day, but for now it's safer to use rna acessor...

This commit is to be backported to 2.70.

===================================================================

M	release/scripts/modules/bpy/ops.py

===================================================================

diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py
index 1d71bff..e457c08 100644
--- a/release/scripts/modules/bpy/ops.py
+++ b/release/scripts/modules/bpy/ops.py
@@ -204,7 +204,10 @@ class BPyOpsSubModOp(object):
         import bpy
         idname = self.idname()
         as_string = op_as_string(idname)
-        op_class = getattr(bpy.types, idname)
+        # XXX You never quite know what you get from bpy.types, with operators... Operator and OperatorProperties
+        #     are shadowing each other, and not in the same way for native ops and py ones! See T39158.
+        # op_class = getattr(bpy.types, idname)
+        op_class = op_get_rna(idname)
         descr = op_class.bl_rna.description
         # XXX, workaround for not registering
         # every __doc__ to save time on load.




More information about the Bf-blender-cvs mailing list