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:
authorJoshua Leung <aligorith@gmail.com>2009-10-16 16:08:47 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-16 16:08:47 +0400
commitf6494ff3cf132e326cd18b4ec74b9d9ee61406fa (patch)
treecdd953ed1a304c1c32e9f01457a0eb820d0296e8 /source/blender/blenkernel/intern/key.c
parent6846abb2cae3efd3e5b9943d7eba3423cbef9da3 (diff)
ShapeKey Editor (sub-mode of DopeSheet Editor)
Special priority request from Durian team to get this sub-editor of the DopeSheet Editor restored. Originally I was kindof planning to drop it, but obviously it still has a role! It now supports all the modern features that the DopeSheet supports, complete with selection, muting, locking, DopeSheet summary, and all the other tools that you know and love from the other views. Also, this no longer uses the old hacky sliders that 2.4x used (instead it uses RNA-based ones), so should function just the same as other DopeSheet views).
Diffstat (limited to 'source/blender/blenkernel/intern/key.c')
-rw-r--r--source/blender/blenkernel/intern/key.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index b6e4ffd6cc3..3fffdef478b 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -35,6 +35,8 @@
#include "MEM_guardedalloc.h"
+#include "BLI_blenlib.h"
+
#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
@@ -57,7 +59,7 @@
#include "BKE_object.h"
#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
+#include "RNA_access.h"
#ifdef HAVE_CONFIG_H
@@ -1489,3 +1491,24 @@ KeyBlock *key_get_named_keyblock(Key *key, const char name[])
return NULL;
}
+
+/* Get RNA-Path for 'value' setting of the given ShapeKey
+ * NOTE: the user needs to free the returned string once they're finishe with it
+ */
+char *key_get_curValue_rnaPath(Key *key, KeyBlock *kb)
+{
+ PointerRNA ptr;
+ PropertyRNA *prop;
+
+ /* sanity checks */
+ if ELEM(NULL, key, kb)
+ return NULL;
+
+ /* create the RNA pointer */
+ RNA_pointer_create(key, &RNA_ShapeKey, kb, &ptr);
+ /* get pointer to the property too */
+ prop= RNA_struct_find_property(&ptr, "value");
+
+ /* return the path */
+ return RNA_path_from_ID_to_property(&ptr, prop);
+}