From 28f4e5cd6bc718d91d0f637c89bce4ce68671b71 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 26 Jun 2020 18:08:12 +0200 Subject: RNA: Add a way to prevent automatic addition of 'no ownership' flag for ID pointer properties. Since makesrna runs after all properties have been defined, we have to remember with a new internal flag when we explicitely disable the 'PROP_PTR_NO_OWNERSHIP' flag for a property. Otherwise there was no way to do so for ID pointer properties... --- source/blender/makesrna/intern/rna_define.c | 3 +++ 1 file changed, 3 insertions(+) (limited to '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 7919c014bb2..bb791dd6e2d 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1515,6 +1515,9 @@ void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag) void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag) { prop->flag &= ~flag; + if (flag & PROP_PTR_NO_OWNERSHIP) { + prop->flag_internal |= PROP_INTERN_PTR_OWNERSHIP_FORCED; + } } void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag) -- cgit v1.2.3