Added to existing scn.objects
scn.objects.active (get/set the active object for the scene)
scn.objects.selected - an iterator that only uses selected objects
scn.objects.context - an iterator on objects in the user context (visible in the current 3d views layer and selected)
These are the same type as scn.objects but .add() .remove() .new() .active etc raise errors. so scn.objects.selected.add() will raise an error.
Made nested loops possible with scn.objects, metaball.elements and ob.modifiers, by initializing the iter value as NULL and creating copys of the pyobject when _getIter() is called if ->iter is not NULL.
This is how pythons xrange() works.
implicit declarations, redundant redeclarations, missing initializers,
nested externs and other cruft.
Cleaned up includes and moved extern _Type decls from Types.h into
Types.c since that is the only place where they are needed now.
Did not touch Ipo.[ch] since work is on-going there.
grp.objects
To have an iterator assigned as well as a list. Since gp.objects is an ietartor this is expected.
grp.objects= someGroup.objects works now.
Some other small fixes made.
Made a wrapper for add_to_group() That handles the OB_FROMGROUP flag. Should be moved to group.c's add_to_group()
void add_to_group_wraper(Group *group, Object *ob) {
Base *base;
add_to_group(group, ob);
if (!(ob->flag & OB_FROMGROUP)) { /* do this to avoid a listbase lookup */
ob->flag |= OB_FROMGROUP;
base= object_in_scene(ob, G.scene);
if (base)
base->flag |= OB_FROMGROUP;
}
}