[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52791] trunk/blender/source/blender/ editors: Fix #33423: a few operators still allowed changing current frame during
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Dec 6 06:48:59 CET 2012
Revision: 52791
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52791
Author: blendix
Date: 2012-12-06 05:48:51 +0000 (Thu, 06 Dec 2012)
Log Message:
-----------
Fix #33423: a few operators still allowed changing current frame during
animation render, like cursor set in the graph editor, disabled that now.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_action/action_edit.c
trunk/blender/source/blender/editors/space_graph/graph_edit.c
trunk/blender/source/blender/editors/space_graph/graph_ops.c
trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
Modified: trunk/blender/source/blender/editors/space_action/action_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/action_edit.c 2012-12-06 03:09:06 UTC (rev 52790)
+++ trunk/blender/source/blender/editors/space_action/action_edit.c 2012-12-06 05:48:51 UTC (rev 52791)
@@ -52,6 +52,7 @@
#include "BKE_action.h"
#include "BKE_fcurve.h"
+#include "BKE_global.h"
#include "BKE_nla.h"
#include "BKE_context.h"
#include "BKE_report.h"
@@ -1308,6 +1309,15 @@
/* ***************** Jump to Selected Frames Operator *********************** */
+static int actkeys_framejump_poll(bContext *C)
+{
+ /* prevent changes during render */
+ if (G.is_rendering)
+ return 0;
+
+ return ED_operator_action_active(C);
+}
+
/* snap current-frame indicator to 'average time' of selected keyframe */
static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
{
@@ -1361,7 +1371,7 @@
/* api callbacks */
ot->exec = actkeys_framejump_exec;
- ot->poll = ED_operator_action_active;
+ ot->poll = actkeys_framejump_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
Modified: trunk/blender/source/blender/editors/space_graph/graph_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_edit.c 2012-12-06 03:09:06 UTC (rev 52790)
+++ trunk/blender/source/blender/editors/space_graph/graph_edit.c 2012-12-06 05:48:51 UTC (rev 52791)
@@ -56,6 +56,7 @@
#include "BLF_translation.h"
#include "BKE_fcurve.h"
+#include "BKE_global.h"
#include "BKE_nla.h"
#include "BKE_context.h"
#include "BKE_report.h"
@@ -1763,6 +1764,15 @@
/* ***************** Jump to Selected Frames Operator *********************** */
+static int graphkeys_framejump_poll(bContext *C)
+{
+ /* prevent changes during render */
+ if (G.is_rendering)
+ return 0;
+
+ return graphop_visible_keyframes_poll(C);
+}
+
/* snap current-frame indicator to 'average time' of selected keyframe */
static int graphkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
{
@@ -1829,7 +1839,7 @@
/* api callbacks */
ot->exec = graphkeys_framejump_exec;
- ot->poll = graphop_visible_keyframes_poll;
+ ot->poll = graphkeys_framejump_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
Modified: trunk/blender/source/blender/editors/space_graph/graph_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_ops.c 2012-12-06 03:09:06 UTC (rev 52790)
+++ trunk/blender/source/blender/editors/space_graph/graph_ops.c 2012-12-06 05:48:51 UTC (rev 52791)
@@ -39,6 +39,7 @@
#include "BLI_utildefines.h"
#include "BKE_context.h"
+#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_sound.h"
@@ -66,6 +67,15 @@
* 2) Value Indicator (stored per Graph Editor instance)
*/
+static int graphview_cursor_poll(bContext *C)
+{
+ /* prevent changes during render */
+ if (G.is_rendering)
+ return 0;
+
+ return ED_operator_graphedit_active(C);
+}
+
/* Set the new frame number */
static void graphview_cursor_apply(bContext *C, wmOperator *op)
{
@@ -172,7 +182,7 @@
ot->exec = graphview_cursor_exec;
ot->invoke = graphview_cursor_invoke;
ot->modal = graphview_cursor_modal;
- ot->poll = ED_operator_graphedit_active;
+ ot->poll = graphview_cursor_poll;
/* flags */
ot->flag = OPTYPE_BLOCKING | OPTYPE_UNDO;
Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c 2012-12-06 03:09:06 UTC (rev 52790)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c 2012-12-06 05:48:51 UTC (rev 52791)
@@ -2405,6 +2405,15 @@
return change;
}
+static int sequencer_strip_jump_poll(bContext *C)
+{
+ /* prevent changes during render */
+ if (G.is_rendering)
+ return 0;
+
+ return sequencer_edit_poll(C);
+}
+
/* jump frame to edit point operator */
static int sequencer_strip_jump_exec(bContext *C, wmOperator *op)
{
@@ -2431,7 +2440,7 @@
/* api callbacks */
ot->exec = sequencer_strip_jump_exec;
- ot->poll = sequencer_edit_poll;
+ ot->poll = sequencer_strip_jump_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
More information about the Bf-blender-cvs
mailing list