diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-03 01:27:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-03 01:27:19 +0400 |
commit | 91ba6c9ced2a95105fab8616ba6c41a55e1b4b1f (patch) | |
tree | 70b601cbb79092079c4376ebdb211d0d114e8655 /source/blender/makesrna/intern/rna_access.c | |
parent | fe208a895a39c398e114779ca4c8c2a01adf676d (diff) |
adjustment to own commit r56463.
when strings use 'PROP_NEVER_NULL' we still want them to show an unlink button.
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 */ |