[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21120] branches/soc-2009-yukishiro/source /blender: 1.

Jingyuan Huang jingyuan.huang at gmail.com
Wed Jun 24 05:16:44 CEST 2009


Revision: 21120
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21120
Author:   yukishiro
Date:     2009-06-24 05:16:42 +0200 (Wed, 24 Jun 2009)

Log Message:
-----------
1. Use aoenergy to adjust lightness/darkness of lightenv in the final rendering
2. Fix a bug for displaying light paint in multiple view3d spaces.

Modified Paths:
--------------
    branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/space_view3d.c
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2009-yukishiro/source/blender/render/intern/source/occlusion.c

Modified: branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c	2009-06-24 02:11:36 UTC (rev 21119)
+++ branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c	2009-06-24 03:16:42 UTC (rev 21120)
@@ -373,7 +373,6 @@
 		return OPERATOR_FINISHED;
 	}
 	
-	// TODO: need to signal/flag if the paint is for the entire scene or just the active object
 	if(totface >= MAXINDEX) {
 		ob= CTX_data_active_object(C);
 		me= get_mesh(ob);
@@ -391,7 +390,7 @@
 	}
 	
 	if(G.f & G_LIGHTPAINT) {
-	        G.f &= ~G_LIGHTPAINT;
+		G.f &= ~G_LIGHTPAINT;
 		if(lp) {
 			toggle_paint_cursor(C);
 			lp->paintcursor= NULL;
@@ -404,7 +403,7 @@
 		
 		if(lp==NULL)
 			lp= scene->toolsettings->lpaint= new_lpaint();
-	
+
 		toggle_paint_cursor(C);
 		brush_check_exists(&scene->toolsettings->lpaint->brush);
 	}
@@ -570,9 +569,9 @@
 	ToolSettings *ts= CTX_data_tool_settings(C);
 	VPaint *lp= ts->lpaint;
 	PaintOperation *pop= op->customdata;
-        PaintStroke *ps = (PaintStroke*)lp->lpaint_data.last;
+	PaintStroke *ps = (PaintStroke*)lp->lpaint_data.last;
 	ViewContext *vc= &pop->vc;
-        Scene *scene= vc->scene;
+	Scene *scene= vc->scene;
 	Object *ob= vc->obact;
 
 	switch(event->type) {

Modified: branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c	2009-06-24 02:11:36 UTC (rev 21119)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c	2009-06-24 03:16:42 UTC (rev 21120)
@@ -2430,7 +2430,12 @@
 			draw_mesh_object_outline(v3d, ob, dm);
 
 		if (G.f & G_LIGHTPAINT) {
-			if (rv3d->rflag & RV3D_SHRESULT) {
+			if (!(scene->flag & SCE_SH_RESULT)) {
+				if (rv3d->rflag & RV3D_SHRESULT) {
+					scene->flag |= SCE_SH_RESULT;
+				}
+			}
+			if (scene->flag & SCE_SH_RESULT) {
 				shcol= DM_get_face_data_layer(dm, CD_SH_MCOL);
 				
 				if (rv3d->rflag & RV3D_RECALCMCOL) {

Modified: branches/soc-2009-yukishiro/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_view3d/space_view3d.c	2009-06-24 02:11:36 UTC (rev 21119)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_view3d/space_view3d.c	2009-06-24 03:16:42 UTC (rev 21120)
@@ -408,7 +408,6 @@
 			switch(wmn->data) {
 				case ND_SHADING_DRAW:
 					rv3d = ar->regiondata;
-					rv3d->rflag |= RV3D_SHRESULT;
 					rv3d->rflag |= RV3D_RECALCMCOL;
 					ED_region_tag_redraw(ar);
 					break;
@@ -419,13 +418,13 @@
 					ED_region_tag_redraw(ar);
 					break;
 			}
-		case NC_IMAGE:	
+		case NC_IMAGE:
 			/* this could be more fine grained checks if we had
 			 * more context than just the region */
 			ED_region_tag_redraw(ar);
 			break;
-		case NC_LIGHTENV:	
-                        rv3d = ar->regiondata;
+		case NC_LIGHTENV:
+			rv3d = ar->regiondata;
 			
 			switch(wmn->data) {
 				case ND_SH_RESULT:

Modified: branches/soc-2009-yukishiro/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2009-yukishiro/source/blender/makesdna/DNA_scene_types.h	2009-06-24 02:11:36 UTC (rev 21119)
+++ branches/soc-2009-yukishiro/source/blender/makesdna/DNA_scene_types.h	2009-06-24 03:16:42 UTC (rev 21120)
@@ -844,6 +844,7 @@
 /* sce->flag */
 #define SCE_DS_SELECTED			(1<<0)
 #define SCE_DS_COLLAPSED		(1<<1)
+#define SCE_SH_RESULT			(1<<2)
 
 	/* return flag next_object function */
 #define F_ERROR			-1

Modified: branches/soc-2009-yukishiro/source/blender/render/intern/source/occlusion.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/render/intern/source/occlusion.c	2009-06-24 02:11:36 UTC (rev 21119)
+++ branches/soc-2009-yukishiro/source/blender/render/intern/source/occlusion.c	2009-06-24 03:16:42 UTC (rev 21120)
@@ -1303,6 +1303,7 @@
 			VECCOPY(bentnor, bn);
 			Mat4Mul3Vecfl(re->viewinv, bentnor);
 			SH_eval_color(skycol, re->scene->lightenv, bentnor);
+			VecMulf(skycol, re->wrld.aoenergy);
 		}
 
 		VecMulf(skycol, occlusion);





More information about the Bf-blender-cvs mailing list