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

Campbell Barton cbarton at metavr.com
Tue Apr 18 17:50:53 CEST 2006


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
>


-- 
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