[Bf-blender-cvs] [fc38229] id-remap: Merge branch 'lib-link-rework-temp' into id-remap

Bastien Montagne noreply at git.blender.org
Tue Sep 22 10:03:48 CEST 2015


Commit: fc3822988c91aecf032d382b3838d37331eecb27
Author: Bastien Montagne
Date:   Tue Sep 22 10:02:39 2015 +0200
Branches: id-remap
https://developer.blender.org/rBfc3822988c91aecf032d382b3838d37331eecb27

Merge branch 'lib-link-rework-temp' into id-remap

===================================================================



===================================================================

diff --cc source/blender/windowmanager/intern/wm_operators.c
index 139dc07,647e7af..b8ed429
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@@ -2684,9 -2683,8 +2684,8 @@@ static void wm_link_do
  	BlendHandle *bh;
  	Library *lib;
  
 -	const int flag = lapp_data->flag;
 +	const short flag = lapp_data->flag;
  
- 	BLI_bitmap *done_items = BLI_BITMAP_NEW_ALLOCA(lapp_data->num_items);
  	LinkNode *liblink, *itemlink;
  	int lib_idx, item_idx;
  
@@@ -2717,41 -2714,22 +2715,23 @@@
  			            mainl->versionfile, mainl->subversionfile);
  		}
  
- 		/* For each lib file, we loop until we have (tried) to link all items belonging to that lib. */
- 		BLI_BITMAP_SET_ALL(done_items, false, lapp_data->num_items);
- 		while (true) {
- 			for (item_idx = 0, idcode = -1, itemlink = lapp_data->items.list;
- 			     itemlink;
- 			     item_idx++, itemlink = itemlink->next)
- 			{
- 				WMLinkAppendDataItem *item = itemlink->link;
- 				ID *new_id;
- 
- 				if (BLI_BITMAP_TEST(done_items, item_idx) || !BLI_BITMAP_TEST(item->libraries, lib_idx)) {
- 					continue;
- 				}
- 				if (idcode == -1) {
- 					idcode = item->idcode;
- 				}
- 				else if (item->idcode != idcode) {
- 					continue;
- 				}
- 
- 				BLI_BITMAP_ENABLE(done_items, item_idx);
- 
- 				new_id = BLO_library_link_named_part_ex(
- 				             mainl, &bh, item->name, idcode, flag, scene, v3d, use_placeholders, force_indirect);
- 				if (new_id) {
- 					/* If the link is sucessful, clear item's libs 'todo' flags.
- 					 * This avoids trying to link same item with other libraries to come. */
- 					BLI_BITMAP_SET_ALL(item->libraries, false, lapp_data->num_libraries);
- 					item->new_id = new_id;
- 				}
+ 		/* For each lib file, we try to link all items belonging to that lib,
+ 		 * and tag those successful to not try to load them again with the other libs. */
+ 		for (item_idx = 0, itemlink = lapp_data->items.list; itemlink; item_idx++, itemlink = itemlink->next) {
+ 			WMLinkAppendDataItem *item = itemlink->link;
+ 			ID *new_id;
  
+ 			if (!BLI_BITMAP_TEST(item->libraries, lib_idx)) {
+ 				continue;
  			}
- 			if (idcode == -1) {
- 				/* We have handled all items for this library, so we are done with it. */
- 				break;
+ 
 -			new_id = BLO_library_link_named_part_ex(mainl, &bh, item->name, item->idcode, flag, scene, v3d);
++			new_id = BLO_library_link_named_part_ex(
++			             mainl, &bh, item->name, item->idcode, flag, scene, v3d, use_placeholders, force_indirect);
+ 			if (new_id) {
+ 				/* If the link is sucessful, clear item's libs 'todo' flags.
+ 				 * This avoids trying to link same item with other libraries to come. */
+ 				BLI_BITMAP_SET_ALL(item->libraries, false, lapp_data->num_libraries);
+ 				item->new_id = new_id;
  			}
  		}




More information about the Bf-blender-cvs mailing list