diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index 0dfec2997ed..e387969fb5b 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -992,9 +992,17 @@ static void do_version_glare_node_options_to_inputs(const Scene *scene, return 1.0f - blender::math::clamp(-mix, 0.0f, 1.0f); }; - /* Function to remap the Size property to its new range. See function description. */ + /* Find the render size to guess the Size value. The node tree might not belong to a scene, so we + * just assume an arbitrary HDTV 1080p render size. */ blender::int2 render_size; - BKE_render_resolution(&scene->r, true, &render_size.x, &render_size.y); + if (scene) { + BKE_render_resolution(&scene->r, true, &render_size.x, &render_size.y); + } + else { + render_size = blender::int2(1920, 1080); + } + + /* Function to remap the Size property to its new range. See function description. */ const int max_render_size = blender::math::reduce_max(render_size); auto size_to_linear = [&](const int size) { if (storage->type == CMP_NODE_GLARE_BLOOM) {