[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53485] trunk/blender/source/blender/ python/intern/bpy_props.c: Add a warning to enum props' items parameter, to *never* use a generator as value for this param! It works in most cases , but in some it leads to an empty set of values for the enum (see [#33716] ), and it's not an easy bug to track down!

Bastien Montagne montagne29 at wanadoo.fr
Tue Jan 1 16:55:26 CET 2013


Revision: 53485
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53485
Author:   mont29
Date:     2013-01-01 15:55:21 +0000 (Tue, 01 Jan 2013)
Log Message:
-----------
Add a warning to enum props' items parameter, to *never* use a generator as value for this param! It works in most cases, but in some it leads to an empty set of values for the enum (see [#33716]), and it's not an easy bug to track down!

Modified Paths:
--------------
    trunk/blender/source/blender/python/intern/bpy_props.c

Modified: trunk/blender/source/blender/python/intern/bpy_props.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_props.c	2013-01-01 14:20:59 UTC (rev 53484)
+++ trunk/blender/source/blender/python/intern/bpy_props.c	2013-01-01 15:55:21 UTC (rev 53485)
@@ -1233,6 +1233,8 @@
 "      For dynamic values a callback can be passed which returns a list in\n"
 "      the same format as the static list.\n"
 "      This function must take 2 arguments (self, context)\n"
+"      WARNING: Do not use generators here (they will work the first time, but will lead to empty values\n"
+"               in some unload/reload scenarii)!\n"
 "   :type items: sequence of string triplets or a function\n"
 BPY_PROPDEF_UPDATE_DOC
 );




More information about the Bf-blender-cvs mailing list