diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-31 16:32:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-31 16:49:50 +0300 |
commit | 636baa598a5698d84eca89d17c67a74092cef4d0 (patch) | |
tree | 6c09f62384fd8a75698a73ec409c5139512025df /source/blender/makesrna/intern/rna_access.c | |
parent | 018137f76248ab85bbe2057ca5d67c55a559247b (diff) |
RNA: Limit which classes struct-map contains
Only add subclasses of: Menu, Panel, Header, UIList, Operator
This helps avoid unnecessary naming collisions,
See T52599 for details
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 15b535625df..6f2cfbdb6bd 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -89,6 +89,7 @@ void RNA_init(void) } } } + BLI_assert(srna->flag & STRUCT_PUBLIC_NAMESPACE); BLI_ghash_insert(BLENDER_RNA.structs_map, (void *)srna->identifier, srna); BLENDER_RNA.structs_len += 1; } @@ -814,6 +815,9 @@ char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, i return NULL; } +/** + * Use when registering structs with the #STRUCT_PUBLIC_NAMESPACE flag. + */ bool RNA_struct_available_or_report(ReportList *reports, const char *identifier) { const StructRNA *srna_exists = RNA_struct_find(identifier); |