diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 7a0a91cc6e3..a7e81416b80 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -4924,6 +4924,18 @@ bool RNA_property_is_idprop(PropertyRNA *prop) return (prop->magic != RNA_MAGIC); } +/* mainly for the UI */ +bool RNA_property_is_unlink(PropertyRNA *prop) +{ + const int flag = RNA_property_flag(prop); + if (RNA_property_type(prop) == PROP_STRING) { + return (flag & PROP_NEVER_UNLINK) == 0; + } + else { + return (flag & (PROP_NEVER_UNLINK | PROP_NEVER_NULL)) == 0; + } +} + /* string representation of a property, python * compatible but can be used for display too, * context may be NULL */ |