[Bf-python] Object get/set functions for DupliFrames, Group, Rot, NoSpeed

jmsoler at free.fr jmsoler at free.fr
Mon Feb 20 23:06:47 CET 2006


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 .





More information about the Bf-python mailing list