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>2017-10-21 04:43:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-21 04:43:17 +0300
commitb66728d63deee0fc9ef517405466d1139871251d (patch)
tree03b92d528c53e48434d4e6361ecfc1b7607d2f56 /source/blender/blenkernel/intern/nla.c
parenta8553c9fa2482ca1a19bcf96edec2e8a3d261d86 (diff)
parentebb29200d3bf9460ff32100cc1ed6c436e206829 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r--source/blender/blenkernel/intern/nla.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 478b854c4df..d4943b1b566 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1417,6 +1417,40 @@ void BKE_nlastrip_validate_fcurves(NlaStrip *strip)
}
}
+/* Check if the given RNA pointer + property combo should be handled by
+ * NLA strip curves or not.
+ */
+bool BKE_nlastrip_has_curves_for_property(const PointerRNA *ptr, const PropertyRNA *prop)
+{
+ /* sanity checks */
+ if (ELEM(NULL, ptr, prop))
+ return false;
+
+ /* 1) Must be NLA strip */
+ if (ptr->type == &RNA_NlaStrip) {
+ /* 2) Must be one of the predefined properties */
+ static PropertyRNA *prop_influence = NULL;
+ static PropertyRNA *prop_time = NULL;
+ static bool needs_init = true;
+
+ /* Init the properties on first use */
+ if (needs_init) {
+ prop_influence = RNA_struct_type_find_property(&RNA_NlaStrip, "influence");
+ prop_time = RNA_struct_type_find_property(&RNA_NlaStrip, "strip_time");
+
+ needs_init = false;
+ }
+
+ /* Check if match */
+ if (ELEM(prop, prop_influence, prop_time)) {
+ return true;
+ }
+ }
+
+ /* No criteria met */
+ return false;
+}
+
/* Sanity Validation ------------------------------------ */
static bool nla_editbone_name_check(void *arg, const char *name)