From 611e4ffaab435a10a0cfa9a059a655b23e1ca9ce Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 23 Nov 2021 14:23:23 +0100 Subject: Icons: Replace .blend file icons, add "Current File" icon The Blender icon must not be used to refer to anything that is not Blender itself. Using the Blender icon on its own to refer to .blend files or the currently open file is a no-go, which was brought up by Ton. This does the following changes to the icon file: * Add new "Current File" icon * Change the .blend file icon to contain a file icon with the Blender logo, but not merely the Blender logo. * Change the backup .blend file icon accordingly. The new "Current File" icon is used in the Asset Browser, but could/should be used in the Outliner as well. That needs more design discussion though. --- source/blender/editors/asset/intern/asset_library_reference_enum.cc | 2 +- source/blender/editors/datafiles/CMakeLists.txt | 1 + source/blender/editors/include/UI_icons.h | 2 +- source/blender/editors/space_file/file_draw.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/asset/intern/asset_library_reference_enum.cc b/source/blender/editors/asset/intern/asset_library_reference_enum.cc index 4c343e1e0aa..5a83893f8e1 100644 --- a/source/blender/editors/asset/intern/asset_library_reference_enum.cc +++ b/source/blender/editors/asset/intern/asset_library_reference_enum.cc @@ -114,7 +114,7 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf( // {ASSET_REPO_BUNDLED, "BUNDLED", 0, "Bundled", "Show the default user assets"}, {ASSET_LIBRARY_LOCAL, "LOCAL", - ICON_BLENDER, + ICON_CURRENT_FILE, "Current File", "Show the assets currently available in this Blender session"}, {0, nullptr, 0, nullptr, nullptr}, diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 702fd2e375a..8d32eba1766 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -619,6 +619,7 @@ set(ICON_NAMES outliner_ob_volume outliner_data_volume volume_data + current_file home documents temp diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index c3c296f89ca..4cf606bf98d 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -774,7 +774,7 @@ DEF_ICON_BLANK(276) DEF_ICON_BLANK(277) DEF_ICON_BLANK(772) DEF_ICON_BLANK(773) -DEF_ICON_BLANK(774) +DEF_ICON(CURRENT_FILE) DEF_ICON(HOME) DEF_ICON(DOCUMENTS) DEF_ICON(TEMP) diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index e393cc41a86..c2c9cbf797a 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -479,7 +479,7 @@ static void file_draw_preview(const SpaceFile *sfile, const uchar light[4] = {255, 255, 255, 255}; icon_x = xco + ex - UI_UNIT_X; icon_y = yco + ey - UI_UNIT_Y; - UI_icon_draw_ex(icon_x, icon_y, ICON_FILE_BLEND, 1.0f / U.dpi_fac, 0.6f, 0.0f, light, false); + UI_icon_draw_ex(icon_x, icon_y, ICON_CURRENT_FILE, 1.0f / U.dpi_fac, 0.6f, 0.0f, light, false); } /* Contrasting outline around some preview types. */ -- cgit v1.2.3 From 0479a66313056bc6f467a833bba11592747f78ca Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 23 Nov 2021 14:33:26 +0100 Subject: Fix broken versionning after recent refactor of insertion in liboverrides. rB33c5e7bcd5e5b79 doversion code was incorrectly dealing with 'insert in first position' case from older blendfiles. Specifically, a NULL anchor is valid (it means that the new item is the first of the stored override data, and should be inserted at start of the list). Reported as part of T93321. --- source/blender/blenloader/intern/versioning_300.c | 27 +++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 18baebf57fb..940a10a9e91 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -1309,13 +1309,16 @@ static void version_liboverride_rnacollections_insertion_object_constraints( opop->subitem_local_name, offsetof(bConstraint, name), opop->subitem_local_index); - if (constraint_anchor == NULL || constraint_anchor->next == NULL) { + bConstraint *constraint_src = constraint_anchor != NULL ? constraint_anchor->next : + constraints->first; + + if (constraint_src == NULL) { /* Invalid case, just remove that override property operation. */ - CLOG_ERROR(&LOG, "Could not find anchor or source constraints in stored override data"); + CLOG_ERROR(&LOG, "Could not find source constraint in stored override data"); BKE_lib_override_library_property_operation_delete(op, opop); continue; } - bConstraint *constraint_src = constraint_anchor->next; + opop->subitem_reference_name = opop->subitem_local_name; opop->subitem_local_name = BLI_strdup(constraint_src->name); opop->subitem_reference_index = opop->subitem_local_index; @@ -1338,13 +1341,15 @@ static void version_liboverride_rnacollections_insertion_object(Object *object) opop->subitem_local_name, offsetof(ModifierData, name), opop->subitem_local_index); - if (mod_anchor == NULL || mod_anchor->next == NULL) { + ModifierData *mod_src = mod_anchor != NULL ? mod_anchor->next : object->modifiers.first; + + if (mod_src == NULL) { /* Invalid case, just remove that override property operation. */ - CLOG_ERROR(&LOG, "Could not find anchor or source modifiers in stored override data"); + CLOG_ERROR(&LOG, "Could not find source modifier in stored override data"); BKE_lib_override_library_property_operation_delete(op, opop); continue; } - ModifierData *mod_src = mod_anchor->next; + opop->subitem_reference_name = opop->subitem_local_name; opop->subitem_local_name = BLI_strdup(mod_src->name); opop->subitem_reference_index = opop->subitem_local_index; @@ -1363,13 +1368,17 @@ static void version_liboverride_rnacollections_insertion_object(Object *object) opop->subitem_local_name, offsetof(GpencilModifierData, name), opop->subitem_local_index); - if (gp_mod_anchor == NULL || gp_mod_anchor->next == NULL) { + GpencilModifierData *gp_mod_src = gp_mod_anchor != NULL ? + gp_mod_anchor->next : + object->greasepencil_modifiers.first; + + if (gp_mod_src == NULL) { /* Invalid case, just remove that override property operation. */ - CLOG_ERROR(&LOG, "Could not find anchor GP modifier in stored override data"); + CLOG_ERROR(&LOG, "Could not find source GP modifier in stored override data"); BKE_lib_override_library_property_operation_delete(op, opop); continue; } - GpencilModifierData *gp_mod_src = gp_mod_anchor->next; + opop->subitem_reference_name = opop->subitem_local_name; opop->subitem_local_name = BLI_strdup(gp_mod_src->name); opop->subitem_reference_index = opop->subitem_local_index; -- cgit v1.2.3