[Bf-blender-cvs] [99869da] asset-experiments: Merge branch 'master' into asset-experiments

Bastien Montagne noreply at git.blender.org
Mon Jun 27 17:29:40 CEST 2016


Commit: 99869dab7c05323192bb117d5b3c6960cc7b1b4b
Author: Bastien Montagne
Date:   Mon Jun 27 17:29:09 2016 +0200
Branches: asset-experiments
https://developer.blender.org/rB99869dab7c05323192bb117d5b3c6960cc7b1b4b

Merge branch 'master' into asset-experiments

Conflicts:
	source/blender/blenkernel/BKE_library.h
	source/blender/blenkernel/intern/brush.c
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/library_remap.c
	source/blender/blenkernel/intern/mesh.c
	source/blender/blenloader/BLO_readfile.h
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/writefile.c
	source/blender/editors/space_action/space_action.c
	source/blender/editors/space_clip/space_clip.c
	source/blender/editors/space_file/filelist.c
	source/blender/editors/space_graph/space_graph.c
	source/blender/editors/space_image/space_image.c
	source/blender/editors/space_logic/space_logic.c
	source/blender/editors/space_nla/space_nla.c
	source/blender/editors/space_node/space_node.c
	source/blender/editors/space_outliner/outliner_edit.c
	source/blender/editors/space_sequencer/space_sequencer.c
	source/blender/editors/space_text/space_text.c
	source/blender/editors/space_view3d/space_view3d.c
	source/blender/makesrna/intern/rna_ID.c
	source/blender/makesrna/intern/rna_main_api.c
	source/blender/windowmanager/intern/wm_files_link.c
	source/blender/windowmanager/wm_files.h

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



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

diff --cc source/blender/editors/include/ED_fileselect.h
index bd987f1,92acfa6..5079e62
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@@ -110,10 -109,8 +110,10 @@@ int ED_file_extension_icon(const char *
  
  void ED_file_read_bookmarks(void);
  
- void ED_file_change_dir(struct bContext *C, const bool checkdir);
+ void ED_file_change_dir(struct bContext *C);
  
 +struct AssetEngine *ED_filelist_assetengine_get(struct SpaceFile *sfile);
 +
  /* File menu stuff */
  
  typedef enum FSMenuCategory {
diff --cc source/blender/editors/space_file/filelist.c
index c25b2da,5e9eb1f..8e2eed8
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@@ -982,27 -940,17 +982,27 @@@ int filelist_geticon(struct FileList *f
  
  /* ********** Main ********** */
  
 -static void filelist_checkdir_dir(struct FileList *UNUSED(filelist), char *r_dir)
 +static void filelist_checkdir_dir(struct FileList *filelist, char *r_dir)
  {
 -	BLI_make_exist(r_dir);
 +	if (filelist->ae && filelist->ae->type->check_dir) {
 +		filelist->ae->type->check_dir(filelist->ae, r_dir);
 +	}
 +	else {
 +		BLI_make_exist(r_dir);
 +	}
  }
  
 -static void filelist_checkdir_lib(struct FileList *UNUSED(filelist), char *r_dir)
 +static void filelist_checkdir_lib(struct FileList *filelist, char *r_dir)
  {
 -	char dir[FILE_MAX_LIBEXTRA];
 -	if (!BLO_library_path_explode(r_dir, dir, NULL, NULL)) {
 -		/* if not a valid library, we need it to be a valid directory! */
 -		BLI_make_exist(r_dir);
 +	if (filelist->ae && filelist->ae->type->check_dir) {
 +		filelist->ae->type->check_dir(filelist->ae, r_dir);
 +	}
 +	else {
- 		char dir[FILE_MAXDIR];
++		char dir[FILE_MAX_LIBEXTRA];
 +		if (!BLO_library_path_explode(r_dir, dir, NULL, NULL)) {
 +			/* if not a valid library, we need it to be a valid directory! */
 +			BLI_make_exist(r_dir);
 +		}
  	}
  }
  
@@@ -2309,60 -2113,7 +2309,61 @@@ unsigned int filelist_entry_select_inde
  	return 0;
  }
  
 +/**
 + * Returns a list of selected entries, if use_ae is set also calls asset engine's load_pre callback.
 + * Note first item of returned list shall be used as 'active' file.
 + */
 +FileDirEntryArr *filelist_selection_get(
 +        FileList *filelist, FileCheckType check, const char *name, AssetUUIDList **r_uuids, const bool use_ae)
 +{
 +	FileDirEntryArr *selection;
 +	GHashIterator *iter = BLI_ghashIterator_new(filelist->selection_state);
 +	bool done_name = false;
 +
 +	selection = MEM_callocN(sizeof(*selection), __func__);
 +	strcpy(selection->root, filelist->filelist.root);
 +
 +	for (; !BLI_ghashIterator_done(iter); BLI_ghashIterator_step(iter)) {
 +		const int *uuid = BLI_ghashIterator_getKey(iter);
 +		FileDirEntry *entry_org = filelist_entry_find_uuid(filelist, uuid);
 +
 +		BLI_assert(BLI_ghashIterator_getValue(iter));
 +
 +		if (entry_org &&
 +		    (((ELEM(check, CHECK_ALL, CHECK_NONE))) ||
 +		     ((check == CHECK_DIRS) && (entry_org->typeflag & FILE_TYPE_DIR)) ||
 +		     ((check == CHECK_FILES) && !(entry_org->typeflag & FILE_TYPE_DIR)))) {
 +			/* Always include 'name' (i.e. given relpath) */
 +			if (!done_name && STREQ(entry_org->relpath, name)) {
 +				FileDirEntry *entry_new = BKE_filedir_entry_copy(entry_org);
 +
 +				/* We add it in head - first entry in this list is always considered 'active' one. */
 +				BLI_addhead(&selection->entries, entry_new);
 +				selection->nbr_entries++;
 +				done_name = true;
 +			}
 +			else {
 +				FileDirEntry *entry_new = BKE_filedir_entry_copy(entry_org);
 +				BLI_addtail(&selection->entries, entry_new);
 +				selection->nbr_entries++;
 +			}
 +		}
 +	}
 +
 +	BLI_ghashIterator_free(iter);
 +
 +	if (use_ae && filelist->ae) {
 +		/* This will 'rewrite' selection list, returned paths are expected to be valid! */
 +		*r_uuids = BKE_asset_engine_entries_load_pre(filelist->ae, selection);
 +	}
 +	else {
 +		*r_uuids = NULL;
 +	}
 +
 +	return selection;
 +}
 +
+ /* WARNING! dir must be FILE_MAX_LIBEXTRA long! */
  bool filelist_islibrary(struct FileList *filelist, char *dir, char **group)
  {
  	return BLO_library_path_explode(filelist->filelist.root, dir, group, NULL);
diff --cc source/blenderplayer/bad_level_call_stubs/stubs.c
index 085c229,7d88861..edb86b5
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@@ -380,10 -377,8 +378,10 @@@ void ED_space_image_set_mask(struct bCo
  void ED_area_tag_redraw_regiontype(struct ScrArea *sa, int regiontype) RET_NONE
  void ED_render_engine_changed(struct Main *bmain) RET_NONE
  
 +struct AssetEngine *ED_filelist_assetengine_get(struct SpaceFile *sfile) RET_NULL
 +
  void ED_file_read_bookmarks(void) RET_NONE
- void ED_file_change_dir(struct bContext *C, const bool checkdir) RET_NONE
+ void ED_file_change_dir(struct bContext *C) RET_NONE
  void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain) RET_NONE
  struct FSMenu *ED_fsmenu_get(void) RET_NULL
  struct FSMenuEntry *ED_fsmenu_get_category(struct FSMenu *fsmenu, FSMenuCategory category) RET_NULL




More information about the Bf-blender-cvs mailing list