[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11468] branches/soc-2007-mosani/source/ blender: This is a small commit attempting to solve an scons linking

Aaron Moore two.a.ron at gmail.com
Thu Aug 2 03:38:57 CEST 2007


Revision: 11468
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11468
Author:   mosani
Date:     2007-08-02 03:38:42 +0200 (Thu, 02 Aug 2007)

Log Message:
-----------
This is a small commit attempting to solve an scons linking
issues: adjusting the priorities of blenpluginapi and render
sconscript files.

A few more changes are my work in progress on getting image
data back into blender.

Modified Paths:
--------------
    branches/soc-2007-mosani/source/blender/blenpluginapi/SConscript
    branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c
    branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c
    branches/soc-2007-mosani/source/blender/render/intern/source/rendercallbacks.c
    branches/soc-2007-mosani/source/blender/render/render_api/include/RND_types.h
    branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI.h
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_internal.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_pass.c

Modified: branches/soc-2007-mosani/source/blender/blenpluginapi/SConscript
===================================================================
--- branches/soc-2007-mosani/source/blender/blenpluginapi/SConscript	2007-08-01 20:26:24 UTC (rev 11467)
+++ branches/soc-2007-mosani/source/blender/blenpluginapi/SConscript	2007-08-02 01:38:42 UTC (rev 11468)
@@ -12,4 +12,4 @@
 	defs.append('WITH_QUICKTIME')
 	incs += ' ' + env['BF_QUICKTIME_INC']
 
-env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'player'], priority = [75, 35] )
+env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'player'], priority = [10, 35] )

Modified: branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c	2007-08-01 20:26:24 UTC (rev 11467)
+++ branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c	2007-08-02 01:38:42 UTC (rev 11468)
@@ -148,10 +148,6 @@
 	db->lights.first = db->lights.last = NULL;        due to memset call all 
 	db->lampren.first = db->lampren.last = NULL;      of this does nothing */
 	
-	/* called here for the moment so that the linker will be
-	   able to find all the functions in RND_camera.c */
-	RND_is_perspective( scene );
-	
 	/* loop through all objects */
 	object = RND_get_objects( scene, RND_ALL );
 	for( ; RND_object_exists( object ); RND_object_next( object ) )

Modified: branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c	2007-08-01 20:26:24 UTC (rev 11467)
+++ branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c	2007-08-02 01:38:42 UTC (rev 11468)
@@ -254,7 +254,6 @@
    In blender we now use max 10 chars for pass, max 20 for layer */
 static char *get_pass_name(int passtype, int channel)
 {
-	
 	if(passtype == SCE_PASS_COMBINED) {
 		if(channel==-1) return "Combined";
 		if(channel==0) return "Combined.R";

Modified: branches/soc-2007-mosani/source/blender/render/intern/source/rendercallbacks.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/intern/source/rendercallbacks.c	2007-08-01 20:26:24 UTC (rev 11467)
+++ branches/soc-2007-mosani/source/blender/render/intern/source/rendercallbacks.c	2007-08-02 01:38:42 UTC (rev 11468)
@@ -97,8 +97,26 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "DNA_group_types.h"
+#include "DNA_image_types.h"
+#include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_userdef_types.h"
+
+#include "RE_pipeline.h"
+#include "radio.h"
+
 #include "PIL_time.h"
+#include "MEM_guardedalloc.h"
 
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_threads.h"
+
+#include "intern/openexr/openexr_multi.h"
+
 /* internal */
 #include "render_types.h"
 #include "renderdatabase.h"
@@ -112,10 +130,12 @@
 
 /* prototypes */
 static void threaded_tile_processor( RenderDatabase *db, RNDScene scene, 
-	RNDResult result );
+		RNDResult result );
 static RenderPart *render_database_find_next_part( RenderDatabase *db, int minx );
 static int render_display_draw_enabled( RenderDatabase *db );
 static void send_image_results( RNDResult result, RenderPart *part );
+static RenderResult *new_part_render_result( RenderDatabase *db, 
+		rcti *part_bounds, int crop, int savebuffers );
 
 void blender_internal_setup( RNDScene scene )
 {
@@ -127,7 +147,7 @@
 	RenderDatabase db;
 	
 	render_database_from_scene( &db, scene );
-	//threaded_tile_processor( &db, scene, result );
+	threaded_tile_processor( &db, scene, result );
 	render_database_free( &db );
 }
 
@@ -146,9 +166,8 @@
 	
 	/* need to return nicely all parts on esc */
 	if( !RND_stop_render() ) {
-		//pa->result= 
-		
-		/*new_render_result(&R, &pa->disprect, pa->crop, RR_USEMEM);*/
+		pa->result= new_part_render_result( &RDB, &pa->disprect, 
+			pa->crop, RR_USEMEM );
 
 		/*if(R.sss_points)
 			zbufshade_sss_tile(pa);
@@ -171,7 +190,7 @@
 }
 
 static void threaded_tile_processor( RenderDatabase *db, RNDScene scene, 
-	RNDResult result )
+		RNDResult result )
 {
 	ListBase threads;
 	RenderPart *pa, *nextpa;
@@ -233,8 +252,7 @@
 				
 				if(pa->result) {
 					
-					if( render_display_draw_enabled( &RDB ) )
-						send_image_results( result, pa );
+					send_image_results( result, pa );
 					/*	re->display_draw(pa->result, NULL);
 						
 					print_part_stats(re, pa); stats: current API hole
@@ -248,9 +266,7 @@
 			else {
 				rendering= 1;
 				if(pa->nr && pa->result && drawtimer>20) {
-				
-					if( render_display_draw_enabled( &RDB ) )
-						send_image_results( result, pa );
+					send_image_results( result, pa );
 					/* re->display_draw(pa->result, &pa->result->renrect);
 				*/
 					hasdrawn= 1;
@@ -310,22 +326,78 @@
 	return best;
 }
 
-static int render_display_draw_enabled( RenderDatabase *db )
+/* re->display_draw(pa->result, &pa->result->renrect); */
+static RenderResult *new_part_render_result( RenderDatabase *db, 
+		rcti *part_bounds, int crop, int savebuffers )
 {
-	/* don't show preprocess for previewrender sss */
-	if(db->sss_points)
-		return !(db->r.scemode & R_PREVIEWBUTS);
-	else
-		return 1;
+	RenderResult *rr;
+	RenderLayer *rl;
+	//SceneRenderLayer *srl;
+	int rectx, recty, nr;
+	
+	rectx= part_bounds->xmax - part_bounds->xmin;
+	recty= part_bounds->ymax - part_bounds->ymin;
+	
+	if(rectx<=0 || recty<=0)
+		return NULL;
+	
+	rr= MEM_callocN(sizeof(RenderResult), "new render result");
+	rr->rectx= rectx;
+	rr->recty= recty;
+	rr->renrect.xmin= 0;
+	rr->renrect.xmax= rectx-2*crop;
+	/* crop is one or two extra pixels rendered for filtering, 
+	   is used for merging and display too */
+	rr->crop= crop;
+	
+	/* tilerect is relative coordinates within 
+	   render disprect. do not subtract crop yet */
+	rr->tilerect.xmin= part_bounds->xmin - db->disprect.xmin;
+	rr->tilerect.xmax= part_bounds->xmax - db->disprect.xmax;
+	rr->tilerect.ymin= part_bounds->ymin - db->disprect.ymin;
+	rr->tilerect.ymax= part_bounds->ymax - db->disprect.ymax;
+	
+	if(savebuffers) {
+		rr->exrhandle= IMB_exr_get_handle();
+	}
+	
+	/* create one render layer as a container for the 
+	   passes included in this render job */
+	rl= MEM_callocN(sizeof(RenderLayer), "new render layer");
+	BLI_addtail(&rr->layers, rl);
+	
+	/* create the manditory combined pass */
+	rl->rectf= MEM_mapallocN(rectx*recty*sizeof(float)*4, "Combined rgba");
+	
+	/* note, this has to be in sync with scene.c */
+	rl->lay= (1<<20) -1;
+	rl->layflag= 0x7FFF;	/* solid ztra halo strand */
+	rl->passflag= SCE_PASS_COMBINED;
+	
+	db->r.actlay= 0;
+	
+	/* create other passes */
+	
+	/* border render; calculate offset for use in compositor. compo is centralized coords */
+	rr->xof= db->disprect.xmin + (db->disprect.xmax - db->disprect.xmin)/2 - db->winx/2;
+	rr->yof= db->disprect.ymin + (db->disprect.ymax - db->disprect.ymin)/2 - db->winy/2;
+	
+	return rr;
 }
 
 static void send_image_results( RNDResult result, RenderPart *part )
 {
 	RNDPass pass;
+	int bounds[4];
 	pass = RND_get_passes( result );
 	for( ; RND_pass_exists( pass ); RND_pass_next( pass ) )
-		if( RND_pass_get_type( pass ) == RND_PASS_RGBA );
+		if( RND_pass_get_type( pass ) == RND_PASS_RGBA ){
+			bounds[0] = part->disprect.xmin;
+			bounds[1] = part->disprect.xmax;
+			bounds[2] = part->disprect.ymin;
+			bounds[3] = part->disprect.ymax;
+			result->scene->render->display_draw(result->destination, NULL);
+			//RND_pass_send_data( pass, bounds, part->result->renlay->rectf );
+		}
 }
 
-/* re->display_draw(pa->result, &pa->result->renrect); */
-

Modified: branches/soc-2007-mosani/source/blender/render/render_api/include/RND_types.h
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/include/RND_types.h	2007-08-01 20:26:24 UTC (rev 11467)
+++ branches/soc-2007-mosani/source/blender/render/render_api/include/RND_types.h	2007-08-02 01:38:42 UTC (rev 11468)
@@ -40,6 +40,7 @@
 struct DerivedMesh;
 struct ListBase;
 struct RenderResult;
+struct RenderPass;
 
 /* internal */
 
@@ -186,28 +187,33 @@
 
 
 typedef struct RenderAPIResult{
+	struct RenderAPIScene *scene;
 	struct RenderResult *destination;
 	struct RenderResult *pushedresult; /* if render with single-layer 
 	                                      option, other rendered layers are 
 	                                      stored here */
+	/* list of RenderAPIPassHolders for each pass
+	   that is part of this render job */
+	struct ListBase passes;
 	
 	/* RNDPass handlers that have been generated */
-	struct ListBase passes;
+	struct ListBase pass_handlers;
 }RenderAPIResult;
 
 typedef struct RenderAPIPass{
 	struct RenderAPIPass *next, *prev;
-	struct RenderAPIRender *result;
+	struct RenderAPIResult *result;
 	
-	struct ListBase list;
+	struct ListBase *list;
 	struct RenderAPIPassHolder *current;
 }RenderAPIPass;
 
 typedef struct RenderAPIPassHolder{
 	struct RenderAPIPassHolder *next, *prev;
-	struct RenderAPIRender *result;
+	struct RenderAPIResult *result;
 	
-	unsigned int type;
+	float *buffer;
+	struct RenderPass *destination;
 }RenderAPIPassHolder;
 
 #endif

Modified: branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI.h
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI.h	2007-08-01 20:26:24 UTC (rev 11467)
+++ branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI.h	2007-08-02 01:38:42 UTC (rev 11468)
@@ -319,7 +319,7 @@
  *  (where r,g,b are channels and rxy one channel for a pixel at x,y)
  */
 
-void RND_pass_send_data( RNDPass pass, int bounds[], float *buffer[] );
+void RND_pass_send_data( RNDPass pass, int bounds[], float *buffer );
 
 /* 
  * A renderer may not support a given pass type. If this is the case,

Modified: branches/soc-2007-mosani/source/blender/render/render_api/source/RND_internal.c
===================================================================

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list