[Bf-python] Object get/set functions for DupliFrames, Group, Rot, NoSpeed
Campbell Barton
cbarton at metavr.com
Tue Feb 21 02:02:01 CET 2006
Hey JMS, Good Work, Hope this gets into Blender, its a neat way to do
duplicators. could work for dupliframes and dupliverts.
- PyDocs ARE needed, but we can still test patches that dont have them-
some people commit functions before they commit pydocs.
jmsoler at free.fr wrote:
> Selon Tom M <letterrip at gmail.com>:
>
>
>> jms,
>>
>> you need to to the pydocs also.
>>
>> LetterRip
>>
>>
>
> I am also working on this function :
>
> static PyObject *Object_getDupliObjectsList ( BPy_Object * self )
> {
> PyObject *dupli_objects_list;
> Object *ob=self->object;
> Scene *sce=G.scene;
> dupli_objects_list= PyList_New( 0 );
>
> if( !dupli_objects_list )
> return EXPP_ReturnPyObjError( PyExc_RuntimeError,
> "PyList_New() failed" );
>
> if(ob->transflag & OB_DUPLI)
> {
> /* before make duplis, update particle for current frame */
> if(ob->transflag & OB_DUPLIVERTS)
> {
> PartEff *paf= give_parteff(ob);
> if(paf)
> {
> if(paf->flag & PAF_ANIMATED) build_particle_system(ob);
> }
> }
> if(ob->type!=OB_MBALL)
> {
> DupliObject *dob;
> ListBase *lb= object_duplilist(sce, ob);
> dob = lb->first;
> while(dob)
> {
> if( PyList_Append( dupli_objects_list,
> Py_BuildValue("[[ffff],[ffff],[ffff],[ffff]]",
> dob->mat[0][0], dob->mat[0][1], dob->mat[0][2],dob->mat[0][3],
> dob->mat[1][0], dob->mat[1][1], dob->mat[1][2],dob->mat[1][3],
> dob->mat[2][0], dob->mat[2][1], dob->mat[2][2],dob->mat[2][3],
> dob->mat[3][0], dob->mat[3][1], dob->mat[3][2],dob->mat[3][3]) ) < 0 )
> {
> Py_DECREF( dupli_objects_list );
> return EXPP_ReturnPyObjError( PyExc_RuntimeError,
> "Couldn't append item to PyList" );
> }
> dob= dob->next;
> }
> free_object_duplilist(lb);
> }
> }
> return dupli_objects_list;
> }
>
> It should return a list of matrices but only the new location of
> the duplicated objects is different, the size and the rotation are
> similar to the original .
>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>
>
--
Campbell J Barton
133 Hope Street
Geelong West, Victoria 3218 Australia
URL: http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241
More information about the Bf-python
mailing list