From fede495c073a7369a61e668dae95cf8c7b99a068 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Tue, 9 Sep 2008 20:52:18 +0000 Subject: Python API ---------- Bugfix #14425. Particle.Get() could return a list of invalid items. The API still needs more work, but for now throw an NotImplemented exception. --- source/blender/python/api2_2x/Particle.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index bc65426e16c..893ee077d67 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -526,15 +526,18 @@ throws NameError if name not found PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ) { +#if 1 + return EXPP_ReturnPyObjError( PyExc_NotImplementedError, + "Particle.Get() not implemented" ); +#else ParticleSettings *psys_iter; char *name = NULL; -#if 0 ParticleSystem *blparticlesys = 0; Object *ob; PyObject *partsyslist,*current; -#endif + if( !PyArg_ParseTuple( args, "|s", &name ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected string argument" ); @@ -577,7 +580,6 @@ PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ) } while( psys_iter ){ -#if 0 pyobj = ParticleSystem_CreatePyObject( psys_iter); if( !pyobj){ Py_DECREF( pylist ); @@ -586,7 +588,6 @@ PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ) "could not create ParticleSystem PyObject"); } PyList_SET_ITEM( pylist, index, pyobj); -#endif printf("name is %s\n", psys_iter->id.name+2); psys_iter = psys_iter->id.next; index++; @@ -596,10 +597,6 @@ PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ) } - - -#if 0 - for( ob = G.main->particlesystem.first; ob; ob = ob->id.next ) if( !strcmp( name, ob->id.name + 2 ) ) break; @@ -626,7 +623,6 @@ PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ) } return partsyslist; - #endif } -- cgit v1.2.3