From d3fac833db1aee6d26ddd278aa6e8f47a61d2218 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Sat, 27 Apr 2024 17:20:10 -0400 Subject: [PATCH 1/2] Compositor: Remove left over code from tile based compositor The compositor used to have a feature that would calculate tiles for the viewer based a custom order. Since the removal of the tile based compositor, this code is unused. --- .../compositor/nodes/COM_ViewerNode.cc | 2 -- .../operations/COM_ViewerOperation.h | 18 ------------ .../blender/makesrna/intern/rna_nodetree.cc | 29 ------------------- .../composite/nodes/node_composite_viewer.cc | 16 ---------- 4 files changed, 65 deletions(-) diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cc b/source/blender/compositor/nodes/COM_ViewerNode.cc index 0be56d248d4..830a19fe9e0 100644 --- a/source/blender/compositor/nodes/COM_ViewerNode.cc +++ b/source/blender/compositor/nodes/COM_ViewerNode.cc @@ -29,8 +29,6 @@ void ViewerNode::convert_to_operations(NodeConverter &converter, viewer_operation->set_bnodetree(context.get_bnodetree()); viewer_operation->set_image(image); viewer_operation->set_image_user(image_user); - viewer_operation->setCenterX(editor_node->custom3); - viewer_operation->setCenterY(editor_node->custom4); /* alpha socket gives either 1 or a custom alpha value if "use alpha" is enabled */ viewer_operation->set_use_alpha_input(ignore_alpha || alpha_socket->is_linked()); viewer_operation->set_render_data(context.get_render_data()); diff --git a/source/blender/compositor/operations/COM_ViewerOperation.h b/source/blender/compositor/operations/COM_ViewerOperation.h index 0a6e90c7727..6b82b5aa6b8 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.h +++ b/source/blender/compositor/operations/COM_ViewerOperation.h @@ -19,8 +19,6 @@ class ViewerOperation : public MultiThreadedOperation { Image *image_; ImageUser *image_user_; bool active_; - float center_x_; - float center_y_; ImBuf *ibuf_; bool use_alpha_input_; const RenderData *rd_; @@ -57,22 +55,6 @@ class ViewerOperation : public MultiThreadedOperation { { active_ = active; } - void setCenterX(float centerX) - { - center_x_ = centerX; - } - void setCenterY(float centerY) - { - center_y_ = centerY; - } - float getCenterX() const - { - return center_x_; - } - float getCenterY() const - { - return center_y_; - } eCompositorPriority get_render_priority() const override; void set_use_alpha_input(bool value) { diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 77b7b87b7ff..285418e7d87 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -8216,35 +8216,6 @@ static void def_cmp_colorcorrection(StructRNA *srna) static void def_cmp_viewer(StructRNA *srna) { - PropertyRNA *prop; - static const EnumPropertyItem tileorder_items[] = { - {0, "CENTEROUT", 0, "Center", "Expand from center"}, - {1, "RANDOM", 0, "Random", "Random tiles"}, - {2, "BOTTOMUP", 0, "Bottom Up", "Expand from bottom"}, - {3, "RULE_OF_THIRDS", 0, "Rule of Thirds", "Expand from 9 places"}, - {0, nullptr, 0, nullptr, nullptr}, - }; - - prop = RNA_def_property(srna, "tile_order", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, nullptr, "custom1"); - RNA_def_property_enum_items(prop, tileorder_items); - RNA_def_property_ui_text(prop, "Tile Order", "Tile order"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "center_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, nullptr, "custom3"); - RNA_def_property_float_default(prop, 0.5f); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "center_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, nullptr, "custom4"); - RNA_def_property_float_default(prop, 0.5f); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, nullptr, "custom2", CMP_NODE_OUTPUT_IGNORE_ALPHA); RNA_def_property_ui_text( diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.cc b/source/blender/nodes/composite/nodes/node_composite_viewer.cc index 35a0e4f9c6c..67fc1846f0a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_viewer.cc +++ b/source/blender/nodes/composite/nodes/node_composite_viewer.cc @@ -39,8 +39,6 @@ static void node_composit_init_viewer(bNodeTree * /*ntree*/, bNode *node) ImageUser *iuser = MEM_cnew(__func__); node->storage = iuser; iuser->sfra = 1; - node->custom3 = 0.5f; - node->custom4 = 0.5f; node->id = (ID *)BKE_image_ensure_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node"); } @@ -50,19 +48,6 @@ static void node_composit_buts_viewer(uiLayout *layout, bContext * /*C*/, Pointe uiItemR(layout, ptr, "use_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); } -static void node_composit_buts_viewer_ex(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) -{ - uiLayout *col; - - uiItemR(layout, ptr, "use_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); - uiItemR(layout, ptr, "tile_order", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); - if (RNA_enum_get(ptr, "tile_order") == 0) { - col = uiLayoutColumn(layout, true); - uiItemR(col, ptr, "center_x", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); - uiItemR(col, ptr, "center_y", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); - } -} - using namespace blender::realtime_compositor; class ViewerOperation : public NodeOperation { @@ -276,7 +261,6 @@ void register_node_type_cmp_viewer() cmp_node_type_base(&ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT); ntype.declare = file_ns::cmp_node_viewer_declare; ntype.draw_buttons = file_ns::node_composit_buts_viewer; - ntype.draw_buttons_ex = file_ns::node_composit_buts_viewer_ex; ntype.flag |= NODE_PREVIEW; ntype.initfunc = file_ns::node_composit_init_viewer; node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); -- 2.30.2 From 58220a5bc280f20477724460ac30240fe11b1db6 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Mon, 29 Apr 2024 23:21:54 -0400 Subject: [PATCH 2/2] Fix: missing prop declaration --- source/blender/makesrna/intern/rna_nodetree.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 285418e7d87..f7d151b9090 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -8216,6 +8216,8 @@ static void def_cmp_colorcorrection(StructRNA *srna) static void def_cmp_viewer(StructRNA *srna) { + PropertyRNA *prop; + prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, nullptr, "custom2", CMP_NODE_OUTPUT_IGNORE_ALPHA); RNA_def_property_ui_text( -- 2.30.2