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:
authorMatt Ebb <matt@mke3.net>2010-01-27 08:42:17 +0300
committerMatt Ebb <matt@mke3.net>2010-01-27 08:42:17 +0300
commitde56a6384957d00c49d5e3846a8bcf7350e96daa (patch)
tree8baf5ad593ee61290e2cb8b02817d3096a647c34 /source/blender/blenkernel/intern/fcurve.c
parent0c77490cb48ad2052fe1ca9d540c7a9fd82c2fa6 (diff)
Fix [#20773] NODE ANIMATION: Animating node values broken
Now the compositing node tree will update on frame change if any of the nodes are animated. This doesn't work for playback (i.e. alt a), that's better off waiting until we have some kind of frame caching system.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r--source/blender/blenkernel/intern/fcurve.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 28de10a64f9..2084dc7ede7 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -284,6 +284,46 @@ int list_find_data_fcurves (ListBase *dst, ListBase *src, const char *dataPrefix
return matches;
}
+FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, int *driven)
+{
+ FCurve *fcu= NULL;
+
+ *driven= 0;
+
+ /* there must be some RNA-pointer + property combon */
+ if(prop && ptr->id.data && RNA_property_animateable(ptr, prop)) {
+ AnimData *adt= BKE_animdata_from_id(ptr->id.data);
+ char *path;
+
+ if(adt) {
+ if((adt->action && adt->action->curves.first) || (adt->drivers.first)) {
+ /* XXX this function call can become a performance bottleneck */
+ path= RNA_path_from_ID_to_property(ptr, prop);
+
+ if(path) {
+ /* animation takes priority over drivers */
+ if(adt->action && adt->action->curves.first)
+ fcu= list_find_fcurve(&adt->action->curves, path, rnaindex);
+
+ /* if not animated, check if driven */
+ if(!fcu && (adt->drivers.first)) {
+ fcu= list_find_fcurve(&adt->drivers, path, rnaindex);
+
+ if(fcu)
+ *driven= 1;
+ }
+
+ if(fcu && action)
+ *action= adt->action;
+
+ MEM_freeN(path);
+ }
+ }
+ }
+ }
+
+ return fcu;
+}
/* threshold for binary-searching keyframes - threshold here should be good enough for now, but should become userpref */
#define BEZT_BINARYSEARCH_THRESH 0.00001f