diff options
author | Julian Eisel <julian@blender.org> | 2020-03-18 14:41:39 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-18 14:53:36 +0300 |
commit | dd416681fbb02274cb0bab55d6e0d00e8addf9c5 (patch) | |
tree | cec90d94d562d0c0b8b2e729645aec5f6628b15e /source | |
parent | 406026abba130be90e1a9824e4fb0a5d8eedd759 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, |