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>2013-05-03 01:27:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-03 01:27:19 +0400
commit91ba6c9ced2a95105fab8616ba6c41a55e1b4b1f (patch)
tree70b601cbb79092079c4376ebdb211d0d114e8655 /source/blender/makesrna/intern/rna_access.c
parentfe208a895a39c398e114779ca4c8c2a01adf676d (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.c12
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 */