[Bf-blender-cvs] [b45f410b315] blender-v3.2-release: Fix T97790: Crash in Outliner "Blender File" mode with old files
Julian Eisel
noreply at git.blender.org
Fri May 27 17:03:48 CEST 2022
Commit: b45f410b3157cb13e7ff4d88dcf5557d2621b9c3
Author: Julian Eisel
Date: Fri May 27 16:48:09 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBb45f410b3157cb13e7ff4d88dcf5557d2621b9c3
Fix T97790: Crash in Outliner "Blender File" mode with old files
IPO data-block types are deprecated since 2.5. Don't show them in the
Outliner at all.
Differential Revision: https://developer.blender.org/D15049
===================================================================
M source/blender/editors/space_outliner/tree/tree_display_libraries.cc
M source/blender/makesdna/DNA_ID.h
M source/blender/makesdna/DNA_ID_enums.h
===================================================================
diff --git a/source/blender/editors/space_outliner/tree/tree_display_libraries.cc b/source/blender/editors/space_outliner/tree/tree_display_libraries.cc
index 476bbdb63ae..79eec632c90 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_libraries.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_libraries.cc
@@ -116,6 +116,11 @@ TreeElement *TreeDisplayLibraries::add_library_contents(Main &mainvar, ListBase
ID *id = static_cast<ID *>(lbarray[a]->first);
const bool is_library = (GS(id->name) == ID_LI) && (lib != nullptr);
+ /* Don't show deprecated types. */
+ if (ID_TYPE_IS_DEPRECATED(GS(id->name))) {
+ continue;
+ }
+
/* check if there's data in current lib */
for (ID *id_iter : List<ID>(lbarray[a])) {
if (id_iter->lib == lib) {
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 17d783d3ebf..1989118bef9 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -597,6 +597,8 @@ typedef struct PreviewImage {
* Keep in sync with #BKE_id_eval_properties_copy. */
#define ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW(id_type) ELEM(id_type, ID_ME)
+#define ID_TYPE_IS_DEPRECATED(id_type) ELEM(id_type, ID_IP)
+
#ifdef GS
# undef GS
#endif
diff --git a/source/blender/makesdna/DNA_ID_enums.h b/source/blender/makesdna/DNA_ID_enums.h
index b0ca13615b8..5999af8bf5c 100644
--- a/source/blender/makesdna/DNA_ID_enums.h
+++ b/source/blender/makesdna/DNA_ID_enums.h
@@ -38,6 +38,8 @@ enum eIconSizes {
*
* Written to #BHead.code (for file IO)
* and the first 2 bytes of #ID.name (for runtime checks, see #GS macro).
+ *
+ * Update #ID_TYPE_IS_DEPRECATED() when deprecating types.
*/
typedef enum ID_Type {
ID_SCE = MAKE_ID2('S', 'C'), /* Scene */
More information about the Bf-blender-cvs
mailing list