I am trying to use an old script to generate random trees. The Blender version is 2.79b and the whole script can be seen here:
My issue is that, as seen on lines 124-130:
bpy.ops.group.create(name='Leaves')
grp = bpy.data.groups.get('Leaves')
objects_to_add = ['autumn_leaves_PNG3609','autumn_leaves_PNG3581',
'green_leaves_PNG3638','green_leaves_PNG3668']
for name in objects_to_add:
obj = bpy.data.objects[name]
grp.objects.link(obj)
this part of the code apparently does not create the group named "Leaves" as the screenshot below
the
'autumn_leaves_PNG3609','autumn_leaves_PNG3581','green_leaves_PNG3638','green_leaves_PNG3668'
are put in the scene correctly but outside the supposed to be created group "Leaves". I don't understand why, also because the script run till the end without any error.