I'm writing some Python scripts for refactoring, one of which will be used for relocating a group to another file. The workflow will be to make the new file, open it, link the group, select the group instance, then run a 'Make Source' script.
That script will involve making the top-level group duplicates real, but not the sub-groups, then creating a new group with the same name as the old one, then going through all '.blend' files within a project directory and relinking the group instances within them to the new group, then maybe deleting the old original.
The first part of the script is where I am have problems: making the top-level group duplicates real, but not the sub-groups.
bpy.ops.object.duplicates_make_real() does not seem to do what I need because it just breaks down the sub-groups, though it just throws an error when I run it with Python with arguments.
dupli_list object operators, but
dupli_group just gives the top-level group and
dupli-list seems to be empty.
object.dupli_list_create(context.scene) just given 'None', though I'm probably using it wrong.
Edit 1: I have been able access
dupli-list, but I'm not sure how useful the information held in the DupliObject struct will be.
Edit 2: I think Blender holds as little information on group instances as possible, as such I think what I will need to do is access the source '.blend' file, then directly link the objects that are not in sub-groups and the sub-group instances with their offset.