Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-13 01:06:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-13 01:10:34 +0300
commit07b8be9514d9bb3211de87c8e200a9ddd4ae52d3 (patch)
treefc7bc36ed5b2ee138c2775ec7de5cf4b227e267e /source/blender
parentdf179e5e78c5555b5ed067c1d871d41eadfdbaf9 (diff)
RNA: support enum defaults which don't exist in the item array
Allow dynamic defines to have defaults which don't exist in the static array, this is an exception that's only allowed when the item array is set to DummyRNA_NULL_items.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesrna/intern/makesrna.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 0fcd9e3599f..8e0af001eec 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -31,6 +31,7 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -2957,7 +2958,9 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
}
}
else {
- if (!defaultfound) {
+ if (!defaultfound &&
+ !(eprop->itemf && eprop->item == DummyRNA_NULL_items))
+ {
CLOG_ERROR(&LOG, "%s%s.%s, enum default is not in items.",
srna->identifier, errnest, prop->identifier);
DefRNA.error = 1;