[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10931] branches/pyapi_devel: removed more get/set as well as Get() and New() that arnt needed because of bpy.data.scenes.new() and bpy.data.scenes[' Scene'] - implimented some more of the scriptlink pytype (wip)

Campbell Barton cbarton at metavr.com
Thu Jun 14 20:42:05 CEST 2007


Revision: 10931
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10931
Author:   campbellbarton
Date:     2007-06-14 20:42:04 +0200 (Thu, 14 Jun 2007)

Log Message:
-----------
removed more get/set as well as Get() and New() that arnt needed because of bpy.data.scenes.new() and bpy.data.scenes['Scene'] - implimented some more of the scriptlink pytype (wip)

Modified Paths:
--------------
    branches/pyapi_devel/config/linux2-config.py
    branches/pyapi_devel/source/blender/python/api2_2x/Blender.c
    branches/pyapi_devel/source/blender/python/api2_2x/Curve.c
    branches/pyapi_devel/source/blender/python/api2_2x/Curve.h
    branches/pyapi_devel/source/blender/python/api2_2x/Font.c
    branches/pyapi_devel/source/blender/python/api2_2x/Group.c
    branches/pyapi_devel/source/blender/python/api2_2x/Image.c
    branches/pyapi_devel/source/blender/python/api2_2x/Key.c
    branches/pyapi_devel/source/blender/python/api2_2x/Lamp.c
    branches/pyapi_devel/source/blender/python/api2_2x/Material.c
    branches/pyapi_devel/source/blender/python/api2_2x/Metaball.c
    branches/pyapi_devel/source/blender/python/api2_2x/Scene.c
    branches/pyapi_devel/source/blender/python/api2_2x/Sound.c
    branches/pyapi_devel/source/blender/python/api2_2x/Text.c
    branches/pyapi_devel/source/blender/python/api2_2x/Text3d.c
    branches/pyapi_devel/source/blender/python/api2_2x/gen_library.c
    branches/pyapi_devel/source/blender/python/api2_2x/object_scriptlink.c
    branches/pyapi_devel/source/blender/python/api2_2x/object_scriptlink.h

Modified: branches/pyapi_devel/config/linux2-config.py
===================================================================
--- branches/pyapi_devel/config/linux2-config.py	2007-06-14 18:38:33 UTC (rev 10930)
+++ branches/pyapi_devel/config/linux2-config.py	2007-06-14 18:42:04 UTC (rev 10931)
@@ -123,7 +123,7 @@
 WITH_BF_STATICOPENGL = 'false'
 BF_OPENGL = '/usr'
 BF_OPENGL_INC = '${BF_OPENGL}/include'
-BF_OPENGL_LIB = 'GL GLU X11 Xi'
+BF_OPENGL_LIB = 'GL GLU Xi'
 BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
 BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a'
 

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Blender.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Blender.c	2007-06-14 18:38:33 UTC (rev 10930)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Blender.c	2007-06-14 18:42:04 UTC (rev 10931)
@@ -94,6 +94,7 @@
 #include "Window.h"
 #include "World.h"
 #include "Types.h"
+#include "object_scriptlink.h"
 
 /**********************************************************/
 /* Python API function prototypes for the Blender module.	*/
@@ -940,6 +941,8 @@
 	EXPP_dict_set_item_str(dict, "event", PyString_FromString(""));
 	EXPP_dict_set_item_str(dict, "mode", smode);
 
+	ScriptLink_Init(); /*PyDict_SetItemString(dict, "Camera", Camera_Init());*/
+	
 	PyDict_SetItemString(dict, "Armature", Armature_Init());
 	PyDict_SetItemString(dict, "BezTriple", BezTriple_Init());
 	PyDict_SetItemString(dict, "BGL", BGL_Init());
@@ -977,5 +980,4 @@
 	PyDict_SetItemString(dict, "Texture", Texture_Init());
 	PyDict_SetItemString(dict, "Window", Window_Init());
 	PyDict_SetItemString(dict, "World", World_Init());
-
 }

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Curve.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Curve.c	2007-06-14 18:38:33 UTC (rev 10930)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Curve.c	2007-06-14 18:42:04 UTC (rev 10931)
@@ -54,52 +54,26 @@
 /*  Blender.Curve.__doc__                                                    */
 /*****************************************************************************/
 
-char M_Curve_doc[] = "The Blender Curve module\n\n\
-This module provides access to **Curve Data** in Blender.\n\
-Functions :\n\
-	New(opt name) : creates a new curve object with the given name (optional)\n\
-	Get(name) : retreives a curve  with the given name (mandatory)\n\
-	get(name) : same as Get. Kept for compatibility reasons";
-char M_Curve_New_doc[] = "";
-char M_Curve_Get_doc[] = "xxx";
+char M_Curve_doc[] = "";
 
-
-
 /*****************************************************************************/
 /*  Python API function prototypes for the Curve module.                     */
 /*****************************************************************************/
-static PyObject *M_Curve_New( PyObject * self, PyObject * args );
-static PyObject *M_Curve_Get( PyObject * self, PyObject * args );
 
-
 /*****************************************************************************/
 /*  Python BPy_Curve instance methods declarations:                          */
 /*****************************************************************************/
 
 static PyObject *Curve_getPathLen( BPy_Curve * self );
-static PyObject *Curve_setPathLen( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getTotcol( BPy_Curve * self );
-static PyObject *Curve_setTotcol( BPy_Curve * self, PyObject * args );
-#if 0
-PyObject *Curve_getResolu( BPy_Curve * self );
-PyObject *Curve_setResolu( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getResolv( BPy_Curve * self );
-PyObject *Curve_setResolv( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getWidth( BPy_Curve * self );
-PyObject *Curve_setWidth( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getExt1( BPy_Curve * self );
-PyObject *Curve_setExt1( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getExt2( BPy_Curve * self );
-PyObject *Curve_setExt2( BPy_Curve * self, PyObject * args );
-#endif
+static int Curve_setPathLen( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args );
+static PyObject * Curve_setControlPoint( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getLoc( BPy_Curve * self );
-static PyObject *Curve_setLoc( BPy_Curve * self, PyObject * args );
+static int Curve_setLoc( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getRot( BPy_Curve * self );
-static PyObject *Curve_setRot( BPy_Curve * self, PyObject * args );
+static int Curve_setRot( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getSize( BPy_Curve * self );
-static PyObject *Curve_setSize( BPy_Curve * self, PyObject * args );
+static int Curve_setSize( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getNumCurves( BPy_Curve * self );
 static PyObject *Curve_getKey( BPy_Curve * self );
 static PyObject *Curve_isNurb( BPy_Curve * self, PyObject * args );
@@ -112,10 +86,10 @@
 static PyObject *Curve_getMaterials( BPy_Curve * self );
 
 static PyObject *Curve_getBevOb( BPy_Curve * self );
-static PyObject *Curve_setBevOb( BPy_Curve * self, PyObject * args );
+static int Curve_setBevOb( BPy_Curve * self, PyObject * args );
 
 static PyObject *Curve_getTaperOb( BPy_Curve * self );
-static PyObject *Curve_setTaperOb( BPy_Curve * self, PyObject * args );
+static int Curve_setTaperOb( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_copy( BPy_Curve * self );
 
 static PyObject *Curve_getIter( BPy_Curve * self );
@@ -135,33 +109,6 @@
 /* numpts                                                                    */
 /*****************************************************************************/
 
-
-PyObject *Curve_getName( BPy_Curve * self )
-{
-	PyObject *attr = PyString_FromString( self->curve->id.name + 2 );
-
-	if( attr )
-		return attr;
-
-	return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-					"couldn't get Curve.name attribute" );
-}
-
-static int Curve_newsetName( BPy_Curve * self, PyObject * args )
-{
-	char *name;
-
-	name = PyString_AsString( args );
-	if( !name )
-		return EXPP_ReturnIntError( PyExc_TypeError,
-					      "expected string argument" );
-
-	rename_id( &self->curve->id, name );	/* proper way in Blender */
-	Curve_update( self );
-
-	return 0;
-}
-
 static PyObject *Curve_getPathLen( BPy_Curve * self )
 {
 	PyObject *attr = PyInt_FromLong( ( long ) self->curve->pathlen );
@@ -174,7 +121,7 @@
 }
 
 
-static int Curve_newsetPathLen( BPy_Curve * self, PyObject * args )
+static int Curve_setPathLen( BPy_Curve * self, PyObject * args )
 {
 	PyObject *num;
 
@@ -213,7 +160,7 @@
 }
 
 
-static int Curve_newsetMode( BPy_Curve * self, PyObject * args )
+int Curve_setMode( BPy_Curve * self, PyObject * args )
 {
 	PyObject *num;
 
@@ -239,7 +186,7 @@
 			"couldn't get Curve.bevresol attribute" );
 }
 
-static int Curve_newsetBevresol( BPy_Curve * self, PyObject * args )
+int Curve_setBevresol( BPy_Curve * self, PyObject * args )
 {
 	short value;
 	PyObject *num;
@@ -273,7 +220,7 @@
 }
 
 
-static int Curve_newsetResolu( BPy_Curve * self, PyObject * args )
+int Curve_setResolu( BPy_Curve * self, PyObject * args )
 {
 	short value;
 	Nurb *nu;
@@ -310,7 +257,7 @@
 			"couldn't get Curve.resolv attribute" );
 }
 
-static int Curve_newsetResolv( BPy_Curve * self, PyObject * args )
+int Curve_setResolv( BPy_Curve * self, PyObject * args )
 {
 	short value;
 	PyObject *num;
@@ -343,7 +290,7 @@
 }
 
 
-static int Curve_newsetWidth( BPy_Curve * self, PyObject * args )
+int Curve_setWidth( BPy_Curve * self, PyObject * args )
 {
 	float value;
 	PyObject *num;
@@ -377,7 +324,7 @@
 }
 
 
-static int Curve_newsetExt1( BPy_Curve * self, PyObject * args )
+int Curve_setExt1( BPy_Curve * self, PyObject * args )
 {
 	float value;
 	PyObject *num;
@@ -410,7 +357,7 @@
 }
 
 
-static int Curve_newsetExt2( BPy_Curve * self, PyObject * args )
+int Curve_setExt2( BPy_Curve * self, PyObject * args )
 {
 	float value;
 	PyObject *num;
@@ -545,7 +492,7 @@
 			"couldn't get Curve.loc attribute" );
 }
 
-static int Curve_newsetLoc( BPy_Curve * self, PyObject * args )
+static int Curve_setLoc( BPy_Curve * self, PyObject * args )
 {
 	float loc[3];
 	int i;
@@ -583,7 +530,7 @@
 			"couldn't get Curve.rot attribute" );
 }
 
-static int Curve_newsetRot( BPy_Curve * self, PyObject * args )
+static int Curve_setRot( BPy_Curve * self, PyObject * args )
 {
 	float rot[3];
 	int i;
@@ -621,7 +568,7 @@
 			"couldn't get Curve.size attribute" );
 }
 
-static int Curve_newsetSize( BPy_Curve * self, PyObject * args )
+static int Curve_setSize( BPy_Curve * self, PyObject * args )
 {
 	float size[3];
 	int i;
@@ -1034,12 +981,11 @@
 }
 
 /*****************************************************************************/
-/* Function:    Curve_newsetBevOb                                            */
+/* Function:    Curve_setBevOb                                            */
 /* Description: Assign a bevel object to the curve.                          */
 /*****************************************************************************/
-static int Curve_newsetBevOb( BPy_Curve * self, PyObject * args )
+static int Curve_setBevOb( BPy_Curve * self, PyObject * args )
 {
-	
 	if (BPy_Object_Check( args ) && ((BPy_Object *)args)->object->data == self->curve )
 		return EXPP_ReturnIntError( PyExc_ValueError,
 				"Can't bevel an object to itself" );
@@ -1061,11 +1007,11 @@
 }
 
 /*****************************************************************************/
-/* Function:    Curve_newsetTaperOb                                          */
+/* Function:    Curve_setTaperOb                                          */
 /* Description: Assign a taper object to the curve.                          */
 /*****************************************************************************/
 
-static int Curve_newsetTaperOb( BPy_Curve * self, PyObject * args )
+static int Curve_setTaperOb( BPy_Curve * self, PyObject * args )
 {
 	if (BPy_Object_Check( args ) && ((BPy_Object *)args)->object->data == self->curve )
 		return EXPP_ReturnIntError( PyExc_ValueError,
@@ -1234,7 +1180,7 @@
 static PyGetSetDef Curve_getseters[] = {

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list