| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2004-09-18 18:47:03 +00:00
										 |  |  |  * $Id$ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +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. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  |  * Contributor(s): Jacques Guignot, Jean-Michel Soler  | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL/BL DUAL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | #include "Particle.h" /*This must come first */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "DNA_object_types.h"
 | 
					
						
							|  |  |  | #include "BKE_effect.h"
 | 
					
						
							|  |  |  | #include "BKE_global.h"
 | 
					
						
							|  |  |  | #include "BKE_main.h"
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | #include "BKE_object.h"
 | 
					
						
							|  |  |  | #include "BLI_blenlib.h"
 | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | #include "gen_utils.h"
 | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python API function prototypes for the Particle module.                   */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | PyObject *M_Particle_New( PyObject * self, PyObject * args ); | 
					
						
							|  |  |  | PyObject *M_Particle_Get( PyObject * self, PyObject * args ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python BPy_Particle methods declarations:                                 */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | PyObject *Effect_getType( BPy_Effect * self ); | 
					
						
							|  |  |  | PyObject *Effect_setType( BPy_Effect * self, PyObject * args ); | 
					
						
							|  |  |  | PyObject *Effect_getFlag( BPy_Effect * self ); | 
					
						
							|  |  |  | PyObject *Effect_setFlag( BPy_Effect * self, PyObject * args ); | 
					
						
							|  |  |  | PyObject *Particle_getSta( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setSta( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getEnd( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setEnd( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getLifetime( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setLifetime( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getNormfac( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setNormfac( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getObfac( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setObfac( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getRandfac( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setRandfac( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getTexfac( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setTexfac( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getRandlife( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setRandlife( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getNabla( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setNabla( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getVectsize( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setVectsize( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getTotpart( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setTotpart( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getTotkey( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setTotkey( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getSeed( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setSeed( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getForce( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setForce( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getMult( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setMult( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getLife( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setLife( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getMat( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setMat( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getChild( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setChild( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | PyObject *Particle_getDefvec( BPy_Particle * self ); | 
					
						
							|  |  |  | PyObject *Particle_setDefvec( BPy_Particle * self, PyObject * a ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python Particle_Type callback function prototypes:                        */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | void ParticleDeAlloc( BPy_Particle * msh ); | 
					
						
							|  |  |  | //int ParticlePrint (BPy_Particle *msh, FILE *fp, int flags);
 | 
					
						
							|  |  |  | int ParticleSetAttr( BPy_Particle * msh, char *name, PyObject * v ); | 
					
						
							|  |  |  | PyObject *ParticleGetAttr( BPy_Particle * msh, char *name ); | 
					
						
							|  |  |  | PyObject *ParticleRepr( void ); | 
					
						
							|  |  |  | PyObject *ParticleCreatePyObject( struct Effect *particle ); | 
					
						
							|  |  |  | int ParticleCheckPyObject( PyObject * py_obj ); | 
					
						
							|  |  |  | struct Particle *ParticleFromPyObject( PyObject * py_obj ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Python BPy_Particle methods table:                                        */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | static PyMethodDef BPy_Particle_methods[] = { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getType", ( PyCFunction ) Effect_getType, | 
					
						
							|  |  |  | 	 METH_NOARGS, "() - Return Effect type"}, | 
					
						
							|  |  |  | 	{"setType", ( PyCFunction ) Effect_setType, | 
					
						
							|  |  |  | 	 METH_VARARGS, "() - Set Effect type"}, | 
					
						
							|  |  |  | 	{"getFlag", ( PyCFunction ) Effect_getFlag, | 
					
						
							|  |  |  | 	 METH_NOARGS, "() - Return Effect flag"}, | 
					
						
							|  |  |  | 	{"setFlag", ( PyCFunction ) Effect_setFlag, | 
					
						
							|  |  |  | 	 METH_VARARGS, "() - Set Effect flag"}, | 
					
						
							|  |  |  | 	{"getStartTime", ( PyCFunction ) Particle_getSta, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle start time"}, | 
					
						
							|  |  |  | 	{"setStartTime", ( PyCFunction ) Particle_setSta, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle start time"}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getEndTime", ( PyCFunction ) Particle_getEnd, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle end time"}, | 
					
						
							|  |  |  | 	{"setEndTime", ( PyCFunction ) Particle_setEnd, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle end time"}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getLifetime", ( PyCFunction ) Particle_getLifetime, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setLifetime", ( PyCFunction ) Particle_setLifetime, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getNormfac", ( PyCFunction ) Particle_getNormfac, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setNormfac", ( PyCFunction ) Particle_setNormfac, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getObfac", ( PyCFunction ) Particle_getObfac, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setObfac", ( PyCFunction ) Particle_setObfac, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getRandfac", ( PyCFunction ) Particle_getRandfac, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setRandfac", ( PyCFunction ) Particle_setRandfac, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getTexfac", ( PyCFunction ) Particle_getTexfac, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setTexfac", ( PyCFunction ) Particle_setTexfac, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getRandlife", ( PyCFunction ) Particle_getRandlife, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setRandlife", ( PyCFunction ) Particle_setRandlife, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getNabla", ( PyCFunction ) Particle_getNabla, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setNabla", ( PyCFunction ) Particle_setNabla, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getVectsize", ( PyCFunction ) Particle_getVectsize, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setVectsize", ( PyCFunction ) Particle_setVectsize, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getTotpart", ( PyCFunction ) Particle_getTotpart, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setTotpart", ( PyCFunction ) Particle_setTotpart, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getTotkey", ( PyCFunction ) Particle_getTotkey, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setTotkey", ( PyCFunction ) Particle_setTotkey, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getSeed", ( PyCFunction ) Particle_getSeed, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setSeed", ( PyCFunction ) Particle_setSeed, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getForce", ( PyCFunction ) Particle_getForce, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setForce", ( PyCFunction ) Particle_setForce, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getMult", ( PyCFunction ) Particle_getMult, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setMult", ( PyCFunction ) Particle_setMult, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getLife", ( PyCFunction ) Particle_getLife, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setLife", ( PyCFunction ) Particle_setLife, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getMat", ( PyCFunction ) Particle_getMat, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setMat", ( PyCFunction ) Particle_setMat, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getChild", ( PyCFunction ) Particle_getChild, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setChild", ( PyCFunction ) Particle_setChild, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getDefvec", ( PyCFunction ) Particle_getDefvec, | 
					
						
							|  |  |  | 	 METH_NOARGS, "()-Return particle life time"}, | 
					
						
							|  |  |  | 	{"setDefvec", ( PyCFunction ) Particle_setDefvec, METH_VARARGS, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	 "()- Sets particle life time "}, | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2004-06-06 22:42:51 +00:00
										 |  |  | 	{NULL, NULL, 0, NULL} | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | /**************** prototypes ********************/ | 
					
						
							|  |  |  | PyObject *Particle_Init( void ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python Particle_Type structure definition:                                */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyTypeObject Particle_Type = { | 
					
						
							|  |  |  | 	PyObject_HEAD_INIT( NULL ) | 
					
						
							|  |  |  | 		0, | 
					
						
							|  |  |  | 	"Particle", | 
					
						
							|  |  |  | 	sizeof( BPy_Particle ), | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	( destructor ) ParticleDeAlloc, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	( getattrfunc ) ParticleGetAttr, | 
					
						
							|  |  |  | 	( setattrfunc ) ParticleSetAttr, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	( reprfunc ) ParticleRepr, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	0, 0, 0, 0, 0, 0, | 
					
						
							|  |  |  | 	0, | 
					
						
							|  |  |  | 	0, 0, 0, 0, 0, 0, | 
					
						
							|  |  |  | 	BPy_Particle_methods, | 
					
						
							|  |  |  | 	0, | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* The following string definitions are used for documentation strings.      */ | 
					
						
							|  |  |  | /* In Python these will be written to the console when doing a               */ | 
					
						
							|  |  |  | /* Blender.Particle.__doc__                                                  */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | char M_Particle_doc[] = "The Blender Particle module\n\n\
 | 
					
						
							|  |  |  | This module provides access to **Object Data** in Blender.\n\ | 
					
						
							|  |  |  | Functions :\n\ | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	New(object mesh's name) : creates a new part object and adds it to the given mesh object \n\ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	Get(name) : retreives a particle  with the given name (mandatory)\n\ | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	get(name) : same as Get.  Kept for compatibility reasons.\n"; | 
					
						
							|  |  |  | char M_Particle_New_doc[] = "New(name) : creates a new part object and adds it to the given mesh object\n"; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | char M_Particle_Get_doc[] = "xxx"; | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python method structure definition for Blender.Particle module:           */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | struct PyMethodDef M_Particle_methods[] = { | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	{"New", ( PyCFunction ) M_Particle_New, METH_VARARGS, M_Particle_New_doc}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"Get", M_Particle_Get, METH_VARARGS, M_Particle_Get_doc}, | 
					
						
							|  |  |  | 	{"get", M_Particle_Get, METH_VARARGS, M_Particle_Get_doc}, | 
					
						
							|  |  |  | 	{NULL, NULL, 0, NULL} | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:              M_Particle_New                                     */ | 
					
						
							|  |  |  | /* Python equivalent:     Blender.Effect.Particle.New                        */ | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | /* Description :          Create a particle effect and add a link            */ | 
					
						
							|  |  |  | /*                        to the given mesh-type Object                      */ | 
					
						
							|  |  |  | /* Data  :                String  mesh object name                           */ | 
					
						
							|  |  |  | /* Return :               pyobject particle                                  */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *M_Particle_New( PyObject * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Effect *pyeffect; | 
					
						
							|  |  |  | 	Effect *bleffect = 0; | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	Object *ob; | 
					
						
							|  |  |  | 	char *name = NULL; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "s", &name ) ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 				"expected string argument" ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	for( ob = G.main->object.first; ob; ob = ob->id.next ) | 
					
						
							|  |  |  | 		if( !strcmp( name, ob->id.name + 2 ) ) | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	if( !ob ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_AttributeError,  | 
					
						
							|  |  |  | 				"object does not exist" ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	if( ob->type != OB_MESH ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_AttributeError,  | 
					
						
							|  |  |  | 				"object is not a mesh" ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	pyeffect = ( BPy_Effect * ) PyObject_NEW( BPy_Effect, &Effect_Type ); | 
					
						
							|  |  |  | 	if( !pyeffect ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_MemoryError, | 
					
						
							|  |  |  | 				"couldn't create Effect Data object" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	bleffect = add_effect( EFF_PARTICLE ); | 
					
						
							|  |  |  | 	if( !bleffect ) { | 
					
						
							|  |  |  | 		Py_DECREF( pyeffect ); | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_RuntimeError, | 
					
						
							|  |  |  | 				"couldn't create Effect Data in Blender" ); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-29 05:08:29 +00:00
										 |  |  | 	pyeffect->effect = (PartEff *)bleffect; | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 	BLI_addtail( &ob->effect, bleffect ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return ( PyObject * ) pyeffect; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:              M_Particle_Get                                     */ | 
					
						
							|  |  |  | /* Python equivalent:     Blender.Effect.Particle.Get                        */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *M_Particle_Get( PyObject * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	/*arguments : string object name
 | 
					
						
							|  |  |  | 	   int : position of effect in the obj's effect list  */ | 
					
						
							|  |  |  | 	char *name = 0; | 
					
						
							|  |  |  | 	Object *object_iter; | 
					
						
							|  |  |  | 	Effect *eff; | 
					
						
							|  |  |  | 	BPy_Particle *wanted_eff; | 
					
						
							|  |  |  | 	int num, i; | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "si", &name, &num ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected string int argument" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	object_iter = G.main->object.first; | 
					
						
							|  |  |  | 	if( !object_iter ) | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 		return EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"Scene contains no object" ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	while( object_iter ) { | 
					
						
							|  |  |  | 		if( strcmp( name, object_iter->id.name + 2 ) ) { | 
					
						
							|  |  |  | 			object_iter = object_iter->id.next; | 
					
						
							|  |  |  | 			continue; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if( object_iter->effect.first != NULL ) { | 
					
						
							|  |  |  | 			eff = object_iter->effect.first; | 
					
						
							|  |  |  | 			for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 				if( eff->type != EFF_PARTICLE ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 					continue; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 				eff = eff->next; | 
					
						
							|  |  |  | 				if( !eff ) | 
					
						
							|  |  |  | 					return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 						 ( PyExc_AttributeError, | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 						   "Object" ) ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			wanted_eff = | 
					
						
							|  |  |  | 				( BPy_Particle * ) PyObject_NEW( BPy_Particle, | 
					
						
							|  |  |  | 								 &Particle_Type ); | 
					
						
							|  |  |  | 			wanted_eff->particle = eff; | 
					
						
							|  |  |  | 			return ( PyObject * ) wanted_eff; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		object_iter = object_iter->id.next; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-28 07:38:21 +00:00
										 |  |  | /* Function:              Particle_Init                                      */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_Init( void ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *submodule; | 
					
						
							|  |  |  | 	Particle_Type.ob_type = &PyType_Type; | 
					
						
							|  |  |  | 	submodule = | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | 		Py_InitModule3( "Blender.Particle", M_Particle_methods,	M_Particle_doc ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( submodule ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | /* Python BPy_Particle methods:                                                */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getSta( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->sta ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setSta( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->sta = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | PyObject *Particle_getEnd( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->end ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setEnd( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->end = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getLifetime( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->lifetime ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setLifetime( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->lifetime = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getNormfac( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->normfac ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setNormfac( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->normfac = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getObfac( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->obfac ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setObfac( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->obfac = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getRandfac( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->randfac ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setRandfac( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->randfac = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getTexfac( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->texfac ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setTexfac( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->texfac = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getRandlife( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->randlife ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setRandlife( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->randlife = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getNabla( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->nabla ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setNabla( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->nabla = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getVectsize( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( ptr->vectsize ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setVectsize( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "f", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected float argument" ) ); | 
					
						
							|  |  |  | 	ptr->vectsize = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getTotpart( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyInt_FromLong( ptr->totpart ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setTotpart( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	int val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "i", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected int argument" ) ); | 
					
						
							|  |  |  | 	ptr->totpart = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getTotkey( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyInt_FromLong( ptr->totkey ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setTotkey( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	int val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "i", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected int argument" ) ); | 
					
						
							|  |  |  | 	ptr->totkey = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getSeed( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return PyInt_FromLong( ptr->seed ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setSeed( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	int val = 0; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "i", &val ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						"expected int argument" ) ); | 
					
						
							|  |  |  | 	ptr->seed = val; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getForce( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return Py_BuildValue( "(f,f,f)", ptr->force[0], ptr->force[1], | 
					
						
							|  |  |  | 			      ptr->force[2] ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setForce( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	float val[3]; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( PyTuple_Size( args ) == 1 ) | 
					
						
							|  |  |  | 		args = PyTuple_GetItem( args, 0 ); | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | 	val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) ); | 
					
						
							|  |  |  | 	val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) ); | 
					
						
							|  |  |  | 	val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	/*
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	   if (!PyArg_ParseTuple(args, "fff", val,val+1,val+2 )) | 
					
						
							|  |  |  | 	   return(EXPP_ReturnPyObjError(PyExc_AttributeError,\ | 
					
						
							|  |  |  | 	   "expected three float arguments")); | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	ptr->force[0] = val[0]; | 
					
						
							|  |  |  | 	ptr->force[1] = val[1]; | 
					
						
							|  |  |  | 	ptr->force[2] = val[2]; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyObject *Particle_getMult( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return Py_BuildValue( "(f,f,f,f)", | 
					
						
							|  |  |  | 			      ptr->mult[0], ptr->mult[1], ptr->mult[2], | 
					
						
							|  |  |  | 			      ptr->mult[3] ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setMult( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	float val[4]; | 
					
						
							|  |  |  | 	if( PyTuple_Size( args ) == 1 ) | 
					
						
							|  |  |  | 		args = PyTuple_GetItem( args, 0 ); | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | 	val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) ); | 
					
						
							|  |  |  | 	val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) ); | 
					
						
							|  |  |  | 	val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) ); | 
					
						
							|  |  |  | 	val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	ptr->mult[0] = val[0]; | 
					
						
							|  |  |  | 	ptr->mult[1] = val[1]; | 
					
						
							|  |  |  | 	ptr->mult[2] = val[2]; | 
					
						
							|  |  |  | 	ptr->mult[3] = val[3]; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getLife( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return Py_BuildValue( "(f,f,f,f)", | 
					
						
							|  |  |  | 			      ptr->life[0], ptr->life[1], ptr->life[2], | 
					
						
							|  |  |  | 			      ptr->life[3] ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setLife( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	float val[4]; | 
					
						
							|  |  |  | 	if( PyTuple_Size( args ) == 1 ) | 
					
						
							|  |  |  | 		args = PyTuple_GetItem( args, 0 ); | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | 	val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) ); | 
					
						
							|  |  |  | 	val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) ); | 
					
						
							|  |  |  | 	val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) ); | 
					
						
							|  |  |  | 	val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	ptr->life[0] = val[0]; | 
					
						
							|  |  |  | 	ptr->life[1] = val[1]; | 
					
						
							|  |  |  | 	ptr->life[2] = val[2]; | 
					
						
							|  |  |  | 	ptr->life[3] = val[3]; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getChild( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return Py_BuildValue( "(f,f,f,f)", | 
					
						
							|  |  |  | 			      ptr->child[0], ptr->child[1], ptr->child[2], | 
					
						
							|  |  |  | 			      ptr->child[3] ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setChild( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	float val[4]; | 
					
						
							|  |  |  | 	if( PyTuple_Size( args ) == 1 ) | 
					
						
							|  |  |  | 		args = PyTuple_GetItem( args, 0 ); | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | 	val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) ); | 
					
						
							|  |  |  | 	val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) ); | 
					
						
							|  |  |  | 	val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) ); | 
					
						
							|  |  |  | 	val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) ); | 
					
						
							|  |  |  | 	ptr->child[0] = (short)val[0]; | 
					
						
							|  |  |  | 	ptr->child[1] = (short)val[1]; | 
					
						
							|  |  |  | 	ptr->child[2] = (short)val[2]; | 
					
						
							|  |  |  | 	ptr->child[3] = (short)val[3]; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_getMat( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return Py_BuildValue( "(f,f,f,f)", | 
					
						
							|  |  |  | 			      ptr->mat[0], ptr->mat[1], ptr->mat[2], | 
					
						
							|  |  |  | 			      ptr->mat[3] ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setMat( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	float val[4]; | 
					
						
							|  |  |  | 	if( PyTuple_Size( args ) == 1 ) | 
					
						
							|  |  |  | 		args = PyTuple_GetItem( args, 0 ); | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | 	val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) ); | 
					
						
							|  |  |  | 	val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) ); | 
					
						
							|  |  |  | 	val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) ); | 
					
						
							|  |  |  | 	val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) ); | 
					
						
							|  |  |  | 	ptr->mat[0] = (short)val[0]; | 
					
						
							|  |  |  | 	ptr->mat[1] = (short)val[1]; | 
					
						
							|  |  |  | 	ptr->mat[2] = (short)val[2]; | 
					
						
							|  |  |  | 	ptr->mat[3] = (short)val[3]; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyObject *Particle_getDefvec( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	return Py_BuildValue( "(f,f,f)", | 
					
						
							|  |  |  | 			      ptr->defvec[0], ptr->defvec[1], ptr->defvec[2] ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Particle_setDefvec( BPy_Particle * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PartEff *ptr = ( PartEff * ) self->particle; | 
					
						
							|  |  |  | 	float val[3]; | 
					
						
							|  |  |  | 	if( PyTuple_Size( args ) == 1 ) | 
					
						
							|  |  |  | 		args = PyTuple_GetItem( args, 0 ); | 
					
						
							| 
									
										
										
										
											2005-07-18 03:50:37 +00:00
										 |  |  | 	val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) ); | 
					
						
							|  |  |  | 	val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) ); | 
					
						
							|  |  |  | 	val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	ptr->defvec[0] = val[0]; | 
					
						
							|  |  |  | 	ptr->defvec[1] = val[1]; | 
					
						
							|  |  |  | 	ptr->defvec[2] = val[2]; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    ParticleDeAlloc                                              */ | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Particle type. It is   */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*              the destructor function.                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | void ParticleDeAlloc( BPy_Particle * self ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PartEff *ptr = ( PartEff * ) self; | 
					
						
							|  |  |  | 	PyObject_DEL( ptr ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    ParticleGetAttr                                              */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Particle type. It is */ | 
					
						
							|  |  |  | /*              the function that accesses BPy_Particle "member variables"   */ | 
					
						
							|  |  |  | /*              and  methods.                                                */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *ParticleGetAttr( BPy_Particle * self, char *name ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( strcmp( name, "seed" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getSeed( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "nabla" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getNabla( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "sta" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getSta( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "end" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getEnd( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "lifetime" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getLifetime( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "normfac" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getNormfac( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "obfac" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getObfac( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "randfac" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getRandfac( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "texfac" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getTexfac( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "randlife" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getRandlife( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "vectsize" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getVectsize( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "totpart" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getTotpart( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "force" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getForce( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "mult" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getMult( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "life" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getLife( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "child" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getChild( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "mat" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getMat( self ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "defvec" ) == 0 ) | 
					
						
							|  |  |  | 		return Particle_getDefvec( self ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return Py_FindMethod( BPy_Particle_methods, ( PyObject * ) self, | 
					
						
							|  |  |  | 			      name ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    ParticleSetAttr                                              */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Particle type.     */ | 
					
						
							|  |  |  | /*              It is the  function that sets Particle Data attributes     */ | 
					
						
							|  |  |  | /*              (member vars)    */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | int ParticleSetAttr( BPy_Particle * self, char *name, PyObject * value ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	PyObject *valtuple; | 
					
						
							|  |  |  | 	PyObject *error = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	valtuple = Py_BuildValue( "(N)", value ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !valtuple ) | 
					
						
							|  |  |  | 		return EXPP_ReturnIntError( PyExc_MemoryError, | 
					
						
							|  |  |  | 					    "ParticleSetAttr: couldn't create PyTuple" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( strcmp( name, "seed" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setSeed( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "nabla" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setNabla( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "sta" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setSta( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "end" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setEnd( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "lifetime" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setLifetime( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "normfac" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setNormfac( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "obfac" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setObfac( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "randfac" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setRandfac( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "texfac" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setTexfac( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "randlife" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setRandlife( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "nabla" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setNabla( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "vectsize" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setVectsize( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "totpart" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setTotpart( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "seed" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setSeed( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "force" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setForce( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "mult" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setMult( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "life" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setLife( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "child" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setChild( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "mat" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setMat( self, valtuple ); | 
					
						
							|  |  |  | 	else if( strcmp( name, "defvec" ) == 0 ) | 
					
						
							|  |  |  | 		error = Particle_setDefvec( self, valtuple ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	else { | 
					
						
							|  |  |  | 		Py_DECREF( valtuple ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if( ( strcmp( name, "Types" ) == 0 ) || | 
					
						
							|  |  |  | 		    ( strcmp( name, "Modes" ) == 0 ) ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnIntError( PyExc_AttributeError, | 
					
						
							|  |  |  | 						      "constant dictionary -- cannot be changed" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		else | 
					
						
							|  |  |  | 			return ( EXPP_ReturnIntError( PyExc_KeyError, | 
					
						
							|  |  |  | 						      "attribute not found" ) ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-17 05:10:14 +00:00
										 |  |  | 	Py_DECREF(valtuple); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( error != Py_None ) | 
					
						
							|  |  |  | 		return -1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Py_DECREF( Py_None ); | 
					
						
							|  |  |  | 	return 0; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    ParticlePrint                                                */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Particle type. It    */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*              particles a meaninful string to 'print' particle objects.    */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-07-04 16:06:39 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | int ParticlePrint(BPy_Particle *self, FILE *fp, int flags)  | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | {  | 
					
						
							|  |  |  |   printf("Hi, I'm a particle!");	 | 
					
						
							|  |  |  |   return 0; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2003-07-04 16:06:39 +00:00
										 |  |  | */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    ParticleRepr                                                 */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Particle type. It    */ | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | /*              particles a meaninful string to represent particle objects.  */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2005-11-04 20:34:38 +00:00
										 |  |  | PyObject *ParticleRepr( void ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return PyString_FromString( "Particle" ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *ParticleCreatePyObject( struct Effect * particle ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Particle *blen_object; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	blen_object = | 
					
						
							|  |  |  | 		( BPy_Particle * ) PyObject_NEW( BPy_Particle, | 
					
						
							|  |  |  | 						 &Particle_Type ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( blen_object == NULL ) { | 
					
						
							|  |  |  | 		return ( NULL ); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 	blen_object->particle = particle; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( ( PyObject * ) blen_object ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | int ParticleCheckPyObject( PyObject * py_obj ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( py_obj->ob_type == &Particle_Type ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | struct Particle *ParticleFromPyObject( PyObject * py_obj ) | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Particle *blen_obj; | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	blen_obj = ( BPy_Particle * ) py_obj; | 
					
						
							|  |  |  | 	return ( ( struct Particle * ) blen_obj->particle ); | 
					
						
							| 
									
										
										
										
											2003-06-22 13:51:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |