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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-06-16 13:32:50 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-06-16 14:16:05 +0300
commit3e086af79ceb38345eed1c76472eb6fc8cfc1196 (patch)
tree19630b47cc3459f49d8313acd2f3b4521f1769c9 /source/blender/editors/space_graph/graph_utils.c
parent985f33719ce9108d35d5f37b4c7c79d81f708a0d (diff)
Drivers: fix Variable Copy & Paste in the edit popover.
Without these buttons the functionality of the popover is incomplete compared to the Graph Editor panel. To support this the operators have to read the active F-Curve from the context, instead of directly scanning animation data. Expanding the context would also help Python operators.
Diffstat (limited to 'source/blender/editors/space_graph/graph_utils.c')
-rw-r--r--source/blender/editors/space_graph/graph_utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c
index d582ac557fa..b95ab48189c 100644
--- a/source/blender/editors/space_graph/graph_utils.c
+++ b/source/blender/editors/space_graph/graph_utils.c
@@ -44,6 +44,8 @@
#include "ED_screen.h"
#include "UI_interface.h"
+#include "RNA_access.h"
+
#include "graph_intern.h" // own include
/* ************************************************************** */
@@ -278,6 +280,14 @@ bool graphop_active_fcurve_poll(bContext *C)
return has_fcurve;
}
+/* has active F-Curve in the context that's editable */
+bool graphop_active_editable_fcurve_ctx_poll(bContext *C)
+{
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "active_editable_fcurve", &RNA_FCurve);
+
+ return ptr.data != NULL;
+}
+
/* has selected F-Curve that's editable */
bool graphop_selected_fcurve_poll(bContext *C)
{