[Bf-python] Object.DupObjects error : the correction, the return

jean-michel soler jmsoler at free.fr
Wed Apr 19 01:20:56 CEST 2006


Your "PyList_New( BLI_countlist(&lb)); " make blender crash .

Is it possible to just  write :
PyList_New( BLI_countlist(lb) );


Campbell Barton a écrit :

> Needed to replace PyList_New( BLI_countlist(lb)-1 );  with   
> PyList_New( BLI_countlist(&lb) );
> Thanks JMS, Updated C/Pydocs
>
> jean-michel soler wrote:
>
>> jean-michel soler a écrit :
>>
>>> In Objetc.c
>>>
>>> The line 3195 :
>>> dupli_objects_list= PyList_New( BLI_countlist(lb)-1 );
>>>
>>> should be :
>>> dupli_objects_list= PyList_New( BLI_countlist(lb) );
>>>
>>> Compiled on win32 with MSVC 7.0 + Scons, and tested .
>>> this :
>>>
>>> import Blender
>>> from Blender import Object, Scene, Mathutils
>>>
>>> ob= Object.Get('Cube')
>>
>>
>> Just to say that, in the API doc  this line :
>>
>>> dupe_obs= ob.getDupObjects ()
>>
>>
>> does not work at all and should be :
>> dupe_obs= ob.DupObjects
>>
>>> scn= Scene.GetCurrent()
>>> for dupe_ob, dupe_matrix in dupe_obs:
>>>  print dupe_ob.name
>>>  empty_ob= Object.New('Empty')
>>>  scn.link(empty_ob)
>>>  empty_ob.setMatrix(dupe_matrix)
>>> Blender.Redraw()
>>>
>>> works fine now .
>>>
>>> Cheers, jms
>>>
>>>
>>>
>>> _______________________________________________
>>> Bf-python mailing list
>>> Bf-python at projects.blender.org
>>> http://projects.blender.org/mailman/listinfo/bf-python
>>>
>>>
>>
>>
>> _______________________________________________
>> Bf-python mailing list
>> Bf-python at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-python
>>
>
>





More information about the Bf-python mailing list