[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11335] branches/soc-2007-mosani/source/ blender: Worked on setting up plugin system:

Aaron Moore two.a.ron at gmail.com
Sun Jul 22 18:55:09 CEST 2007


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

Log Message:
-----------
Worked on setting up plugin system:
 1. GUI
   a. user defined plugin scan folder
     b. dynamicly generated render engine menu
 2. Plugin Registration
   a. created the necessary types an functions
   b. created a test plugin
   c. successfully registered test plugin
 3. Plugin Integration
   a. had blender calling plugin callbacks working, but it
      broke due to redesign in dialogue with Peter Schlaile,
      the plugin api developer.
   b. worked on accessing the API from the callbacks, no luck yet.

If someone could help me solve the problems with the dynamic libraries
 I would most appreciate it. I don't have a lot of experience here.
 Having the 'Integration' problems solved (accessing callbacks from
 blender, and the render api from the callbacks) will siginficantly
 facilitate progress this week, so I'd like to have this happen as
 soon as possible.
 
Also, I can't really work on the 3b until 3a is done.
      

Modified Paths:
--------------
    branches/soc-2007-mosani/source/blender/blenkernel/BKE_global.h
    branches/soc-2007-mosani/source/blender/blenpluginapi/PLU_types.h
    branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c
    branches/soc-2007-mosani/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c
    branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI.h
    branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI_internal.h
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_camera.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_context.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_geometry.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_internal.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_light.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_mesh.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_object.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/RND_settings.c
    branches/soc-2007-mosani/source/blender/render/render_api/source/test.c
    branches/soc-2007-mosani/source/blender/src/buttons_scene.c

Added Paths:
-----------
    branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/
    branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/SConstruct
    branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c

Modified: branches/soc-2007-mosani/source/blender/blenkernel/BKE_global.h
===================================================================
--- branches/soc-2007-mosani/source/blender/blenkernel/BKE_global.h	2007-07-22 16:32:42 UTC (rev 11334)
+++ branches/soc-2007-mosani/source/blender/blenkernel/BKE_global.h	2007-07-22 16:55:09 UTC (rev 11335)
@@ -151,6 +151,7 @@
 	/* TEMPORARY TOGGLE FOR RENDER API BETWEEN CURRENT AND NEW SYSTEM */
 	char renderAPI_toggle;
 	/* END TEMPORARY TOGGLE */
+	char renderer_menu[512];
 
 } Global;
 

Modified: branches/soc-2007-mosani/source/blender/blenpluginapi/PLU_types.h
===================================================================
--- branches/soc-2007-mosani/source/blender/blenpluginapi/PLU_types.h	2007-07-22 16:32:42 UTC (rev 11334)
+++ branches/soc-2007-mosani/source/blender/blenpluginapi/PLU_types.h	2007-07-22 16:55:09 UTC (rev 11335)
@@ -406,6 +406,7 @@
 /* External Renderer Plugins: */
 
 typedef struct plugin_interface_render_output_t {
+	int renderer_index;
 	void (*setup)( RNDScene scene );
 	void (*render_frame)( RNDScene scene, RNDResult result );
 	void (*finish)();
@@ -474,7 +475,7 @@
 
 		plugin_interface_audio_resampler_t audio_res;
 		plugin_interface_audio_output_device_t audio_out_dev;
-
+		
 		/*
 		plugin_interface_subtitle_input_t subtitle_in;
 		plugin_interface_subtitle_effect_t subtitle_eff;

Modified: branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c
===================================================================
--- branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c	2007-07-22 16:32:42 UTC (rev 11334)
+++ branches/soc-2007-mosani/source/blender/blenpluginapi/intern/pluginapi.c	2007-07-22 16:55:09 UTC (rev 11335)
@@ -623,9 +623,11 @@
 
 	if (query_func) {
 		query_func();
+		
+		if (plugin_scan_mode) {
+			PIL_dynlib_close(h);
+		}
 
-		PIL_dynlib_close(h);
-
 		return;
 	} 
 
@@ -1504,6 +1506,8 @@
 	plugin_control_t * rv = (plugin_control_t*) callocN(
 		sizeof(plugin_control_t), "plugin control");
 	
+	load_plugin_descriptor(d);
+	
 	strncpy(rv->name, d->name, sizeof(rv->name)-1);
 	rv->name[sizeof(rv->name)-1] = 0;
 
@@ -1535,6 +1539,7 @@
 	if (!c->descriptor) {
 		return 0;
 	}
+	load_plugin_descriptor(c->descriptor);
 	c->uplink = uplink;
 	c->uplink_handler = uplink_handler;
 	c->instance = c->descriptor->common.load(c);

Modified: branches/soc-2007-mosani/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2007-mosani/source/blender/makesdna/DNA_scene_types.h	2007-07-22 16:32:42 UTC (rev 11334)
+++ branches/soc-2007-mosani/source/blender/makesdna/DNA_scene_types.h	2007-07-22 16:55:09 UTC (rev 11335)
@@ -231,7 +231,6 @@
 	/* render engine, octree resolution */
 	short renderer, ocres, rpad[2];
 	char *plugin_renderer_name;
-	struct plugin_control_t *plugin_renderer;
 
 	/**
 	 * What to do with the sky/background. Picks sky/premul/key

Modified: branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c	2007-07-22 16:32:42 UTC (rev 11334)
+++ branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c	2007-07-22 16:55:09 UTC (rev 11335)
@@ -2154,7 +2154,9 @@
 	}
 	
 	/* renderer */
-	if(!ELEM(re->r.renderer, R_INTERN, R_YAFRAY)) {
+	if( !ELEM(re->r.renderer, R_INTERN, R_YAFRAY) && 
+			!RenderAPI_has_plugin_renderer( &re->r ) )
+	{
 		re->error("Unknown render engine set");
 		return 0;
 	}

Added: branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/SConstruct
===================================================================
--- branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/SConstruct	                        (rev 0)
+++ branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/SConstruct	2007-07-22 16:55:09 UTC (rev 11335)
@@ -0,0 +1,34 @@
+
+###################################
+# Compilation variables to modify.
+###################################
+
+library_name = "aqsis"
+library_sources = ["aqsis.c"]
+
+include_paths = [".", "../../../blenpluginapi", "../include"]
+compiler_flags = '-g'
+linker_flags = '-g'
+
+#######################################
+# END Compilation variables to modify.
+#######################################
+
+
+
+#########
+# SETUP #
+#########
+
+# Set up our compile environment.
+env = Environment( CCFLAGS = compiler_flags, LINKFLAGS = linker_flags, CPPPATH = include_paths )
+
+
+
+###########
+# COMPILE #
+###########
+
+env.SharedLibrary( library_name, library_sources )
+
+


Property changes on: branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/SConstruct
___________________________________________________________________
Name: svn:executable
   + *

Added: 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	                        (rev 0)
+++ branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c	2007-07-22 16:55:09 UTC (rev 11335)
@@ -0,0 +1,37 @@
+
+/* A test renderer plugin */
+
+#include <stdio.h>
+#include "plugin.h"
+#include "RenderAPI.h"
+
+static void setup( RNDScene scene )
+{
+	fprintf( stderr, "simple test\n" );
+}
+static void render_frame( RNDScene scene, RNDResult result ){}
+
+extern void finish()
+{
+	fprintf( stderr, "simple test\n" );
+}
+
+static void abort_callback(){}
+
+plugin_instance_t* init( plugin_control_t *c ){ return NULL; }
+void free_renderer( plugin_instance_t *This ){}
+
+void plugin_query()
+{
+	plugin_register_render_output(
+		"Aqsis Plugin",
+		"Aqsis",
+		"mosani, and others?",
+		"GPL",
+		"Help.",
+		"14 July 2007",
+		0,
+		init, init, free_renderer,
+		setup, render_frame, finish, abort_callback );
+}
+


Property changes on: branches/soc-2007-mosani/source/blender/render/render_api/aqsis_plugin/aqsis.c
___________________________________________________________________
Name: svn:executable
   + *

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-07-22 16:32:42 UTC (rev 11334)
+++ branches/soc-2007-mosani/source/blender/render/render_api/include/RenderAPI.h	2007-07-22 16:55:09 UTC (rev 11335)
@@ -34,8 +34,9 @@
 
 #ifndef RENDER_API_H
 #define RENDER_API_H
-
 
+#include "externdef.h"
+
 /****************************************************************************/
 /********************************   Types   *********************************/
 /****************************************************************************/
@@ -69,12 +70,12 @@
 
 /** Get or set the current frame. This is for motion blur calculations. */
 
-float RND_get_current_frame( RNDScene scene );
-void RND_set_current_frame( RNDScene scene, float new_frame );
+LIBEXPORT float RND_get_current_frame( RNDScene scene );
+LIBEXPORT void RND_set_current_frame( RNDScene scene, float new_frame );
 
 /** Offsets the current frame by offset. */
 
-void RND_set_frame_offset( RNDScene scene, float offset );
+LIBEXPORT void RND_set_frame_offset( RNDScene scene, float offset );
 
 /** 
     Functions for dealing with the render layers. Render layers
@@ -82,9 +83,9 @@
     with ints.
 */
 
-int RND_get_render_layer_count( RNDScene scene );
-int RND_get_render_layer( RNDScene scene );
-void RND_set_render_layer( RNDScene scene, int new_layer );
+LIBEXPORT int RND_get_render_layer_count( RNDScene scene );
+LIBEXPORT int RND_get_render_layer( RNDScene scene );
+LIBEXPORT void RND_set_render_layer( RNDScene scene, int new_layer );
 
 /* ------------------------------------------------------------------------ */
 /* ----------------------------  settings  -------------------------------- */
@@ -100,7 +101,7 @@
 RND_SAMPLE_BOX
 } RND_SAMPLE_TYPE;
 
-int RND_is_animation( RNDScene scene );
+LIBEXPORT int RND_is_animation( RNDScene scene );
 int RND_has_motion_blur( RNDScene scene );
 
 int RND_get_image_width( RNDScene scene );
@@ -116,13 +117,13 @@
 /* ------------------------------------------------------------------------ */
 
 /** Returns true if perspective, false if orthagonal. */
-int RND_is_perspective( RNDScene scene );
+LIBEXPORT int RND_is_perspective( RNDScene scene );
 
-float RND_get_lens( RNDScene scene );
-float RND_get_scale( RNDScene scene );
-float RND_get_clipping_start( RNDScene scene );
-float RND_get_clipping_end( RNDScene scene );
-float RND_get_depth_of_field( RNDScene scene );
+LIBEXPORT float RND_get_lens( RNDScene scene );
+LIBEXPORT float RND_get_scale( RNDScene scene );
+LIBEXPORT float RND_get_clipping_start( RNDScene scene );
+LIBEXPORT float RND_get_clipping_end( RNDScene scene );
+LIBEXPORT float RND_get_depth_of_field( RNDScene scene );
 
 /* ------------------------------------------------------------------------ */
 /* ----------------------------  object  ---------------------------------- */
@@ -166,13 +167,13 @@
     Gets an index of all objects
     type is a bitwise-or composition of zero or more of the above 
 */
-RNDObject RND_get_objects( RNDScene scene, unsigned int type );
-RNDObject RND_get_instanced_objects( RNDScene scene, unsigned int type );
-int RND_object_is_instance( RNDObject object );
+LIBEXPORT RNDObject RND_get_objects( RNDScene scene, unsigned int type );
+LIBEXPORT RNDObject RND_get_instanced_objects( RNDScene scene, unsigned int type );
+LIBEXPORT int RND_object_is_instance( RNDObject object );
 
-char* RND_object_get_name( RNDObject object );
-RND_DATATYPE RND_object_get_type( RNDObject object );
-void RND_object_get_transformation( RNDObject object, 
+LIBEXPORT char* RND_object_get_name( RNDObject object );
+LIBEXPORT RND_DATATYPE RND_object_get_type( RNDObject object );
+LIBEXPORT void RND_object_get_transformation( RNDObject object, 
 	float transformation[][4] );
 
 /** 
@@ -180,101 +181,101 @@
     of the x, y, and z components.
 */
 
-void RND_object_traslation( RNDObject object, float translation[] );
-void RND_object_rotation( RNDObject object, float rotation[] );
-void RND_object_scale( RNDObject object, float scale[] );
-void RND_object_shear( RNDObject object, float shear[] );

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list