On anim-render, a click in timeline stopped render completely.

The reason for this was a bit wacko code to cope with frame-step 
feature (steps of multiple frames).

I thought of fixing that, but instead decided to block any operator 
in Blender to change a frame while a render is in progress. 
Both render engine and UI are accessing (writing to) the same 
data then, which is a bad conflict.

Still a serious weakness of threaded render, but I'll keep
trying to allow this as far as possible :)
This commit is contained in:
Ton Roosendaal
2011-04-07 15:48:33 +00:00
parent 545b0a483d
commit ba44bf522c
3 changed files with 21 additions and 6 deletions

View File

@@ -42,6 +42,7 @@
#include "DNA_scene_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_sound.h"
#include "UI_view2d.h"
@@ -64,6 +65,9 @@ static int change_frame_poll(bContext *C)
{
ScrArea *curarea= CTX_wm_area(C);
/* XXX temp? prevent changes during render */
if(G.rendering) return 0;
/* as long as there is an active area, and it isn't a Graph Editor
* (since the Graph Editor has its own version which does extra stuff),
* we're fine

View File

@@ -49,6 +49,7 @@
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_report.h"
@@ -108,6 +109,16 @@ int ED_operator_screenactive(bContext *C)
return 1;
}
/* XXX added this to prevent anim state to change during renders */
int ED_operator_screenactive_norender(bContext *C)
{
if(G.rendering) return 0;
if(CTX_wm_window(C)==NULL) return 0;
if(CTX_wm_screen(C)==NULL) return 0;
return 1;
}
static int screen_active_editable(bContext *C)
{
if(ED_operator_screenactive(C)) {
@@ -1716,7 +1727,7 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot)
ot->exec= frame_offset_exec;
ot->poll= ED_operator_screenactive;
ot->poll= ED_operator_screenactive_norender;
ot->flag= 0;
/* rna */
@@ -1766,7 +1777,7 @@ static void SCREEN_OT_frame_jump(wmOperatorType *ot)
ot->exec= frame_jump_exec;
ot->poll= ED_operator_screenactive;
ot->poll= ED_operator_screenactive_norender;
ot->flag= OPTYPE_UNDO;
/* rna */
@@ -1846,7 +1857,7 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
ot->exec= keyframe_jump_exec;
ot->poll= ED_operator_screenactive;
ot->poll= ED_operator_screenactive_norender;
ot->flag= OPTYPE_UNDO;
/* rna */
@@ -2886,7 +2897,7 @@ static void SCREEN_OT_animation_step(wmOperatorType *ot)
/* api callbacks */
ot->invoke= screen_animation_step;
ot->poll= ED_operator_screenactive;
ot->poll= ED_operator_screenactive_norender;
}
@@ -2943,7 +2954,7 @@ static void SCREEN_OT_animation_play(wmOperatorType *ot)
/* api callbacks */
ot->exec= screen_animation_play_exec;
ot->poll= ED_operator_screenactive;
ot->poll= ED_operator_screenactive_norender;
RNA_def_boolean(ot->srna, "reverse", 0, "Play in Reverse", "Animation is played backwards");
RNA_def_boolean(ot->srna, "sync", 0, "Sync", "Drop frames to maintain framerate");

View File

@@ -214,7 +214,7 @@ static SpaceLink *view3d_new(const bContext *C)
v3d->lens= 35.0f;
v3d->near= 0.01f;
v3d->far= 500.0f;
v3d->far= 1000.0f;
v3d->twflag |= U.tw_flag & V3D_USE_MANIPULATOR;
v3d->twtype= V3D_MANIP_TRANSLATE;