[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43227] trunk/blender/source/blender: fix an error rendering opengl weightpaint data wasn' t working when python initialized opengl render on startup ( needed for testing script).

Campbell Barton ideasman42 at gmail.com
Mon Jan 9 03:50:10 CET 2012


Revision: 43227
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43227
Author:   campbellbarton
Date:     2012-01-09 02:50:09 +0000 (Mon, 09 Jan 2012)
Log Message:
-----------
fix an error rendering opengl weightpaint data wasn't working when python initialized opengl render on startup (needed for testing script).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/ED_view3d.h
    trunk/blender/source/blender/editors/render/render_opengl.c
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/editors/include/ED_view3d.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_view3d.h	2012-01-09 00:26:33 UTC (rev 43226)
+++ trunk/blender/source/blender/editors/include/ED_view3d.h	2012-01-09 02:50:09 UTC (rev 43227)
@@ -287,7 +287,8 @@
 int ED_view3d_lock(struct RegionView3D *rv3d);
 
 uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
-uint64_t ED_viewedit_datamask(struct bScreen *screen);
+uint64_t ED_view3d_screen_datamask(struct bScreen *screen);
+uint64_t ED_view3d_object_datamask(struct Scene *scene);
 
 /* camera lock functions */
 int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d);

Modified: trunk/blender/source/blender/editors/render/render_opengl.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_opengl.c	2012-01-09 00:26:33 UTC (rev 43226)
+++ trunk/blender/source/blender/editors/render/render_opengl.c	2012-01-09 02:50:09 UTC (rev 43227)
@@ -309,7 +309,13 @@
 		oglrender->rv3d= CTX_wm_region_view3d(C);
 
 		/* MUST be cleared on exit */
-		oglrender->scene->customdata_mask_modal= ED_view3d_datamask(oglrender->scene, oglrender->v3d);
+		oglrender->scene->customdata_mask_modal = (ED_view3d_datamask(oglrender->scene, oglrender->v3d) |
+		                                           ED_view3d_object_datamask(oglrender->scene) );
+
+		/* apply immediately incase we're rendeing from a script,
+		 * running notifiers again will overwrite */
+		oglrender->scene->customdata_mask |= oglrender->scene->customdata_mask_modal;
+
 	}
 
 	/* create render */

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2012-01-09 00:26:33 UTC (rev 43226)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2012-01-09 02:50:09 UTC (rev 43227)
@@ -2251,33 +2251,47 @@
 
 	return mask;
 }
+
+CustomDataMask ED_view3d_object_datamask(Scene *scene)
+{
+	Object *ob= scene->basact ? scene->basact->object : NULL;
+	CustomDataMask mask= 0;
+
+	if (ob) {
+		/* check if we need tfaces & mcols due to face select or texture paint */
+		if (paint_facesel_test(ob) || (ob->mode & OB_MODE_TEXTURE_PAINT)) {
+			mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
+		}
+
+		/* check if we need mcols due to vertex paint or weightpaint */
+		if (ob->mode & OB_MODE_VERTEX_PAINT) {
+			mask |= CD_MASK_MCOL;
+		}
+
+		if (ob->mode & OB_MODE_WEIGHT_PAINT) {
+			mask |= CD_MASK_WEIGHT_MCOL;
+		}
+	}
+
+	return mask;
+}
+
 /* goes over all modes and view3d settings */
-CustomDataMask ED_viewedit_datamask(bScreen *screen)
+CustomDataMask ED_view3d_screen_datamask(bScreen *screen)
 {
 	Scene *scene= screen->scene;
-	Object *ob= scene->basact ? scene->basact->object : NULL;
 	CustomDataMask mask = CD_MASK_BAREMESH;
 	ScrArea *sa;
 	
-	/* check if we need tfaces & mcols due to face select or texture paint */
-	if(paint_facesel_test(ob) || (ob && ob->mode & OB_MODE_TEXTURE_PAINT))
-		mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
-	
 	/* check if we need tfaces & mcols due to view mode */
 	for(sa = screen->areabase.first; sa; sa = sa->next) {
 		if(sa->spacetype == SPACE_VIEW3D) {
 			mask |= ED_view3d_datamask(scene, (View3D *)sa->spacedata.first);
 		}
 	}
-	
-	/* check if we need mcols due to vertex paint or weightpaint */
-	if(ob) {
-		if(ob->mode & OB_MODE_VERTEX_PAINT)
-			mask |= CD_MASK_MCOL;
-		if(ob->mode & OB_MODE_WEIGHT_PAINT)
-			mask |= CD_MASK_WEIGHT_MCOL;
-	}
 
+	mask |= ED_view3d_object_datamask(scene);
+
 	return mask;
 }
 

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2012-01-09 00:26:33 UTC (rev 43226)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2012-01-09 02:50:09 UTC (rev 43227)
@@ -282,7 +282,7 @@
 	
 	/* combine datamasks so 1 win doesn't disable UV's in another [#26448] */
 	for(win= wm->windows.first; win; win= win->next) {
-		win_combine_v3d_datamask |= ED_viewedit_datamask(win->screen);
+		win_combine_v3d_datamask |= ED_view3d_screen_datamask(win->screen);
 	}
 
 	/* cached: editor refresh callbacks now, they get context */



More information about the Bf-blender-cvs mailing list