| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2004-09-18 18:47:03 +00:00
										 |  |  |  * $Id$ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  |  * as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  |  * of the License, or (at your option) any later version. The Blender | 
					
						
							|  |  |  |  * Foundation also sells licenses for use in proprietary software under | 
					
						
							|  |  |  |  * the Blender License.  See http://www.blender.org/BL/ for information
 | 
					
						
							|  |  |  |  * about this. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							|  |  |  |  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This is a new part of Blender. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Contributor(s): Jacques Guignot | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL/BL DUAL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #include "Effect.h"
 | 
					
						
							|  |  |  | #include "Build.h"
 | 
					
						
							|  |  |  | #include "Particle.h"
 | 
					
						
							|  |  |  | #include "Wave.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-04-23 13:11:48 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python BPy_Effect methods table:                                            */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | static PyMethodDef BPy_Effect_methods[] = { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{NULL, NULL, 0, NULL} | 
					
						
							| 
									
										
										
										
											2004-04-23 13:11:48 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python Effect_Type structure definition:                                  */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyTypeObject Effect_Type = { | 
					
						
							|  |  |  | 	PyObject_HEAD_INIT( NULL ) | 
					
						
							|  |  |  | 		0,		/* ob_size */ | 
					
						
							|  |  |  | 	"Effect",		/* tp_name */ | 
					
						
							|  |  |  | 	sizeof( BPy_Effect ),	/* tp_basicsize */ | 
					
						
							|  |  |  | 	0,			/* tp_itemsize */ | 
					
						
							|  |  |  | 	/* methods */ | 
					
						
							|  |  |  | 	( destructor ) EffectDeAlloc,	/* tp_dealloc */ | 
					
						
							|  |  |  | 	0,			/* tp_print */ | 
					
						
							|  |  |  | 	( getattrfunc ) EffectGetAttr,	/* tp_getattr */ | 
					
						
							|  |  |  | 	( setattrfunc ) EffectSetAttr,	/* tp_setattr */ | 
					
						
							|  |  |  | 	0,			/* tp_compare */ | 
					
						
							|  |  |  | 	( reprfunc ) EffectRepr,	/* tp_repr */ | 
					
						
							|  |  |  | 	0,			/* tp_as_number */ | 
					
						
							|  |  |  | 	0,			/* tp_as_sequence */ | 
					
						
							|  |  |  | 	0,			/* tp_as_mapping */ | 
					
						
							|  |  |  | 	0,			/* tp_as_hash */ | 
					
						
							|  |  |  | 	0, 0, 0, 0, 0, 0, | 
					
						
							|  |  |  | 	0,			/* tp_doc */ | 
					
						
							|  |  |  | 	0, 0, 0, 0, 0, 0, | 
					
						
							|  |  |  | 	BPy_Effect_methods,	/* tp_methods */ | 
					
						
							|  |  |  | 	0,			/* tp_members */ | 
					
						
							| 
									
										
										
										
											2004-04-23 13:11:48 +00:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python method structure definition for Blender.Effect module:             */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct PyMethodDef M_Effect_methods[] = { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"New", ( PyCFunction ) M_Effect_New, METH_VARARGS, NULL}, | 
					
						
							|  |  |  | 	{"Get", M_Effect_Get, METH_VARARGS, NULL}, | 
					
						
							|  |  |  | 	{"get", M_Effect_Get, METH_VARARGS, NULL}, | 
					
						
							|  |  |  | 	{NULL, NULL, 0, NULL} | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:              M_Effect_New                                       */ | 
					
						
							|  |  |  | /* Python equivalent:     Blender.Effect.New                                 */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *M_Effect_New( PyObject * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Effect *pyeffect; | 
					
						
							|  |  |  | 	Effect *bleffect = 0; | 
					
						
							|  |  |  | 	int type = -1; | 
					
						
							|  |  |  | 	char *btype = NULL; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "s", &btype ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 						"expected type argument(wave,build or particle)" ) ); | 
					
						
							|  |  |  | 	if( !strcmp( btype, "wave" ) ) | 
					
						
							|  |  |  | 		type = EFF_WAVE; | 
					
						
							|  |  |  | 	if( !strcmp( btype, "build" ) ) | 
					
						
							|  |  |  | 		type = EFF_BUILD; | 
					
						
							|  |  |  | 	if( !strcmp( btype, "particle" ) ) | 
					
						
							|  |  |  | 		type = EFF_PARTICLE; | 
					
						
							|  |  |  | 	if( type == -1 ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 						"unknown type " ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	bleffect = add_effect( type ); | 
					
						
							|  |  |  | 	if( bleffect == NULL ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, | 
					
						
							|  |  |  | 						"couldn't create Effect Data in Blender" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pyeffect = ( BPy_Effect * ) PyObject_NEW( BPy_Effect, &Effect_Type ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( pyeffect == NULL ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_MemoryError, | 
					
						
							|  |  |  | 						"couldn't create Effect Data object" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pyeffect->effect = bleffect; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ( PyObject * ) pyeffect; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:              M_Effect_Get                                       */ | 
					
						
							|  |  |  | /* Python equivalent:     Blender.Effect.Get                                 */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *M_Effect_Get( PyObject * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	/*arguments : string object name
 | 
					
						
							|  |  |  | 	   int : position of effect in the obj's effect list  */ | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 	char *name = NULL; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Object *object_iter; | 
					
						
							|  |  |  | 	Effect *eff; | 
					
						
							|  |  |  | 	BPy_Effect *wanted_eff; | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 	int num = -1, i; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "|si", &name, &num ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected string int argument" ) ); | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	object_iter = G.main->object.first; | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !object_iter ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"Scene contains no object" ) ); | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if( name ) { /* (name, num = -1) - try to find the given object */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		while( object_iter ) { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 			if( !strcmp( name, object_iter->id.name + 2 ) ) { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 				eff = object_iter->effect.first; /*can be NULL: None will be returned*/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				if (num >= 0) { /* return effect in given num position if available */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 						if (!eff) break; | 
					
						
							|  |  |  | 						eff = eff->next; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					if (eff) { | 
					
						
							|  |  |  | 						wanted_eff = (BPy_Effect *)PyObject_NEW(BPy_Effect, &Effect_Type); | 
					
						
							|  |  |  | 						wanted_eff->effect = eff; | 
					
						
							|  |  |  | 						return ( PyObject * ) wanted_eff; | 
					
						
							|  |  |  | 					} else { /* didn't find any effect in the given position */ | 
					
						
							|  |  |  | 						Py_INCREF(Py_None); | 
					
						
							|  |  |  | 						return Py_None; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				else {/*return a list with all effects linked to the given object*/ | 
					
						
							|  |  |  | 							/* this was pointed by Stephen Swaney */ | 
					
						
							|  |  |  | 					PyObject *effectlist = PyList_New( 0 ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					while (eff) { | 
					
						
							|  |  |  | 						BPy_Effect *found_eff = (BPy_Effect *)PyObject_NEW(BPy_Effect, | 
					
						
							|  |  |  | 							&Effect_Type); | 
					
						
							|  |  |  | 						found_eff->effect = eff; | 
					
						
							|  |  |  | 						PyList_Append( effectlist, ( PyObject * ) found_eff ); | 
					
						
							|  |  |  | 						Py_DECREF((PyObject *)found_eff); /* PyList_Append incref'ed it */ | 
					
						
							|  |  |  | 						eff = eff->next; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 					return effectlist; | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 			 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			object_iter = object_iter->id.next; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		if (!object_iter) | 
					
						
							|  |  |  | 			return EXPP_ReturnPyObjError (PyExc_AttributeError, | 
					
						
							|  |  |  | 				"no such object"); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	else { /* () - return a list with all effects currently in Blender */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		PyObject *effectlist = PyList_New( 0 ); | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		while( object_iter ) { | 
					
						
							|  |  |  | 			if( object_iter->effect.first != NULL ) { | 
					
						
							|  |  |  | 				eff = object_iter->effect.first; | 
					
						
							|  |  |  | 				while( eff ) { | 
					
						
							|  |  |  | 					BPy_Effect *found_eff = | 
					
						
							|  |  |  | 						( BPy_Effect * ) | 
					
						
							|  |  |  | 						PyObject_NEW( BPy_Effect, | 
					
						
							|  |  |  | 							      &Effect_Type ); | 
					
						
							|  |  |  | 					found_eff->effect = eff; | 
					
						
							|  |  |  | 					PyList_Append( effectlist, | 
					
						
							|  |  |  | 						       ( PyObject * ) | 
					
						
							|  |  |  | 						       found_eff ); | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 					Py_DECREF((PyObject *)found_eff); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 					eff = eff->next; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			object_iter = object_iter->id.next; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 		return effectlist; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-28 07:38:21 +00:00
										 |  |  | /* Function:              Effect_Init                                        */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Build_Init( void ); | 
					
						
							|  |  |  | PyObject *Wave_Init( void ); | 
					
						
							|  |  |  | PyObject *Particle_Init( void ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Effect_Init( void ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *submodule, *dict; | 
					
						
							| 
									
										
										
										
											2003-06-28 07:38:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Effect_Type.ob_type = &PyType_Type; | 
					
						
							| 
									
										
										
										
											2003-06-28 07:38:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	submodule = Py_InitModule3( "Blender.Effect", M_Effect_methods, 0 ); | 
					
						
							|  |  |  | 	dict = PyModule_GetDict( submodule ); | 
					
						
							|  |  |  | 	PyDict_SetItemString( dict, "Wave", Wave_Init(  ) ); | 
					
						
							|  |  |  | 	PyDict_SetItemString( dict, "Build", Build_Init(  ) ); | 
					
						
							|  |  |  | 	PyDict_SetItemString( dict, "Particle", Particle_Init(  ) ); | 
					
						
							|  |  |  | 	return ( submodule ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Python BPy_Effect methods:                                       */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Effect_getType( BPy_Effect * self ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *attr = PyInt_FromLong( ( long ) self->effect->type ); | 
					
						
							|  |  |  | 	if( attr ) | 
					
						
							|  |  |  | 		return attr; | 
					
						
							|  |  |  | 	return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, | 
					
						
							|  |  |  | 					"couldn't get mode attribute" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Effect_setType( BPy_Effect * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int value; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "i", &value ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 						"expected an int as argument" ) ); | 
					
						
							|  |  |  | 	self->effect->type = value; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Effect_getFlag( BPy_Effect * self ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *attr = PyInt_FromLong( ( long ) self->effect->flag ); | 
					
						
							|  |  |  | 	if( attr ) | 
					
						
							|  |  |  | 		return attr; | 
					
						
							|  |  |  | 	return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, | 
					
						
							|  |  |  | 					"couldn't get mode attribute" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Effect_setFlag( BPy_Effect * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int value; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "i", &value ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 						"expected an int as argument" ) ); | 
					
						
							|  |  |  | 	self->effect->flag = value; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    EffectDeAlloc                                                */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Effect type. It is   */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*              the destructor function.                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | void EffectDeAlloc( BPy_Effect * self ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject_DEL( self ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    EffectGetAttr                                                */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Effect type. It is   */ | 
					
						
							|  |  |  | /*              the function that accesses BPy_Effect "member variables" and */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*              methods.                                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *EffectGetAttr( BPy_Effect * self, char *name ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	switch ( self->effect->type ) { | 
					
						
							|  |  |  | 	case EFF_BUILD: | 
					
						
							|  |  |  | 		return BuildGetAttr( ( BPy_Build * ) self, name ); | 
					
						
							|  |  |  | 	case EFF_WAVE: | 
					
						
							|  |  |  | 		return WaveGetAttr( ( BPy_Wave * ) self, name ); | 
					
						
							|  |  |  | 	case EFF_PARTICLE: | 
					
						
							|  |  |  | 		return ParticleGetAttr( ( BPy_Particle * ) self, name ); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return Py_FindMethod( BPy_Effect_methods, ( PyObject * ) self, name ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    EffectSetAttr                                                */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Effect type. It   */ | 
					
						
							|  |  |  | /*              sets Effect Data attributes (member variables). */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | int EffectSetAttr( BPy_Effect * self, char *name, PyObject * value ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	switch ( self->effect->type ) { | 
					
						
							|  |  |  | 	case EFF_BUILD: | 
					
						
							|  |  |  | 		return BuildSetAttr( ( BPy_Build * ) self, name, value ); | 
					
						
							|  |  |  | 	case EFF_WAVE: | 
					
						
							|  |  |  | 		return WaveSetAttr( ( BPy_Wave * ) self, name, value ); | 
					
						
							|  |  |  | 	case EFF_PARTICLE: | 
					
						
							|  |  |  | 		return ParticleSetAttr( ( BPy_Particle * ) self, name, value ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return 0;		/* normal exit */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    EffectPrint                                                  */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Effect type. It      */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*              builds a meaninful string to 'print' effcte objects.         */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-07-04 16:06:39 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | int EffectPrint(BPy_Effect *self, FILE *fp, int flags)  | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | {  | 
					
						
							|  |  |  | if (self->effect->type == EFF_BUILD)puts("Effect Build"); | 
					
						
							|  |  |  | if (self->effect->type == EFF_PARTICLE)puts("Effect Particle"); | 
					
						
							|  |  |  | if (self->effect->type == EFF_WAVE)puts("Effect Wave"); | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |   return 0; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2003-07-04 16:06:39 +00:00
										 |  |  | */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    EffectRepr                                                   */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Effect type. It      */ | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | /*              builds a meaninful string to represent effcte objects.       */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-07-04 16:06:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *EffectRepr( BPy_Effect * self ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	char *str = ""; | 
					
						
							|  |  |  | 	if( self->effect->type == EFF_BUILD ) | 
					
						
							|  |  |  | 		str = "Effect Build"; | 
					
						
							|  |  |  | 	if( self->effect->type == EFF_PARTICLE ) | 
					
						
							|  |  |  | 		str = "Effect Particle"; | 
					
						
							|  |  |  | 	if( self->effect->type == EFF_WAVE ) | 
					
						
							|  |  |  | 		str = "Effect Wave"; | 
					
						
							|  |  |  | 	return PyString_FromString( str ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *EffectCreatePyObject( struct Effect * effect ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Effect *blen_object; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	blen_object = | 
					
						
							|  |  |  | 		( BPy_Effect * ) PyObject_NEW( BPy_Effect, &Effect_Type ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( blen_object == NULL ) { | 
					
						
							|  |  |  | 		return ( NULL ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	blen_object->effect = effect; | 
					
						
							|  |  |  | 	return ( ( PyObject * ) blen_object ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | int EffectCheckPyObject( PyObject * py_obj ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( py_obj->ob_type == &Effect_Type ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | struct Effect *EffectFromPyObject( PyObject * py_obj ) | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Effect *blen_obj; | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	blen_obj = ( BPy_Effect * ) py_obj; | 
					
						
							|  |  |  | 	return ( ( Effect * ) blen_obj->effect ); | 
					
						
							| 
									
										
										
										
											2003-06-21 11:44:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |