[Bf-blender-cvs] [dd416681fbb] master: Fix BPY enum property definiton failing if items contain spaces

Julian Eisel noreply at git.blender.org
Wed Mar 18 12:54:21 CET 2020


Commit: dd416681fbb02274cb0bab55d6e0d00e8addf9c5
Author: Julian Eisel
Date:   Wed Mar 18 12:41:39 2020 +0100
Branches: master
https://developer.blender.org/rBdd416681fbb02274cb0bab55d6e0d00e8addf9c5

Fix BPY enum property definiton failing if items contain spaces

Mistake in 03a4d3c33f82, turns out this actually is called from BPY
(which I didn't think it was). So only error out during makesrna, not at
runtime.

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

M	source/blender/makesrna/intern/rna_define.c

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

diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 8932639d1ac..fc81fd52cf3 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1850,7 +1850,8 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
         eprop->totitem++;
 
         if (item[i].identifier[0]) {
-          if (strstr(item[i].identifier, " ")) {
+          /* Don't allow spaces in internal enum items (it's fine for Python ones). */
+          if (DefRNA.preprocess && strstr(item[i].identifier, " ")) {
             CLOG_ERROR(&LOG,
                        "\"%s.%s\", enum identifiers must not contain spaces.",
                        srna->identifier,



More information about the Bf-blender-cvs mailing list