From 611e4ffaab435a10a0cfa9a059a655b23e1ca9ce Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 23 Nov 2021 14:23:23 +0100 Subject: [PATCH 1/2] 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. --- release/datafiles/blender_icons.svg | 126 ++++++++++++++---- .../blender_icons16/icon16_current_file.dat | Bin 0 -> 1048 bytes .../blender_icons16/icon16_file_backup.dat | Bin 1048 -> 1048 bytes .../blender_icons16/icon16_file_blend.dat | Bin 1048 -> 1048 bytes .../blender_icons32/icon32_current_file.dat | Bin 0 -> 4120 bytes .../blender_icons32/icon32_file_backup.dat | Bin 4120 -> 4120 bytes .../blender_icons32/icon32_file_blend.dat | Bin 4120 -> 4120 bytes .../intern/asset_library_reference_enum.cc | 2 +- .../blender/editors/datafiles/CMakeLists.txt | 1 + source/blender/editors/include/UI_icons.h | 2 +- source/blender/editors/space_file/file_draw.c | 2 +- 11 files changed, 105 insertions(+), 28 deletions(-) create mode 100644 release/datafiles/blender_icons16/icon16_current_file.dat create mode 100644 release/datafiles/blender_icons32/icon32_current_file.dat diff --git a/release/datafiles/blender_icons.svg b/release/datafiles/blender_icons.svg index c87ad40ac0f..a271a29b263 100644 --- a/release/datafiles/blender_icons.svg +++ b/release/datafiles/blender_icons.svg @@ -8520,26 +8520,6 @@ inkscape:connector-curvature="0" sodipodi:nodetypes="sssssssssssssss" /> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ya6+1ilUdjT)t2`E{UrKLBxzN33I zO`~ox^>yZ)`TzgU)Xf@WvTzBE$)}7N!W90oq9~fdA|ZYEoA{QHNk9+H(C4>jqJar? zAg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BKVnIJ)l+u~ z-hs`q4SzwATZunX>U)9MK#_05m;RVLOsuMY6SY@hbOzHS)&W0Youl`f^?_nt!U6hs#%{uOxC;4MuwG?Leg^2yJ_hesk9bvmy?=Dyb=H=9=poi> zGvLnzX}^NG7B5?JRrOn`y#YT#XUWGN^(QwA9>PnQQ`U6X=hdSI^pHIz1^*7T)XR!tJ9(oE-V75De+E2Z{4f%f%u}4GuLvecbL2oE;accS_x}$SheN}5cQ}xv8uAH>`kWKX|=dDjU z?psrvoWZv*7HdRbeNr>Tw0yZn^;0wWG-9#w=*MP=Y58*F)ep_!(}=|;q92;UdNyKX WGp2Ir=w2LeM6Xoam(uuG^M3#@`OTC7 literal 4120 zcmeH}TT4_?7>2i)S(au8)52;%{1MvWqMPje11j_)r0Wnn5GWB*LH&@Ziy)%RgrJPh zC(DQ#q^=?;QzM}R)APo+WbNgi-HhW^H1M##^&Q@C?KNv3GEo#|;Cp2h9bFJbS0So` z|GzoyKt7+ZgF|oyvM>#kFb0>Q8|vpIo>GKn6&!1 zozMc+Py?-S02KQP%6$YIif)vUNc~C}0qMPl_Jp*Ui=2&?tD1MPE|y>u{Ch#y^#aa9 zt)Iud0&akGhM>-mr`hB#vl`Vtg=#;a`5yQIiaVZTH@Q6QE{o~9V{3CcX(KgSgKDMU z=jSrleoF@af)^R@V8kb>BWT z{|IBahGBf7!qr%hajRMD`z@w(qdpUUjQL{oPX+!4{O&*3IbGw&lWcNyj?|-+{(3&C zW-`>o=l|!ieF$?kC*Pf=-Y`zA7u09ak1==qpY#3BCSLR!$n602n1&N>&eEq1#~Y@ zz^rE|KHUcwKsw>I+z<6inWMKHMoss4QZ2Fb77u%CK9E#XjE~wSpl7ml9z*Q?<23Mp zw4BY(SMG@3QgFTBV>cJlBHP*` CDvPK9 diff --git a/release/datafiles/blender_icons32/icon32_file_blend.dat b/release/datafiles/blender_icons32/icon32_file_blend.dat index 92b54eea1d862c4d686fdfa30b96bff6f45371cf..478c67f875d5eafd2d5e26ff043b438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MlLj2dwsf%sW7Q$40y+6;sm!E&%K6N4*XJ(cA;P^Rqa0{mP-y zcjP5#)W4Qq=XYmO&-uvXzYV-gtos(Z_W9^hwh=+4}u@SdfIr7 yT-~#&=$gvr>5+QB&y=m7i%!=E{5}80{PlgI@cHl2SVHdjq 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. */ From 0479a66313056bc6f467a833bba11592747f78ca Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 23 Nov 2021 14:33:26 +0100 Subject: [PATCH 2/2] 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. --- .../blenloader/intern/versioning_300.c | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) 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;