[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11909] trunk/blender/source/blender/ python/api2_2x/Object.c: my commit 11122 broke scriptlinks.

Campbell Barton cbarton at metavr.com
Fri Aug 31 23:54:57 CEST 2007


Revision: 11909
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11909
Author:   campbellbarton
Date:     2007-08-31 23:54:56 +0200 (Fri, 31 Aug 2007)

Log Message:
-----------
my commit 11122 broke scriptlinks. was returning before re-enabling scriptlinks.
Bug [#6978] Scene script link doesn't work for Redraw event

made a script to automate building a range of revisions.
http://wiki.blender.org/index.php/User:Ideasman42#SVN_TimeWarp_Script

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Object.c

Modified: trunk/blender/source/blender/python/api2_2x/Object.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Object.c	2007-08-31 19:17:22 UTC (rev 11908)
+++ trunk/blender/source/blender/python/api2_2x/Object.c	2007-08-31 21:54:56 UTC (rev 11909)
@@ -1286,7 +1286,7 @@
 static PyObject *Object_getLocation( BPy_Object * self, PyObject * args )
 {
 	char *space = "localspace";	/* default to local */
-	
+	PyObject *attr;
 	if( !PyArg_ParseTuple( args, "|s", &space ) ) 
 		return EXPP_ReturnPyObjError( PyExc_TypeError,
 				"expected a string or nothing" );
@@ -1295,20 +1295,23 @@
 		disable_where_script( 1 );
 		where_is_object( self->object );
 		
-		return Py_BuildValue( "fff",
+		attr = Py_BuildValue( "fff",
 					self->object->obmat[3][0],
 					self->object->obmat[3][1],
 					self->object->obmat[3][2] );
 		
 		disable_where_script( 0 );
 	} else if( BLI_streq( space, "localspace" ) ) {	/* Localspace matrix */
-		return Py_BuildValue( "fff",
+		attr = Py_BuildValue( "fff",
 					self->object->loc[0],
 					self->object->loc[1],
 					self->object->loc[2] );
+	} else {
+		return EXPP_ReturnPyObjError( PyExc_ValueError,
+				"expected either nothing, 'localspace' (default) or 'worldspace'" );
 	}
-	return EXPP_ReturnPyObjError( PyExc_ValueError,
-				"expected either nothing, 'localspace' (default) or 'worldspace'" );
+
+	return attr;
 }
 
 static PyObject *Object_getMaterials( BPy_Object * self, PyObject * args )





More information about the Bf-blender-cvs mailing list