From c07ae0e821e441b3c3a9b6f192487744c54f4015 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 28 Dec 2018 10:26:45 +0100 Subject: Fix T59922: crash reading files with older renderlayers - own error in rB2c196de56bbb163048b08f321983234a5e72e804 - now introduce RE_PASSNAME_DEPRECATED placeholder for old passes - also dont allocate NodeImageLayers for these Reviewers: brecht Maniphest Tasks: T59922 Differential Revision: https://developer.blender.org/D4132 --- source/blender/blenloader/intern/versioning_270.c | 4 ++++ source/blender/makesdna/DNA_scene_types.h | 2 ++ source/blender/nodes/composite/nodes/node_composite_image.c | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 7e201aaf1d1..201e3bf1c51 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -316,6 +316,10 @@ static void do_versions_compositor_render_passes_storage(bNode *node) int pass_index = 0; const char *sockname; for (bNodeSocket *sock = node->outputs.first; sock && pass_index < 31; sock = sock->next, pass_index++) { + if ((pass_index >= 6 && pass_index <= 8) || (pass_index >= 11 && pass_index <= 13)) { + /* deprecated passes */ + continue; + } if (sock->storage == NULL) { NodeImageLayer *sockdata = MEM_callocN(sizeof(NodeImageLayer), "node image layer"); sock->storage = sockdata; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index ad33c57b3c8..2d0838a04c5 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -266,6 +266,8 @@ typedef enum eScenePassType { SCE_PASS_ROUGHNESS = (1u << 31u), } eScenePassType; +#define RE_PASSNAME_DEPRECATED "Deprecated" + #define RE_PASSNAME_COMBINED "Combined" #define RE_PASSNAME_Z "Depth" #define RE_PASSNAME_VECTOR "Vector" diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index 8d400ada0c7..6cb7704d1a7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -354,7 +354,9 @@ const char *node_cmp_rlayers_sock_to_pass(int sock_index) { const char *sock_to_passname[] = { RE_PASSNAME_COMBINED, RE_PASSNAME_COMBINED, - RE_PASSNAME_Z, RE_PASSNAME_NORMAL, RE_PASSNAME_UV, RE_PASSNAME_VECTOR, RE_PASSNAME_SHADOW, RE_PASSNAME_AO, + RE_PASSNAME_Z, RE_PASSNAME_NORMAL, RE_PASSNAME_UV, RE_PASSNAME_VECTOR, RE_PASSNAME_DEPRECATED, + RE_PASSNAME_DEPRECATED, RE_PASSNAME_DEPRECATED, RE_PASSNAME_SHADOW, RE_PASSNAME_AO, + RE_PASSNAME_DEPRECATED, RE_PASSNAME_DEPRECATED, RE_PASSNAME_DEPRECATED, RE_PASSNAME_INDEXOB, RE_PASSNAME_INDEXMA, RE_PASSNAME_MIST, RE_PASSNAME_EMIT, RE_PASSNAME_ENVIRONMENT, RE_PASSNAME_DIFFUSE_DIRECT, RE_PASSNAME_DIFFUSE_INDIRECT, RE_PASSNAME_DIFFUSE_COLOR, RE_PASSNAME_GLOSSY_DIRECT, RE_PASSNAME_GLOSSY_INDIRECT, RE_PASSNAME_GLOSSY_COLOR, -- cgit v1.2.3