[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39013] trunk/blender/source/blender/ blenloader/intern/readfile.c: when appending with a NULL context dont print warnigns about scene not being set - was annoying for BGE LibLoad .
Mitchell Stokes
mogurijin at gmail.com
Thu Aug 4 23:33:45 CEST 2011
I haven't tested LibLoad(), but I get the feeling this won't fix the
issue of printing unnecessary warnings for LibLoad() since it isn't
using a NULL context.
Cheers,
Mitchell
On Thu, Aug 4, 2011 at 2:47 AM, Campbell Barton <ideasman42 at gmail.com> wrote:
> Revision: 39013
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39013
> Author: campbellbarton
> Date: 2011-08-04 09:47:09 +0000 (Thu, 04 Aug 2011)
> Log Message:
> -----------
> when appending with a NULL context dont print warnigns about scene not being set - was annoying for BGE LibLoad.
>
> Modified Paths:
> --------------
> trunk/blender/source/blender/blenloader/intern/readfile.c
>
> Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
> ===================================================================
> --- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-08-04 08:46:17 UTC (rev 39012)
> +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-08-04 09:47:09 UTC (rev 39013)
> @@ -13047,10 +13047,10 @@
> }
> }
>
> +/* 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,23 +13079,29 @@
> 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 */
> + if(C) {
> + Scene *scene= CTX_data_scene(C);
> +
> + /* 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 {
> - give_base_to_objects(mainvar, scene, curlib, idcode, is_link);
> + printf("library_append_end, scene is NULL (objects wont get bases)\n");
> + }
>
> - if (flag & FILE_GROUP_INSTANCE) {
> - give_base_to_groups(mainvar, scene);
> - }
> - }
> + append_do_cursor(scene, curlib, flag);
> }
> - else {
> - printf("library_append_end, scene is NULL (objects wont get bases)\n");
> - }
> /* has been removed... erm, why? s..ton) */
> /* 20040907: looks like they are give base already in append_named_part(); -Nathan L */
> /* 20041208: put back. It only linked direct, not indirect objects (ton) */
> @@ -13105,8 +13111,6 @@
> 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)
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
More information about the Bf-committers
mailing list