[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36045] trunk/blender/source/blender/ editors: Bugfix #26812

Ton Roosendaal ton at blender.org
Thu Apr 7 17:48:33 CEST 2011


Revision: 36045
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36045
Author:   ton
Date:     2011-04-07 15:48:33 +0000 (Thu, 07 Apr 2011)
Log Message:
-----------
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 :)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_ops.c
    trunk/blender/source/blender/editors/screen/screen_ops.c
    trunk/blender/source/blender/editors/space_view3d/space_view3d.c

Modified: trunk/blender/source/blender/editors/animation/anim_ops.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_ops.c	2011-04-07 13:14:08 UTC (rev 36044)
+++ trunk/blender/source/blender/editors/animation/anim_ops.c	2011-04-07 15:48:33 UTC (rev 36045)
@@ -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 @@
 {
 	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

Modified: trunk/blender/source/blender/editors/screen/screen_ops.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screen_ops.c	2011-04-07 13:14:08 UTC (rev 36044)
+++ trunk/blender/source/blender/editors/screen/screen_ops.c	2011-04-07 15:48:33 UTC (rev 36045)
@@ -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 @@
 	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 @@
 	
 	ot->exec= frame_offset_exec;
 	
-	ot->poll= ED_operator_screenactive;
+	ot->poll= ED_operator_screenactive_norender;
 	ot->flag= 0;
 	
 	/* rna */
@@ -1766,7 +1777,7 @@
 	
 	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 @@
 	
 	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 @@
 	/* api callbacks */
 	ot->invoke= screen_animation_step;
 	
-	ot->poll= ED_operator_screenactive;
+	ot->poll= ED_operator_screenactive_norender;
 	
 }
 
@@ -2943,7 +2954,7 @@
 	/* 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");

Modified: trunk/blender/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2011-04-07 13:14:08 UTC (rev 36044)
+++ trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2011-04-07 15:48:33 UTC (rev 36045)
@@ -214,7 +214,7 @@
 	
 	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;




More information about the Bf-blender-cvs mailing list