From cbabe2d3ef8ee3168d0d7f1165a40eafc4e58aad Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Thu, 13 Jun 2024 07:29:37 +0200 Subject: [PATCH] Compositor: Remove Auto Render option This patch removes the Auto Render option from the compositor. This is done for the following reason: - The option didn't really work except in the case of transforming an object. So it wasn't really reliable. - It made little sense to use since the introduction of the Viewport Compositor. - It had a number of UX issues, including the fact that it can't be used with animation playback, and the fact that rendering can get in the way of the UI depending on the preferences for temporary editors. Pull Request: https://projects.blender.org/blender/blender/pulls/123132 --- scripts/modules/rna_manual_reference.py | 1 - scripts/startup/bl_ui/space_node.py | 3 -- .../blender/blenkernel/BKE_blender_version.h | 2 +- .../blenloader/intern/versioning_400.cc | 13 +++++++++ .../blender/editors/space_node/node_intern.hh | 7 ----- .../blender/editors/space_node/space_node.cc | 29 +------------------ source/blender/editors/transform/transform.cc | 3 -- source/blender/makesdna/DNA_space_types.h | 2 +- source/blender/makesrna/intern/rna_space.cc | 6 ---- source/blender/windowmanager/WM_types.hh | 1 - 10 files changed, 16 insertions(+), 51 deletions(-) diff --git a/scripts/modules/rna_manual_reference.py b/scripts/modules/rna_manual_reference.py index e3902517d34..ab4bebe772a 100644 --- a/scripts/modules/rna_manual_reference.py +++ b/scripts/modules/rna_manual_reference.py @@ -1059,7 +1059,6 @@ url_manual_mapping = ( ("bpy.types.spacefilebrowser.recent_folders*", "editors/file_browser.html#bpy-types-spacefilebrowser-recent-folders"), ("bpy.types.spacefilebrowser.system_folders*", "editors/file_browser.html#bpy-types-spacefilebrowser-system-folders"), ("bpy.types.spacenodeeditor.show_annotation*", "interface/controls/nodes/introduction.html#bpy-types-spacenodeeditor-show-annotation"), - ("bpy.types.spacenodeeditor.use_auto_render*", "compositing/sidebar.html#bpy-types-spacenodeeditor-use-auto-render"), ("bpy.types.spaceoutliner.use_filter_object*", "editors/outliner/interface.html#bpy-types-spaceoutliner-use-filter-object"), ("bpy.types.spacesequenceeditor.use_proxies*", "editors/video_sequencer/preview/sidebar.html#bpy-types-spacesequenceeditor-use-proxies"), ("bpy.types.spaceuveditor.edge_display_type*", "editors/uv/overlays.html#bpy-types-spaceuveditor-edge-display-type"), diff --git a/scripts/startup/bl_ui/space_node.py b/scripts/startup/bl_ui/space_node.py index fd6a517881b..cd51f5d7b57 100644 --- a/scripts/startup/bl_ui/space_node.py +++ b/scripts/startup/bl_ui/space_node.py @@ -849,9 +849,6 @@ class NODE_PT_quality(bpy.types.Panel): col = layout.column() col.prop(tree, "use_viewer_border") - col = layout.column() - col.prop(snode, "use_auto_render") - class NODE_PT_overlay(Panel): bl_space_type = 'NODE_EDITOR' diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 70d049d6a7b..00e659f7901 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -29,7 +29,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 1 +#define BLENDER_FILE_SUBVERSION 2 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and cancel loading the file, showing a warning to diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index ae204a12a90..f768855dcb1 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -4163,6 +4163,19 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) FOREACH_NODETREE_END; } + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 403, 2)) { + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, space_link, &area->spacedata) { + if (space_link->spacetype == SPACE_NODE) { + SpaceNode *space_node = reinterpret_cast(space_link); + space_node->flag &= ~SNODE_FLAG_UNUSED_5; + } + } + } + } + } + /** * Always bump subversion in BKE_blender_version.h when adding versioning * code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check. diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh index ea26196bc8f..3066cc9db3d 100644 --- a/source/blender/editors/space_node/node_intern.hh +++ b/source/blender/editors/space_node/node_intern.hh @@ -88,13 +88,6 @@ struct SpaceNode_Runtime { /** Mouse position for drawing socket-less links and adding nodes. */ float2 cursor; - /** - * Indicates that the compositing tree in the space needs to be re-evaluated using the - * auto-compositing pipeline. - * Takes priority over the regular compositing. - */ - bool recalc_auto_compositing; - /** * Indicates that the compositing int the space tree needs to be re-evaluated using * regular compositing pipeline. diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index 86f404b71ac..270560dc38c 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -491,24 +491,6 @@ static bool any_node_uses_id(const bNodeTree *ntree, const ID *id) return false; } -/** - * Tag the space to recalculate the compositing tree using auto-compositing pipeline. - * - * Will check the space to be using a compositing tree, and check whether auto-compositing - * is enabled. If the checks do not pass then the function has no affect. - */ -static void node_area_tag_recalc_auto_compositing(SpaceNode *snode, ScrArea *area) -{ - if (!ED_node_is_compositor(snode)) { - return; - } - - if (snode->flag & SNODE_AUTO_RENDER) { - snode->runtime->recalc_auto_compositing = true; - ED_area_tag_refresh(area); - } -} - /** * Tag the space to recalculate the current tree. * @@ -562,9 +544,6 @@ static void node_area_listener(const wmSpaceTypeListenerParams *params) WM_gizmomap_tag_refresh(region->gizmo_map); break; } - case ND_TRANSFORM_DONE: - node_area_tag_recalc_auto_compositing(snode, area); - break; } break; @@ -715,13 +694,7 @@ static void node_area_refresh(const bContext *C, ScrArea *area) if (snode->nodetree->type == NTREE_COMPOSIT) { Scene *scene = (Scene *)snode->id; if (scene->use_nodes) { - /* recalc is set on 3d view changes for auto compo */ - if (snode->runtime->recalc_auto_compositing) { - snode->runtime->recalc_auto_compositing = false; - snode->runtime->recalc_regular_compositing = false; - node_render_changed_exec((bContext *)C, nullptr); - } - else if (snode->runtime->recalc_regular_compositing) { + if (snode->runtime->recalc_regular_compositing) { snode->runtime->recalc_regular_compositing = false; /* Only start compositing if its result will be visible either in the backdrop or in a * viewer image. */ diff --git a/source/blender/editors/transform/transform.cc b/source/blender/editors/transform/transform.cc index dec7ef63bd9..9d7b0f3426f 100644 --- a/source/blender/editors/transform/transform.cc +++ b/source/blender/editors/transform/transform.cc @@ -562,9 +562,6 @@ static void viewRedrawPost(bContext *C, TransInfo *t) { WM_event_add_notifier(C, NC_GEOM | ND_DATA, nullptr); } - - /* XXX(ton): temp, first hack to get auto-render in compositor work. */ - WM_event_add_notifier(C, NC_SCENE | ND_TRANSFORM_DONE, CTX_data_scene(C)); } } diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 3f87e50016f..f7b884145cc 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -1646,7 +1646,7 @@ typedef enum eSpaceNode_Flag { SNODE_SHOW_R = (1 << 7), SNODE_SHOW_G = (1 << 8), SNODE_SHOW_B = (1 << 9), - SNODE_AUTO_RENDER = (1 << 5), + SNODE_FLAG_UNUSED_5 = (1 << 5), /* cleared */ SNODE_FLAG_UNUSED_6 = (1 << 6), /* cleared */ SNODE_FLAG_UNUSED_10 = (1 << 10), /* cleared */ SNODE_FLAG_UNUSED_11 = (1 << 11), /* cleared */ diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index 0c7cd914b8e..c4630ef59af 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -7774,12 +7774,6 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, nullptr); - prop = RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_AUTO_RENDER); - RNA_def_property_ui_text( - prop, "Auto Render", "Re-render and composite changed layers on 3D edits"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, nullptr); - prop = RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, nullptr, "zoom"); RNA_def_property_float_default(prop, 1.0f); diff --git a/source/blender/windowmanager/WM_types.hh b/source/blender/windowmanager/WM_types.hh index aa1031f9142..74a22a97343 100644 --- a/source/blender/windowmanager/WM_types.hh +++ b/source/blender/windowmanager/WM_types.hh @@ -416,7 +416,6 @@ struct wmNotifier { #define ND_TOOLSETTINGS (15 << 16) #define ND_LAYER (16 << 16) #define ND_FRAME_RANGE (17 << 16) -#define ND_TRANSFORM_DONE (18 << 16) #define ND_WORLD (92 << 16) #define ND_LAYER_CONTENT (101 << 16)