[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11345] branches/soc-2007-mosani/source/ blender: I have the code which fetches and calls the plugin callbacks

Aaron Moore two.a.ron at gmail.com
Mon Jul 23 07:18:18 CEST 2007


Revision: 11345
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11345
Author:   mosani
Date:     2007-07-23 07:18:18 +0200 (Mon, 23 Jul 2007)

Log Message:
-----------
I have the code which fetches and calls the plugin callbacks
 (setup, render_frame, finish, abort) written and working.

The callbacks still cannot access the render API functions.

Modified Paths:
--------------
    branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c
    branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_helpers.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_object.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/test.c

Modified: branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c
===================================================================
--- branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c	2007-07-23 03:53:33 UTC (rev 11344)
+++ branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c	2007-07-23 05:18:18 UTC (rev 11345)
@@ -340,7 +340,7 @@
 	freeN(d);
 }
 
-static void copy_descriptor(plugin_descriptor_t * src,
+static void move_descriptor(plugin_descriptor_t * src,
                            plugin_descriptor_t * dst)
 {
        if (dst->name) { freeN(dst->name); }

Modified: branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c	2007-07-23 03:53:33 UTC (rev 11344)
+++ branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c	2007-07-23 05:18:18 UTC (rev 11345)
@@ -5,17 +5,15 @@
 #include "plugin.h"
 #include "RenderAPI.h"
 
-static void setup( RNDScene scene )
+static void setup( RNDScene scene ){}
+static void render_frame( RNDScene scene, RNDResult result )
 {
-	fprintf( stderr, "simple test\n" );
+	/* Aqsis RIB Export */
+	/* FILE *aqsis_rib = fopen( "aqsis.rib", "w" ); */
+	RNDObject object = RND_get_objects( scene, RND_LIGHT );
+	/* fclose( aqsis_rib ); */
 }
-static void render_frame( RNDScene scene, RNDResult result ){}
-
-extern void finish()
-{
-	fprintf( stderr, "simple test\n" );
-}
-
+static void finish(){}
 static void abort_callback(){}
 
 plugin_instance_t* init( plugin_control_t *c ){ return NULL; }

Modified: branches/soc-2007-mosani/source/blender/render/render_api/source/RND_helpers.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/source/RND_helpers.c	2007-07-23 03:53:33 UTC (rev 11344)
+++ branches/soc-2007-mosani/source/blender/render/render_api/source/RND_helpers.c	2007-07-23 05:18:18 UTC (rev 11345)
@@ -55,9 +55,9 @@
 }
 
 void RenderAPI_free_scene( RNDScene scene ){
-	RNDObject object_free;
-	RNDGeometry geometry_free;
-	DerivedMesh *derived_mesh;
+	RNDObject object_free = NULL;
+	RNDGeometry geometry_free = NULL;
+	DerivedMesh *derived_mesh = NULL;
 	BLI_freelistN( &scene->objects );
 	BLI_freelistN( &scene->light_point );
 	BLI_freelistN( &scene->light_spot );

Modified: branches/soc-2007-mosani/source/blender/render/render_api/source/RND_object.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/source/RND_object.c	2007-07-23 03:53:33 UTC (rev 11344)
+++ branches/soc-2007-mosani/source/blender/render/render_api/source/RND_object.c	2007-07-23 05:18:18 UTC (rev 11345)
@@ -37,6 +37,8 @@
 	RNDObject object = MEM_mallocN( sizeof(RenderAPIObject), 
 		"renderAPI object" );
 	RenderAPI_empty_list( &object->list );
+	RenderAPI_empty_list( &object->lights );
+	RenderAPI_empty_list( &object->geometry );
 	if( type & RND_LIGHT_POINT )
 		RenderAPI_copy_index( &object->list, &scene->light_point );
 	if( type & RND_LIGHT_SPOT )
@@ -73,6 +75,8 @@
 	RNDObject object = MEM_mallocN( sizeof(RenderAPIObject), 
 		"renderAPI object" );
 	RenderAPI_empty_list( &object->list );
+	RenderAPI_empty_list( &object->lights );
+	RenderAPI_empty_list( &object->geometry );
 	
 	/* loop through originals */
 	old_item = scene->originals.first;

Modified: branches/soc-2007-mosani/source/blender/render/render_api/source/test.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/source/test.c	2007-07-23 03:53:33 UTC (rev 11344)
+++ branches/soc-2007-mosani/source/blender/render/render_api/source/test.c	2007-07-23 05:18:18 UTC (rev 11345)
@@ -11,7 +11,6 @@
 
 /* currently it can be accessed by toggling on render api and hitting render */
 void RenderAPI_test(){
-	/* Test Variables.
 	RNDObject object;
 	RNDLight light;
 	RNDGeometry geometry;
@@ -22,9 +21,10 @@
 	char name[30];
 	float color[3], coordinates[3];
 	static int i = 0;
-	int j, k, indices[2]; */
+	int j, k, indices[2];
 	
 	static Scene *new_scene = NULL;
+	RNDResult result;
 	RNDScene scene = RenderAPI_create_scene( G.scene );
 	RenderAPI_create_object_indexes( scene );
 	
@@ -102,6 +102,7 @@
 	}
 	*/
 	
+	/* Test 3: Pipeline Fetch Plugin Callbacks */
 	plugin_descriptor_t *renderer_descriptor;
 	plugin_control_t *renderer_control;
 	
@@ -113,8 +114,9 @@
 		renderer_control = plugin_init_control( renderer_descriptor, NULL, NULL, 
 			PLP_STRING, "name", "renderer control", PLP_END );
 		
-		renderer_control->descriptor->i.render_out.finish();
+		renderer_control->descriptor->i.render_out.render_frame(scene,result);
 	}
+	
 	RenderAPI_free_scene( scene );
 }
 





More information about the Bf-blender-cvs mailing list