[Bf-blender-cvs] [faf47d75ae9] asset-engine: Merge branch 'master' into asset-engine
Bastien Montagne
noreply at git.blender.org
Sun Jul 14 20:58:36 CEST 2019
Commit: faf47d75ae95a38efe1bead8a03d5f81a1e32321
Author: Bastien Montagne
Date: Sun Jul 14 20:58:20 2019 +0200
Branches: asset-engine
https://developer.blender.org/rBfaf47d75ae95a38efe1bead8a03d5f81a1e32321
Merge branch 'master' into asset-engine
Conflicts:
source/blender/editors/space_file/file_ops.c
source/blender/makesrna/intern/rna_space.c
source/blender/windowmanager/WM_api.h
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/library.c
index 47003530c48,7e8128945e7..a8dd19dcead
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -1505,10 -1502,8 +1506,10 @@@ void *BKE_libblock_copy_for_localize(co
void BKE_library_free(Library *lib)
{
if (lib->packedfile) {
- freePackedFile(lib->packedfile);
+ BKE_packedfile_free(lib->packedfile);
}
+
+ BKE_library_asset_repository_free(lib);
}
/* ***************** ID ************************ */
@@@ -1732,13 -1725,14 +1733,14 @@@ bool BKE_id_new_name_validate(ListBase
result = check_for_dupid(lb, id, name);
strcpy(id->name + 2, name);
- /* This was in 2.43 and previous releases
- * however all data in blender should be sorted, not just duplicate names
- * sorting should not hurt, but noting just incase it alters the way other
- * functions work, so sort every time */
+/* This was in 2.43 and previous releases
+ * however all data in blender should be sorted, not just duplicate names
+ * sorting should not hurt, but noting just incase it alters the way other
+ * functions work, so sort every time */
#if 0
- if (result)
+ if (result) {
id_sort_by_name(lb, id);
+ }
#endif
id_sort_by_name(lb, id);
diff --cc source/blender/blenkernel/intern/library_remap.c
index 28cbe364a6e,8fe2552c03f..66641715c0c
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@@ -756,14 -756,10 +756,14 @@@ void BKE_libblock_free_data(ID *id, con
MEM_freeN(id->properties);
}
- if (id->override_static) {
- BKE_override_static_free(&id->override_static);
+ if (id->override_library) {
+ BKE_override_library_free(&id->override_library);
}
+ if (id->uuid) {
+ MEM_freeN(id->uuid);
+ }
+
/* XXX TODO remove animdata handling from each type's freeing func,
* and do it here, like for copy! */
}
diff --cc source/blender/blenloader/intern/readfile.c
index 41474f476ec,44039ad59ee..96b0a0ac547
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9159,22 -9141,9 +9164,22 @@@ static BHead *read_libblock(FileData *f
/* this case cannot be direct_linked: it's just the ID part */
if (bhead->code == ID_LINK_PLACEHOLDER) {
- /* That way, we know which datablock needs do_versions (required currently for linking). */
+ /* That way, we know which data-lock needs do_versions (required currently for linking). */
id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW;
+ if (id->uuid) {
+ /* read all data into fd->datamap */
+ bhead = read_data_into_oldnewmap(fd, bhead, __func__);
+
+ id->uuid = newdataadr(fd, id->uuid);
+ id->uuid->ibuff = NULL; /* Just in case... */
+ id->uuid->width = id->uuid->height = 0;
+
+ oldnewmap_free_unused(fd->datamap);
+ oldnewmap_clear(fd->datamap);
+ return bhead;
+ }
+
return blo_bhead_next(fd, bhead);
}
@@@ -11782,13 -11696,8 +11789,13 @@@ static void read_library_linked_ids(Fil
* (known case: some directly linked shapekey from a missing lib...). */
/* BLI_assert(*realid != NULL); */
+ if (*realid && id->uuid) {
+ /* we can give ownership of that pointer to new ID. */
+ (*realid)->uuid = id->uuid;
+ }
+
/* Now that we have a real ID, replace all pointers to placeholders in
- * fd->libmap with pointers to the real datablocks. We do this for all
+ * fd->libmap with pointers to the real data-blocks. We do this for all
* libraries since multiple might be referencing this ID. */
change_link_placeholder_to_real_ID_pointer(mainlist, basefd, id, *realid);
diff --cc source/blender/blenloader/intern/versioning_280.c
index 64ea8f69c71,5d899ef73a6..671bc725433
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -3488,37 -3487,27 +3488,57 @@@ void blo_do_versions_280(FileData *fd,
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 280, 74)) {
+ for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
+ if (scene->ed != NULL) {
+ do_versions_seq_alloc_transform_and_crop(&scene->ed->seqbase);
+ }
+ }
+ }
+
{
/* Versioning code until next subversion bump goes here. */
+
+ for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
+ if (scene->master_collection != NULL) {
+ scene->master_collection->flag &= ~(COLLECTION_RESTRICT_VIEWPORT |
+ COLLECTION_RESTRICT_SELECT |
+ COLLECTION_RESTRICT_RENDER);
+ }
+ }
+
+ LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
+ arm->flag &= ~(ARM_FLAG_UNUSED_6);
+ }
}
+
+ if (1 ||
+ !DNA_struct_find(fd->filesdna,
+ "AssetUUID")) { /* struct_find will have to wait, not working for now... */
+ /* Move non-op filebrowsers to 'library browsing' type/mode. */
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_FILE) {
+ SpaceFile *sfile = (SpaceFile *)sl;
+ if (sfile->params != NULL) {
+ sfile->params->type = FILE_LOADLIB;
+ sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB;
+ /* For now, always init filterid to 'all true' */
+ sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR |
+ FILTER_ID_CA | FILTER_ID_CU | FILTER_ID_GD |
+ FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA |
+ FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
+ FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME |
+ FILTER_ID_MSK | FILTER_ID_NT | FILTER_ID_OB |
+ FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC |
+ FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
+ FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF |
+ FILTER_ID_WO | FILTER_ID_CF;
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --cc source/blender/blenloader/intern/writefile.c
index 86da42af48b,5954ba9cf8e..468653a85fc
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -705,25 -703,19 +703,26 @@@ static void write_iddata(void *wd, cons
{
/* ID_WM's id->properties are considered runtime only, and never written in .blend file. */
if (id->properties && !ELEM(GS(id->name), ID_WM)) {
- IDP_WriteProperty(id->properties, wd);
+ /* We want to write IDProps from 'virtual' libraries too, but not from 'real' linked datablocks... */
+ if (!id->uuid || (id->lib && (id->lib->flag & LIBRARY_FLAG_VIRTUAL))) {
+ IDP_WriteProperty(id->properties, wd);
+ }
+ }
+ if (id->uuid) {
+ BLI_assert(id->lib && id->lib->asset_repository);
+ writestruct(wd, DATA, AssetUUID, 1, id->uuid);
}
- if (id->override_static) {
- writestruct(wd, DATA, IDOverrideStatic, 1, id->override_static);
+ if (id->override_library) {
+ writestruct(wd, DATA, IDOverrideLibrary, 1, id->override_library);
- writelist(wd, DATA, IDOverrideStaticProperty, &id->override_static->properties);
- for (IDOverrideStaticProperty *op = id->override_static->properties.first; op; op = op->next) {
+ writelist(wd, DATA, IDOverrideLibraryProperty, &id->override_library->properties);
+ for (IDOverrideLibraryProperty *op = id->override_library->properties.first; op;
+ op = op->next) {
writedata(wd, DATA, strlen(op->rna_path) + 1, op->rna_path);
- writelist(wd, DATA, IDOverrideStaticPropertyOperation, &op->operations);
- for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop;
+ writelist(wd, DATA, IDOverrideLibraryPropertyOperation, &op->operations);
+ for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; opop;
opop = opop->next) {
if (opop->subitem_reference_name) {
writedata(
diff --cc source/blender/editors/space_file/file_ops.c
index db2c1f1480e,4e50413513a..1cfc4b666e9
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@@ -809,8 -807,12 +809,12 @@@ static int file_select_all_exec(bContex
ScrArea *sa = CTX_wm_area(C);
SpaceFile *sfile = CTX_wm_space_file(C);
FileSelection sel;
- const int numfiles = filelist_files_ensure(sfile->files);
+ const int numfiles = filelist_files_ensure(sfile->files, ED_fileselect_get_params(sfile));
- const bool has_selection = file_is_any_selected(sfile->files, numfiles);
+ int action = RNA_enum_get(op->ptr, "action");
+
+ if (action == SEL_TOGGLE) {
- action = file_is_any_selected(sfile->files) ? SEL_DESELECT : SEL_SELECT;
++ action = file_is_any_selected(sfile->files, numfiles) ? SEL_DESELECT : SEL_SELECT;
+ }
sel.first = 0;
sel.last = numfiles - 1;
@@@ -1257,73 -1271,53 +1273,74 @@@ void FILE_OT_cancel(struct wmOperatorTy
ot->poll = file_operator_poll;
}
-void file_sfile_to_operator_ex(bContext *C, wmOperator *op, SpaceFile *sfile, char *filepath)
+void file_sfile_to_operator_ex(bContext *C,
+ wmOperator *op,
+ SpaceFile *sfile,
+ char filepath[FILE_MAX_LIBEXTRA],
+ const bool is_fake)
{
Main *bmain = CTX_data_main(C);
- PropertyRNA *prop;
-
- /* XXX, not real length */
- BLI_join_dirfile(filepath, FILE_MAX, sfile->params->dir, sfile->pa
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list