diff options
author | Ton Roosendaal <ton@blender.org> | 2011-04-07 19:48:33 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-04-07 19:48:33 +0400 |
commit | ba44bf522cd098c8568a8dea4218b91b8d161191 (patch) | |
tree | 254f4a03b62021e0f4252c8032c913c846482214 | |
parent | 545b0a483dc62c61181c0a0683646c4532f1661e (diff) |
Bugfix #26812
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 :)
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 21 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 2 |
3 files changed, 21 insertions, 6 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index a2579613297..ff9521f1ebd 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -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 diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 02b25562545..901f3d7c5f1 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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"); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 72d7977e132..a8cdc99645d 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -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; |