? getParticlesLoc2.patch ? source/creator/winbuildinfo.h ? tools/Blender.pyc ? tools/__init__.pyc ? tools/bcolors.pyc ? tools/btools.pyc Index: source/blender/python/api2_2x/Effect.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Effect.c,v retrieving revision 1.25 diff -u -r1.25 Effect.c --- source/blender/python/api2_2x/Effect.c 14 Aug 2006 16:29:11 -0000 1.25 +++ source/blender/python/api2_2x/Effect.c 15 Aug 2006 16:56:42 -0000 @@ -98,6 +98,11 @@ #define EXPP_EFFECT_SPEEDTYPE_RGB 1 #define EXPP_EFFECT_SPEEDTYPE_GRADIENT 2 +#define EXPP_EFFECT_STATICSTEP_MIN 1 +#define EXPP_EFFECT_STATICSTEP_MAX 100 +#define EXPP_EFFECT_DISP_MIN 0 +#define EXPP_EFFECT_DISP_MAX 100 + /*****************************************************************************/ /* Python API function prototypes for the Blender module. */ /*****************************************************************************/ @@ -167,10 +172,16 @@ static int Effect_setVertGroup( BPy_Effect * self, PyObject * a ); static PyObject *Effect_getSpeedVertGroup( BPy_Effect * self ); static int Effect_setSpeedVertGroup( BPy_Effect * self, PyObject * a ); +static PyObject *Effect_getStaticStep( BPy_Effect * self ); +static PyObject *Effect_getDisp( BPy_Effect * self ); +static PyObject *Effect_setStaticStep( BPy_Effect * self , PyObject * a); +static PyObject *Effect_setDisp( BPy_Effect * self , PyObject * a); static PyObject *Effect_getParticlesLoc( BPy_Effect * self ); static PyObject *Effect_oldsetType( void ); static PyObject *Effect_oldsetStype( BPy_Effect * self, PyObject * args ); +static PyObject *Effect_oldsetStaticStep( BPy_Effect * self , PyObject * args); +static PyObject *Effect_oldsetDisp( BPy_Effect * self , PyObject * args); static PyObject *Effect_oldsetFlag( BPy_Effect * self, PyObject * args ); static PyObject *Effect_oldsetSta( BPy_Effect * self, PyObject * a ); static PyObject *Effect_oldsetEnd( BPy_Effect * self, PyObject * a ); @@ -314,6 +325,14 @@ METH_NOARGS, "()-Return particle life time"}, {"setDefvec", ( PyCFunction ) Effect_oldsetDefvec, METH_VARARGS, "()- Sets particle life time "}, + {"getStaticStep", ( PyCFunction ) Effect_getStaticStep, + METH_NOARGS, "()- Returns particle Static Step "}, + {"setStaticStep", ( PyCFunction ) Effect_oldsetStaticStep, METH_VARARGS, + "()- Sets particle Static Step "}, + {"getDisp", ( PyCFunction ) Effect_getDisp, + METH_NOARGS, "()- Returns particle Display value "}, +{"setDisp", ( PyCFunction ) Effect_oldsetDisp, METH_VARARGS, + "()- Sets particle Display value "}, {"getParticlesLoc", ( PyCFunction ) Effect_getParticlesLoc, METH_NOARGS, "()- Sets particle life time "}, {NULL, NULL, 0, NULL} @@ -331,6 +350,14 @@ (getter)Effect_getStype, (setter)Effect_setStype, "The particle stype bitfield", NULL}, + {"disp", + (getter)Effect_getDisp, (setter)Effect_setDisp, + "The particle Display value", + NULL}, + {"staticstep", + (getter)Effect_getStaticStep, (setter)Effect_setStaticStep, + "The particle static step value", + NULL}, {"type", (getter)Effect_getType, (setter)Effect_setType, "The effect's type (deprecated)", @@ -439,7 +466,6 @@ (getter)Effect_getVectsize, (setter)Effect_setVectsize, "The speed for particle's rotation direction", NULL}, - {"vGroup", (getter)Effect_getVertGroup, (setter)Effect_setVertGroup, "Vertex group for emitted particles", @@ -1416,6 +1442,69 @@ return 0; } +static PyObject *Effect_getDisp( BPy_Effect * self ) +/*****************************************************************************/ +/* Method: getDisp */ +/* Python equivalent: effectObj.getDisp */ +/* Description: Get the current value of the display number button */ +/* and return nothing */ +/* Data: self effect */ +/* Return: integer value between 0 and 100 */ +/*****************************************************************************/ +{ PyObject *attr = PyInt_FromLong( ( long )self->effect->disp ); + + if( attr ) + return attr; + + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "couldn't get Effect.disp attribute" ); + } + +static PyObject *Effect_setDisp( BPy_Effect * self, PyObject * args ) +/*****************************************************************************/ +/* Method: setDisp */ +/* Python equivalent: effectObj.setDisp */ +/* Description: Set the current value of the display number button */ +/* and return nothing */ +/* Data: integer between 0.0 and 100.0 */ +/*****************************************************************************/ +{return EXPP_setIValueRange( args, &self->effect->disp, + EXPP_EFFECT_DISP_MIN, EXPP_EFFECT_DISP_MAX, + 'h' ); + } + +static PyObject *Effect_getStaticStep( BPy_Effect * self ) +/*****************************************************************************/ +/* Method: getStep */ +/* Python equivalent: effectObj.getStaticStep */ +/* Description: Get the current value of the Step number button */ +/* and return nothing */ +/* Data: self effect */ +/* Return: integer value between 1 and 100 */ +/*****************************************************************************/ +{ PyObject *attr = PyInt_FromLong( ( long )self->effect->staticstep ); + + if( attr ) + return attr; + + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "couldn't get Effect.staticstep attribute" ); + } + +static PyObject *Effect_setStaticStep( BPy_Effect * self , PyObject * args ) +/*****************************************************************************/ +/* Method: setStep */ +/* Python equivalent: effectObj.setStep */ +/* Description: Set the current value of the Step number button */ +/* and return nothing */ +/* Data: integer between 1 and 100 */ +/*****************************************************************************/ +{return EXPP_setIValueRange( args, &self->effect->staticstep, + EXPP_EFFECT_STATICSTEP_MIN, EXPP_EFFECT_STATICSTEP_MAX, + 'h' ); + } + + /*****************************************************************************/ /* Method: getParticlesLoc */ /* Python equivalent: effect.getParticlesLoc */ @@ -1480,7 +1569,7 @@ if(paf->flag & PAF_STATIC ) { strand_list = PyList_New( 0 ); m_time= pa->time+pa->lifetime+paf->staticstep-1; - for(c_time= pa->time; c_timestaticstep) { + for(c_time= pa->time; c_timestaticstep) { where_is_particle(paf, pa, c_time, vec); MTC_Mat4MulVecfl(ob->obmat, vec); /* make worldspace like the others */ if( PyList_Append( strand_list, newVectorObject(vec, 3, Py_NEW)) < 0 ) { @@ -1501,8 +1590,8 @@ } else { if(c_time > pa->time && c_time < pa->time+pa->lifetime ) { /* vector particles are a tuple of 2 vectors */ - if( paf->stype==PAF_VECT ) { - s_time= c_time; + if( paf->stype==PAF_VECT ) { + s_time= c_time; p_time= c_time+1.0f; if(c_time < pa->time) { if(paf->flag & PAF_UNBORN) @@ -1516,24 +1605,24 @@ else continue; } - where_is_particle(paf, pa, s_time, vec); - where_is_particle(paf, pa, p_time, vec1); - if( PyList_Append( list, - Py_BuildValue("[OO]", + where_is_particle(paf, pa, s_time, vec); + where_is_particle(paf, pa, p_time, vec1); + if( PyList_Append( list, + Py_BuildValue("[OO]", newVectorObject(vec, 3, Py_NEW), newVectorObject(vec1, 3, Py_NEW))) < 0 ) { - Py_DECREF( list ); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, + Py_DECREF( list ); + return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't append item to PyList" ); } } else { /* not a vector */ where_is_particle(paf, pa, c_time, vec); if( PyList_Append( list, newVectorObject(vec, 3, Py_NEW)) < 0 ) { - Py_DECREF( list ); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "Couldn't append item to PyList" ); + Py_DECREF( list ); + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "Couldn't append item to PyList" ); } } } @@ -1708,4 +1797,14 @@ static PyObject *Effect_oldsetType( void ) { return EXPP_incr_ret( Py_None ); +} + +static PyObject *Effect_oldsetDisp( BPy_Effect * self, PyObject * args ) +{ + return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setDisp ); +} + +static PyObject *Effect_oldsetStaticStep( BPy_Effect * self, PyObject * args ) +{ + return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setStaticStep ); } Index: source/blender/python/api2_2x/doc/Effect.py =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Effect.py,v retrieving revision 1.12 diff -u -r1.12 Effect.py --- source/blender/python/api2_2x/doc/Effect.py 9 Aug 2006 01:53:34 -0000 1.12 +++ source/blender/python/api2_2x/doc/Effect.py 15 Aug 2006 17:45:44 -0000 @@ -95,6 +95,9 @@ @ivar defvec: The x, y and z axis of the force defined by the texture. Values are clamped to the range [-1.0,1.0]. @type defvec: tuple of 3 floats + @ivar disp: The percentage of particles displayed . + Value is clamped to the range [0,100]. + @type disp: int @ivar dispMat: The material used for the particles. Value is clamped to the range [1,16]. @type dispMat: int @@ -150,6 +153,11 @@ @ivar sta: The start time of the effect. Value is clamped to the range [-250.0,30000.0]. @type sta: float + @ivar staticstep: percentage of skipped particles in static display . + Value is clamped to the range [1,100]. + @type staticstep: int + @ivar stype: The bitfield for vector . + @type stype: int @ivar texfac: The initial speed of the particles caused by the texture. Value is clamped to the range [0.0,2.0]. @type texfac: float @@ -219,7 +227,38 @@ @rtype: None @return: None """ - + def getDisp(): + """ + Retrieves percentage of particles on the 3D display . + @rtype: int + @return: the Disp value of an effect object . + """ + + def setDisp(int): + """ + Sets percentage of particles on the 3D display . + @type int : int + @param int : value for the Disp (percentage of particles on the 3D display) : 0 to 100 . + @rtype: None + @return: None + """ + + def getStaticStep(): + """ + Retrieves percentage of skipped particles in static display . + @rtype: int + @return: the StaticStep value of an effect object . + """ + + def setStaticStep(int): + """ + Sets the percentage of skipped particles in static display . + @type int : int + @param int : value for the StaticStep, percentage of skipped particles in static display : 1 to 100 . + @rtype: None + @return: None + """ + def getEndTime(): """ Retrieves the end time of a particle effect object