diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-04 13:47:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-04 13:47:09 +0400 |
commit | 0578d55f1ef700b96ae8a8c33c1f8b54a200c7d9 (patch) | |
tree | a5e9c81aa0fe4561708083d44b3d246002f40bf3 /source/blender | |
parent | af786843b05ce434d46c2036643aefb7bbaa92b6 (diff) |
when appending with a NULL context dont print warnigns about scene not being set - was annoying for BGE LibLoad.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0633794c6ed..0a24dfaed72 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -13047,10 +13047,10 @@ static void append_do_cursor(Scene *scene, Library *curlib, short flag) } } +/* Context == NULL signifies not to do any scene manipulation */ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, int idcode, short flag) { Main *mainvar; - Scene *scene= CTX_data_scene(C); Library *curlib; /* make main consistent */ @@ -13079,22 +13079,28 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in lib_verify_nodetree(mainvar, FALSE); fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */ - /* give a base to loose objects. If group append, do it for objects too */ - if(scene) { - const short is_link= (flag & FILE_LINK) != 0; - if(idcode==ID_SCE) { - /* dont instance anything when linking in scenes, assume the scene its self instances the data */ - } - else { - give_base_to_objects(mainvar, scene, curlib, idcode, is_link); + if(C) { + Scene *scene= CTX_data_scene(C); - if (flag & FILE_GROUP_INSTANCE) { - give_base_to_groups(mainvar, scene); + /* give a base to loose objects. If group append, do it for objects too */ + if(scene) { + const short is_link= (flag & FILE_LINK) != 0; + if(idcode==ID_SCE) { + /* dont instance anything when linking in scenes, assume the scene its self instances the data */ + } + else { + give_base_to_objects(mainvar, scene, curlib, idcode, is_link); + + if (flag & FILE_GROUP_INSTANCE) { + give_base_to_groups(mainvar, scene); + } } } - } - else { - printf("library_append_end, scene is NULL (objects wont get bases)\n"); + else { + printf("library_append_end, scene is NULL (objects wont get bases)\n"); + } + + append_do_cursor(scene, curlib, flag); } /* has been removed... erm, why? s..ton) */ /* 20040907: looks like they are give base already in append_named_part(); -Nathan L */ @@ -13105,8 +13111,6 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in blo_freefiledata( *fd ); *fd = NULL; } - - append_do_cursor(scene, curlib, flag); } void BLO_library_append_end(const bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag) |