[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12894] trunk/blender/source/blender/ python: first pass prefixing PyC API variables with V24_ so the new api and old can co-exist , wont effect scripts

Campbell Barton ideasman42 at gmail.com
Sat Dec 15 20:23:55 CET 2007


Revision: 12894
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12894
Author:   campbellbarton
Date:     2007-12-15 20:23:55 +0100 (Sat, 15 Dec 2007)

Log Message:
-----------
first pass prefixing PyC API variables with V24_ so the new api and old can co-exist, wont effect scripts

Modified Paths:
--------------
    trunk/blender/source/blender/python/BPY_interface.c
    trunk/blender/source/blender/python/BPY_menus.c
    trunk/blender/source/blender/python/api2_2x/Armature.c
    trunk/blender/source/blender/python/api2_2x/Armature.h
    trunk/blender/source/blender/python/api2_2x/BGL.c
    trunk/blender/source/blender/python/api2_2x/BGL.h
    trunk/blender/source/blender/python/api2_2x/BezTriple.c
    trunk/blender/source/blender/python/api2_2x/BezTriple.h
    trunk/blender/source/blender/python/api2_2x/Blender.c
    trunk/blender/source/blender/python/api2_2x/Blender.h
    trunk/blender/source/blender/python/api2_2x/Bone.c
    trunk/blender/source/blender/python/api2_2x/Bone.h
    trunk/blender/source/blender/python/api2_2x/Camera.c
    trunk/blender/source/blender/python/api2_2x/Camera.h
    trunk/blender/source/blender/python/api2_2x/Constraint.c
    trunk/blender/source/blender/python/api2_2x/Constraint.h
    trunk/blender/source/blender/python/api2_2x/CurNurb.c
    trunk/blender/source/blender/python/api2_2x/CurNurb.h
    trunk/blender/source/blender/python/api2_2x/Curve.c
    trunk/blender/source/blender/python/api2_2x/Curve.h
    trunk/blender/source/blender/python/api2_2x/Draw.c
    trunk/blender/source/blender/python/api2_2x/Draw.h
    trunk/blender/source/blender/python/api2_2x/EXPP_interface.c
    trunk/blender/source/blender/python/api2_2x/EXPP_interface.h
    trunk/blender/source/blender/python/api2_2x/Effect.c
    trunk/blender/source/blender/python/api2_2x/Effect.h
    trunk/blender/source/blender/python/api2_2x/Font.c
    trunk/blender/source/blender/python/api2_2x/Font.h
    trunk/blender/source/blender/python/api2_2x/Geometry.c
    trunk/blender/source/blender/python/api2_2x/Geometry.h
    trunk/blender/source/blender/python/api2_2x/Group.c
    trunk/blender/source/blender/python/api2_2x/Group.h
    trunk/blender/source/blender/python/api2_2x/IDProp.c
    trunk/blender/source/blender/python/api2_2x/IDProp.h
    trunk/blender/source/blender/python/api2_2x/Image.c
    trunk/blender/source/blender/python/api2_2x/Image.h
    trunk/blender/source/blender/python/api2_2x/Ipo.c
    trunk/blender/source/blender/python/api2_2x/Ipo.h
    trunk/blender/source/blender/python/api2_2x/Ipocurve.c
    trunk/blender/source/blender/python/api2_2x/Ipocurve.h
    trunk/blender/source/blender/python/api2_2x/Key.c
    trunk/blender/source/blender/python/api2_2x/Key.h
    trunk/blender/source/blender/python/api2_2x/Lamp.c
    trunk/blender/source/blender/python/api2_2x/Lamp.h
    trunk/blender/source/blender/python/api2_2x/Lattice.c
    trunk/blender/source/blender/python/api2_2x/Lattice.h
    trunk/blender/source/blender/python/api2_2x/Library.c
    trunk/blender/source/blender/python/api2_2x/Library.h
    trunk/blender/source/blender/python/api2_2x/MTex.c
    trunk/blender/source/blender/python/api2_2x/MTex.h
    trunk/blender/source/blender/python/api2_2x/Material.c
    trunk/blender/source/blender/python/api2_2x/Material.h
    trunk/blender/source/blender/python/api2_2x/Mathutils.c
    trunk/blender/source/blender/python/api2_2x/Mathutils.h
    trunk/blender/source/blender/python/api2_2x/Mesh.c
    trunk/blender/source/blender/python/api2_2x/Mesh.h
    trunk/blender/source/blender/python/api2_2x/Metaball.c
    trunk/blender/source/blender/python/api2_2x/Metaball.h
    trunk/blender/source/blender/python/api2_2x/Modifier.c
    trunk/blender/source/blender/python/api2_2x/Modifier.h
    trunk/blender/source/blender/python/api2_2x/NLA.c
    trunk/blender/source/blender/python/api2_2x/NLA.h
    trunk/blender/source/blender/python/api2_2x/NMesh.c
    trunk/blender/source/blender/python/api2_2x/NMesh.h
    trunk/blender/source/blender/python/api2_2x/Noise.c
    trunk/blender/source/blender/python/api2_2x/Object.c
    trunk/blender/source/blender/python/api2_2x/Object.h
    trunk/blender/source/blender/python/api2_2x/Particle.c
    trunk/blender/source/blender/python/api2_2x/Particle.h
    trunk/blender/source/blender/python/api2_2x/Pose.c
    trunk/blender/source/blender/python/api2_2x/Pose.h
    trunk/blender/source/blender/python/api2_2x/Registry.c
    trunk/blender/source/blender/python/api2_2x/Registry.h
    trunk/blender/source/blender/python/api2_2x/Scene.c
    trunk/blender/source/blender/python/api2_2x/Scene.h
    trunk/blender/source/blender/python/api2_2x/Sound.c
    trunk/blender/source/blender/python/api2_2x/Sound.h
    trunk/blender/source/blender/python/api2_2x/SurfNurb.c
    trunk/blender/source/blender/python/api2_2x/SurfNurb.h
    trunk/blender/source/blender/python/api2_2x/Sys.c
    trunk/blender/source/blender/python/api2_2x/Text.c
    trunk/blender/source/blender/python/api2_2x/Text.h
    trunk/blender/source/blender/python/api2_2x/Text3d.c
    trunk/blender/source/blender/python/api2_2x/Text3d.h
    trunk/blender/source/blender/python/api2_2x/Texture.c
    trunk/blender/source/blender/python/api2_2x/Texture.h
    trunk/blender/source/blender/python/api2_2x/Types.c
    trunk/blender/source/blender/python/api2_2x/Types.h
    trunk/blender/source/blender/python/api2_2x/Window.c
    trunk/blender/source/blender/python/api2_2x/Window.h
    trunk/blender/source/blender/python/api2_2x/World.c
    trunk/blender/source/blender/python/api2_2x/World.h
    trunk/blender/source/blender/python/api2_2x/bpy.c
    trunk/blender/source/blender/python/api2_2x/bpy_config.c
    trunk/blender/source/blender/python/api2_2x/bpy_config.h
    trunk/blender/source/blender/python/api2_2x/bpy_data.c
    trunk/blender/source/blender/python/api2_2x/bpy_data.h
    trunk/blender/source/blender/python/api2_2x/charRGBA.c
    trunk/blender/source/blender/python/api2_2x/charRGBA.h
    trunk/blender/source/blender/python/api2_2x/constant.c
    trunk/blender/source/blender/python/api2_2x/constant.h
    trunk/blender/source/blender/python/api2_2x/euler.c
    trunk/blender/source/blender/python/api2_2x/euler.h
    trunk/blender/source/blender/python/api2_2x/gen_library.c
    trunk/blender/source/blender/python/api2_2x/gen_library.h
    trunk/blender/source/blender/python/api2_2x/gen_utils.c
    trunk/blender/source/blender/python/api2_2x/gen_utils.h
    trunk/blender/source/blender/python/api2_2x/logic.c
    trunk/blender/source/blender/python/api2_2x/logic.h
    trunk/blender/source/blender/python/api2_2x/matrix.c
    trunk/blender/source/blender/python/api2_2x/matrix.h
    trunk/blender/source/blender/python/api2_2x/meshPrimitive.c
    trunk/blender/source/blender/python/api2_2x/meshPrimitive.h
    trunk/blender/source/blender/python/api2_2x/modules.h
    trunk/blender/source/blender/python/api2_2x/point.c
    trunk/blender/source/blender/python/api2_2x/point.h
    trunk/blender/source/blender/python/api2_2x/quat.c
    trunk/blender/source/blender/python/api2_2x/quat.h
    trunk/blender/source/blender/python/api2_2x/rgbTuple.c
    trunk/blender/source/blender/python/api2_2x/rgbTuple.h
    trunk/blender/source/blender/python/api2_2x/sceneRadio.c
    trunk/blender/source/blender/python/api2_2x/sceneRadio.h
    trunk/blender/source/blender/python/api2_2x/sceneRender.c
    trunk/blender/source/blender/python/api2_2x/sceneRender.h
    trunk/blender/source/blender/python/api2_2x/sceneSequence.c
    trunk/blender/source/blender/python/api2_2x/sceneSequence.h
    trunk/blender/source/blender/python/api2_2x/sceneTimeLine.c
    trunk/blender/source/blender/python/api2_2x/sceneTimeLine.h
    trunk/blender/source/blender/python/api2_2x/vector.c
    trunk/blender/source/blender/python/api2_2x/vector.h
    trunk/blender/source/blender/python/api2_2x/windowTheme.c
    trunk/blender/source/blender/python/api2_2x/windowTheme.h

Modified: trunk/blender/source/blender/python/BPY_interface.c
===================================================================
--- trunk/blender/source/blender/python/BPY_interface.c	2007-12-15 18:24:16 UTC (rev 12893)
+++ trunk/blender/source/blender/python/BPY_interface.c	2007-12-15 19:23:55 UTC (rev 12894)
@@ -64,7 +64,7 @@
 #include "api2_2x/EXPP_interface.h"
 #include "api2_2x/constant.h"
 #include "api2_2x/gen_utils.h"
-#include "api2_2x/gen_library.h" /* GetPyObjectFromID */
+#include "api2_2x/gen_library.h" /* V24_GetPyObjectFromID */
 #include "api2_2x/BGL.h" 
 #include "api2_2x/Blender.h"
 #include "api2_2x/Camera.h"
@@ -137,7 +137,7 @@
  * support for packages here e.g. import `package.module` */
 
 static struct _inittab BPy_Inittab_Modules[] = {
-	{"Blender", M_Blender_Init},
+	{"Blender", V24_M_Blender_Init},
 	{"bpy", m_bpy_init},
 	{NULL, NULL}
 };
@@ -268,7 +268,7 @@
 	BPyMenu_RemoveAllEntries(  );	/* freeing bpymenu mem */
 
 	/* a script might've opened a .blend file but didn't close it, so: */
-	EXPP_Library_Close(  );
+	V24_EXPP_Library_Close(  );
 
 	return;
 }
@@ -318,7 +318,7 @@
 
 	if( mod ) {
 		d = PyModule_GetDict( mod );
-		EXPP_dict_set_item_str( d, "progname", path );
+		V24_EXPP_dict_set_item_str( d, "progname", path );
 		Py_DECREF( mod );
 	} else
 		printf( "Warning: could not set Blender.sys.progname\n" );
@@ -366,7 +366,7 @@
 
 	if( mod ) {
 		d = PyModule_GetDict( mod );	/* borrowed ref */
-		EXPP_dict_set_item_str( d, "executable",
+		V24_EXPP_dict_set_item_str( d, "executable",
 				      Py_BuildValue( "s", bprogname ) );
 		Py_DECREF( mod );
 	} else{
@@ -559,7 +559,7 @@
 int BPY_txt_do_python_Text( struct Text *text )
 {
 	PyObject *py_dict, *py_result;
-	BPy_constant *info;
+	V24_BPy_constant *info;
 	char textname[24];
 	Script *script = G.main->script.first;
 
@@ -611,13 +611,13 @@
 
 	script->py_globaldict = py_dict;
 
-	info = ( BPy_constant * ) PyConstant_New(  );
+	info = ( V24_BPy_constant * ) V24_PyConstant_New(  );
 	if( info ) {
-		PyConstant_Insert( info, "name",
+		V24_PyConstant_Insert( info, "name",
 				 PyString_FromString( script->id.name + 2 ) );
 		Py_INCREF( Py_None );
-		PyConstant_Insert( info, "arg", Py_None );
-		EXPP_dict_set_item_str( py_dict, "__script__",
+		V24_PyConstant_Insert( info, "arg", Py_None );
+		V24_EXPP_dict_set_item_str( py_dict, "__script__",
 				      ( PyObject * ) info );
 	}
 
@@ -713,7 +713,7 @@
 int BPY_menu_do_python( short menutype, int event )
 {
 	PyObject *py_dict, *py_res, *pyarg = NULL;
-	BPy_constant *info;
+	V24_BPy_constant *info;
 	BPyMenu *pym;
 	BPySubMenu *pysm;
 	FILE *fp = NULL;
@@ -856,12 +856,12 @@
 
 	script->py_globaldict = py_dict;
 
-	info = ( BPy_constant * ) PyConstant_New(  );
+	info = ( V24_BPy_constant * ) V24_PyConstant_New(  );
 	if( info ) {
-		PyConstant_Insert( info, "name",
+		V24_PyConstant_Insert( info, "name",
 				 PyString_FromString( script->id.name + 2 ) );
-		PyConstant_Insert( info, "arg", pyarg );
-		EXPP_dict_set_item_str( py_dict, "__script__",
+		V24_PyConstant_Insert( info, "arg", pyarg );
+		V24_EXPP_dict_set_item_str( py_dict, "__script__",
 				      ( PyObject * ) info );
 	}
 
@@ -1296,7 +1296,7 @@
 	PyObject *gval;
 	PyObject *pyargs, *retval;
 	bConstraintTarget *ct;
-	MatrixObject *retmat;
+	V24_MatrixObject *retmat;
 	int row, col, index;
 	
 	if (!con->text) return;
@@ -1310,7 +1310,7 @@
 	 *	- targets are presented as a list of matrices
 	 */
 	srcmat = newMatrixObject((float *)cob->matrix, 4, 4, Py_NEW);
-	idprop = BPy_Wrap_IDProperty(NULL, con->prop, NULL);
+	idprop = V24_BPy_Wrap_IDProperty(NULL, con->prop, NULL);
 	
 	tarmats= PyList_New(con->tarnum); 
 	for (ct=targets->first, index=0; ct; ct=ct->next, index++) {
@@ -1408,7 +1408,7 @@
 		return;
 	}
 	
-	retmat = (MatrixObject *)retval;
+	retmat = (V24_MatrixObject *)retval;
 	if (retmat->rowSize != 4 || retmat->colSize != 4) {
 		printf("Error in PyConstraint - doConstraint: Matrix returned is the wrong size!\n");
 		con->flag |= PYCON_SCRIPTERROR;
@@ -1450,7 +1450,7 @@
 	PyObject *globals;
 	PyObject *gval;
 	PyObject *pyargs, *retval;
-	MatrixObject *retmat;
+	V24_MatrixObject *retmat;
 	int row, col;
 	
 	if (!con->text) return;
@@ -1459,17 +1459,17 @@
 	
 	globals = CreateGlobalDictionary();
 	
-	tar = Object_CreatePyObject(ct->tar);
+	tar = V24_Object_CreatePyObject(ct->tar);
 	if ((ct->tar) && (ct->tar->type==OB_ARMATURE)) {
 		bPoseChannel *pchan;
 		pchan = get_pose_channel(ct->tar->pose, ct->subtarget);
-		subtar = PyPoseBone_FromPosechannel(pchan);
+		subtar = V24_PyPoseBone_FromPosechannel(pchan);
 	}
 	else
 		subtar = PyString_FromString(ct->subtarget);
 	
 	tarmat = newMatrixObject((float *)ct->matrix, 4, 4, Py_NEW);
-	idprop = BPy_Wrap_IDProperty( NULL, con->prop, NULL);
+	idprop = V24_BPy_Wrap_IDProperty( NULL, con->prop, NULL);
 	
 /*  since I can't remember what the armature weakrefs do, I'll just leave this here
     commented out.  This function was based on pydrivers, and it might still be relevent.
@@ -1559,7 +1559,7 @@
 		return;
 	}
 	
-	retmat = (MatrixObject *)retval;
+	retmat = (V24_MatrixObject *)retval;
 	if (retmat->rowSize != 4 || retmat->colSize != 4) {
 		printf("Error in PyConstraint - doTarget: Matrix returned is the wrong size!\n");
 		con->flag |= PYCON_SCRIPTERROR;
@@ -1606,7 +1606,7 @@
 	
 	globals = CreateGlobalDictionary();
 	
-	idprop = BPy_Wrap_IDProperty( NULL, con->prop, NULL);
+	idprop = V24_BPy_Wrap_IDProperty( NULL, con->prop, NULL);
 	
 	retval = RunPython(con->text, globals);
 
@@ -1733,14 +1733,14 @@
 	}
 
 	if (driver->ob)
-		bpy_ob = Object_CreatePyObject(driver->ob);
+		bpy_ob = V24_Object_CreatePyObject(driver->ob);
 
 	if (!bpy_ob) {
 		Py_INCREF(Py_None);
 		bpy_ob = Py_None;
 	}
 
-	setitem_retval = EXPP_dict_set_item_str(bpy_pydriver_Dict, "self", bpy_ob);
+	setitem_retval = V24_EXPP_dict_set_item_str(bpy_pydriver_Dict, "self", bpy_ob);
 
 	if( !setup_armature_weakrefs()){
 		fprintf( stderr, "Oops - weakref dict setup\n");
@@ -1768,7 +1768,7 @@
 	return result;
 }
 
-/* Button Python Evaluation */
+/* V24V24__Button Python Evaluation */
 
 /* Python evaluation for gui buttons:
  *	users can write any valid Python expression (that evals to an int or float)
@@ -1809,7 +1809,7 @@
 	if (!bpy_pydriver_Dict) {
 		if (bpy_pydriver_create_dict() != 0) {
 			fprintf(stderr,
-				"Button Python Eval error: couldn't create Python dictionary");
+				"V24V24__Button Python Eval error: couldn't create Python dictionary");
 			return -1;
 		}
 	}
@@ -1952,7 +1952,7 @@
 			return;
 		}
 		
-		value = GetPyObjectFromID( id );
+		value = V24_GetPyObjectFromID( id );
 		if( !value){
 			printf("Oops - could not get a valid python object for Blender.link, this is a bug\n");
 			return;
@@ -1966,8 +1966,8 @@
 
 		/* set globals in Blender module to identify scriptlink */
 		PyDict_SetItemString(	g_blenderdict, "bylink", Py_True);
-		EXPP_dict_set_item_str( g_blenderdict, "link", value );
-		EXPP_dict_set_item_str( g_blenderdict, "event",
+		V24_EXPP_dict_set_item_str( g_blenderdict, "link", value );
+		V24_EXPP_dict_set_item_str( g_blenderdict, "event",
 				      PyString_FromString( event_to_name
 							   ( event ) ) );
 		if (event == SCRIPT_POSTRENDER) event = SCRIPT_RENDER;
@@ -2007,7 +2007,7 @@
 		 */
 		PyDict_SetItemString(g_blenderdict, "bylink", Py_False);
 		PyDict_SetItemString( g_blenderdict, "link", Py_None );
-		EXPP_dict_set_item_str( g_blenderdict, "event", PyString_FromString( "" ) );
+		V24_EXPP_dict_set_item_str( g_blenderdict, "event", PyString_FromString( "" ) );
 	}
 }
 
@@ -2190,9 +2190,9 @@
 		/* set globals in Blender module to identify space handler scriptlink */
 		PyDict_SetItemString(g_blenderdict, "bylink", Py_True);
 		/* unlike normal scriptlinks, here Blender.link is int (space event type) */
-		EXPP_dict_set_item_str(g_blenderdict, "link", PyInt_FromLong(space_event));
+		V24_EXPP_dict_set_item_str(g_blenderdict, "link", PyInt_FromLong(space_event));
 		/* note: DRAW space_events set event to 0 */
-		EXPP_dict_set_item_str(g_blenderdict, "event", PyInt_FromLong(event));
+		V24_EXPP_dict_set_item_str(g_blenderdict, "event", PyInt_FromLong(event));
 		/* now run all assigned space handlers for this space and space_event */
 		for( index = 0; index < scriptlink->totscript; index++ ) {
 
@@ -2249,7 +2249,7 @@
 
 		PyDict_SetItemString(g_blenderdict, "bylink", Py_False);
 		PyDict_SetItemString(g_blenderdict, "link", Py_None );
-		EXPP_dict_set_item_str(g_blenderdict, "event", PyString_FromString(""));
+		V24_EXPP_dict_set_item_str(g_blenderdict, "event", PyString_FromString(""));
 	}
 	
 	/* retval:
@@ -2429,7 +2429,7 @@
 	PyObject *dict = PyDict_New(  );
 
 	PyDict_SetItemString( dict, "__builtins__", PyEval_GetBuiltins(  ) );
-	EXPP_dict_set_item_str( dict, "__name__",
+	V24_EXPP_dict_set_item_str( dict, "__name__",
 			      PyString_FromString( "__main__" ) );
 
 	return dict;
@@ -2554,7 +2554,7 @@
 	m = PyImport_AddModule( "__builtin__" );
 	d = PyModule_GetDict( m );
 	
-	EXPP_dict_set_item_str( d, "__import__", import );
+	V24_EXPP_dict_set_item_str( d, "__import__", import );
 }
 
 /*
@@ -2655,5 +2655,5 @@
 
 	m = PyImport_AddModule( "__builtin__" );
 	d = PyModule_GetDict( m );
-	EXPP_dict_set_item_str( d, "reload", reload );
+	V24_EXPP_dict_set_item_str( d, "reload", reload );
 }

Modified: trunk/blender/source/blender/python/BPY_menus.c
===================================================================
--- trunk/blender/source/blender/python/BPY_menus.c	2007-12-15 18:24:16 UTC (rev 12893)
+++ trunk/blender/source/blender/python/BPY_menus.c	2007-12-15 19:23:55 UTC (rev 12894)
@@ -55,8 +55,8 @@
 #define MAX_DIR_NUMBER 30 /* max number of dirs in scripts dirs trees */
 
 static int DEBUG;
-static int Dir_Depth;
-static int Dirs_Number;
+static int V24_Dir_Depth;
+static int V24_Dirs_Number;
 
 /* BPyMenuTable holds all registered pymenus, as linked lists for each menu
  * where they can appear (see PYMENUHOOKS enum in BPY_menus.h).
@@ -272,8 +272,8 @@
 		BPyMenuTable[i] = NULL;
 	}
 
-	Dirs_Number = 0;
-	Dir_Depth = 0;
+	V24_Dirs_Number = 0;
+	V24_Dir_Depth = 0;
 
 	return;
 }
@@ -891,16 +891,16 @@
 			}
 
 			else if (S_ISDIR(status.st_mode)) { /* is subdir */
-				Dirs_Number++;
-				Dir_Depth++;
-				if (Dirs_Number > MAX_DIR_NUMBER) {
+				V24_Dirs_Number++;
+				V24_Dir_Depth++;
+				if (V24_Dirs_Number > MAX_DIR_NUMBER) {
 					if (DEBUG) {
 						fprintf(stderr, "BPyMenus error: too many subdirs.\n");
 					}
 					closedir(dir);
 					return -1;
 				}

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list