[Bf-blender-cvs] [4e98d974b59] master: Nodes: Begin splitting composite node buttons into individual files

Aaron Carlisle noreply at git.blender.org
Thu Dec 16 03:30:40 CET 2021


Commit: 4e98d974b596cdb7b04872b9c8fb43fc284696e9
Author: Aaron Carlisle
Date:   Wed Dec 15 21:30:04 2021 -0500
Branches: master
https://developer.blender.org/rB4e98d974b596cdb7b04872b9c8fb43fc284696e9

Nodes: Begin splitting composite node buttons into individual files

Currently, most node buttons are defined in `drawnode.cc` however,
this is inconvenient because it requires editing many files when adding new nodes.
The goal is to minimize the number of files needed to add or update a node.

This commit moves most of the node layout functions for composite nodes into their respected
`source/blender/nodes/composite/nodes` file.

In the future, these functions will be simplified to `node_layout` once files have their own namespace.
See {D13466} for more information.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D13523

===================================================================

M	source/blender/editors/space_node/drawnode.cc
M	source/blender/nodes/composite/nodes/node_composite_alphaOver.cc
M	source/blender/nodes/composite/nodes/node_composite_antialiasing.cc
M	source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc
M	source/blender/nodes/composite/nodes/node_composite_blur.cc
M	source/blender/nodes/composite/nodes/node_composite_bokehblur.cc
M	source/blender/nodes/composite/nodes/node_composite_bokehimage.cc
M	source/blender/nodes/composite/nodes/node_composite_boxmask.cc
M	source/blender/nodes/composite/nodes/node_composite_brightness.cc
M	source/blender/nodes/composite/nodes/node_composite_channelMatte.cc
M	source/blender/nodes/composite/nodes/node_composite_chromaMatte.cc
M	source/blender/nodes/composite/nodes/node_composite_colorMatte.cc
M	source/blender/nodes/composite/nodes/node_composite_colorSpill.cc
M	source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
M	source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
M	source/blender/nodes/composite/nodes/node_composite_composite.cc
M	source/blender/nodes/composite/nodes/node_composite_crop.cc
M	source/blender/nodes/composite/nodes/node_composite_curves.cc
M	source/blender/nodes/composite/nodes/node_composite_defocus.cc
M	source/blender/nodes/composite/nodes/node_composite_denoise.cc
M	source/blender/nodes/composite/nodes/node_composite_despeckle.cc
M	source/blender/nodes/composite/nodes/node_composite_diffMatte.cc
M	source/blender/nodes/composite/nodes/node_composite_dilate.cc
M	source/blender/nodes/composite/nodes/node_composite_directionalblur.cc
M	source/blender/nodes/composite/nodes/node_composite_distanceMatte.cc
M	source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.cc
M	source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc
M	source/blender/nodes/composite/nodes/node_composite_filter.cc
M	source/blender/nodes/composite/nodes/node_composite_flip.cc
M	source/blender/nodes/composite/nodes/node_composite_glare.cc
M	source/blender/nodes/composite/nodes/node_composite_idMask.cc
M	source/blender/nodes/composite/nodes/node_composite_image.cc
M	source/blender/nodes/composite/nodes/node_composite_inpaint.cc
M	source/blender/nodes/composite/nodes/node_composite_invert.cc
M	source/blender/nodes/composite/nodes/node_composite_keying.cc
M	source/blender/nodes/composite/nodes/node_composite_keyingscreen.cc
M	source/blender/nodes/composite/nodes/node_composite_lensdist.cc
M	source/blender/nodes/composite/nodes/node_composite_levels.cc
M	source/blender/nodes/composite/nodes/node_composite_lummaMatte.cc
M	source/blender/nodes/composite/nodes/node_composite_mapRange.cc
M	source/blender/nodes/composite/nodes/node_composite_mapUV.cc
M	source/blender/nodes/composite/nodes/node_composite_mapValue.cc
M	source/blender/nodes/composite/nodes/node_composite_mask.cc
M	source/blender/nodes/composite/nodes/node_composite_movieclip.cc
M	source/blender/nodes/composite/nodes/node_composite_moviedistortion.cc
M	source/blender/nodes/composite/nodes/node_composite_outputFile.cc
M	source/blender/nodes/composite/nodes/node_composite_planetrackdeform.cc
M	source/blender/nodes/composite/nodes/node_composite_premulkey.cc
M	source/blender/nodes/composite/nodes/node_composite_rotate.cc
M	source/blender/nodes/composite/nodes/node_composite_scale.cc
M	source/blender/nodes/composite/nodes/node_composite_setalpha.cc
M	source/blender/nodes/composite/nodes/node_composite_splitViewer.cc
M	source/blender/nodes/composite/nodes/node_composite_stabilize2d.cc
M	source/blender/nodes/composite/nodes/node_composite_sunbeams.cc
M	source/blender/nodes/composite/nodes/node_composite_switch.cc
M	source/blender/nodes/composite/nodes/node_composite_switchview.cc
M	source/blender/nodes/composite/nodes/node_composite_tonemap.cc
M	source/blender/nodes/composite/nodes/node_composite_trackpos.cc
M	source/blender/nodes/composite/nodes/node_composite_transform.cc
M	source/blender/nodes/composite/nodes/node_composite_translate.cc
M	source/blender/nodes/composite/nodes/node_composite_vecBlur.cc
M	source/blender/nodes/composite/nodes/node_composite_viewer.cc
M	source/blender/nodes/composite/nodes/node_composite_zcombine.cc

===================================================================

diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 87f7bfdafb0..bbfd886ce56 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -1095,1036 +1095,25 @@ static void node_composit_buts_image_ex(uiLayout *layout, bContext *C, PointerRN
   uiTemplateImage(layout, C, ptr, "image", &iuserptr, false, true);
 }
 
-static void node_composit_buts_viewlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
-{
-  bNode *node = (bNode *)ptr->data;
-  uiLayout *col, *row;
-
-  uiTemplateID(layout,
-               C,
-               ptr,
-               "scene",
-               nullptr,
-               nullptr,
-               nullptr,
-               UI_TEMPLATE_ID_FILTER_ALL,
-               false,
-               nullptr);
-
-  if (!node->id) {
-    return;
-  }
-
-  col = uiLayoutColumn(layout, false);
-  row = uiLayoutRow(col, true);
-  uiItemR(row, ptr, "layer", DEFAULT_FLAGS, "", ICON_NONE);
-
-  PropertyRNA *prop = RNA_struct_find_property(ptr, "layer");
-  const char *layer_name;
-  if (!(RNA_property_enum_identifier(
-          C, ptr, prop, RNA_property_enum_get(ptr, prop), &layer_name))) {
-    return;
-  }
-
-  PointerRNA scn_ptr;
-  char scene_name[MAX_ID_NAME - 2];
-  scn_ptr = RNA_pointer_get(ptr, "scene");
-  RNA_string_get(&scn_ptr, "name", scene_name);
-
-  PointerRNA op_ptr;
-  uiItemFullO(
-      row, "RENDER_OT_render", "", ICON_RENDER_STILL, nullptr, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
-  RNA_string_set(&op_ptr, "layer", layer_name);
-  RNA_string_set(&op_ptr, "scene", scene_name);
-}
-
-static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col, *row;
-
-  col = uiLayoutColumn(layout, false);
-  const int filter = RNA_enum_get(ptr, "filter_type");
-  const int reference = RNA_boolean_get(ptr, "use_variable_size");
-
-  uiItemR(col, ptr, "filter_type", DEFAULT_FLAGS, "", ICON_NONE);
-  if (filter != R_FILTER_FAST_GAUSS) {
-    uiItemR(col, ptr, "use_variable_size", DEFAULT_FLAGS, nullptr, ICON_NONE);
-    if (!reference) {
-      uiItemR(col, ptr, "use_bokeh", DEFAULT_FLAGS, nullptr, ICON_NONE);
-    }
-    uiItemR(col, ptr, "use_gamma_correction", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  }
-
-  uiItemR(col, ptr, "use_relative", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  if (RNA_boolean_get(ptr, "use_relative")) {
-    uiItemL(col, IFACE_("Aspect Correction"), ICON_NONE);
-    row = uiLayoutRow(layout, true);
-    uiItemR(row, ptr, "aspect_correction", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
-
-    col = uiLayoutColumn(layout, true);
-    uiItemR(col, ptr, "factor_x", DEFAULT_FLAGS, IFACE_("X"), ICON_NONE);
-    uiItemR(col, ptr, "factor_y", DEFAULT_FLAGS, IFACE_("Y"), ICON_NONE);
-  }
-  else {
-    col = uiLayoutColumn(layout, true);
-    uiItemR(col, ptr, "size_x", DEFAULT_FLAGS, IFACE_("X"), ICON_NONE);
-    uiItemR(col, ptr, "size_y", DEFAULT_FLAGS, IFACE_("Y"), ICON_NONE);
-  }
-  uiItemR(col, ptr, "use_extended_bounds", DEFAULT_FLAGS, nullptr, ICON_NONE);
-}
-
-static void node_composit_buts_dblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  uiItemR(layout, ptr, "iterations", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(layout, ptr, "use_wrap", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  col = uiLayoutColumn(layout, true);
-  uiItemL(col, IFACE_("Center:"), ICON_NONE);
-  uiItemR(col, ptr, "center_x", DEFAULT_FLAGS, IFACE_("X"), ICON_NONE);
-  uiItemR(col, ptr, "center_y", DEFAULT_FLAGS, IFACE_("Y"), ICON_NONE);
-
-  uiItemS(layout);
-
-  col = uiLayoutColumn(layout, true);
-  uiItemR(col, ptr, "distance", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "angle", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  uiItemS(layout);
-
-  uiItemR(layout, ptr, "spin", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(layout, ptr, "zoom", DEFAULT_FLAGS, nullptr, ICON_NONE);
-}
-
-static void node_composit_buts_bilateralblur(uiLayout *layout,
-                                             bContext *UNUSED(C),
-                                             PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  col = uiLayoutColumn(layout, true);
-  uiItemR(col, ptr, "iterations", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "sigma_color", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "sigma_space", DEFAULT_FLAGS, nullptr, ICON_NONE);
-}
-
-static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA *ptr)
-{
-  uiLayout *sub, *col;
-
-  col = uiLayoutColumn(layout, false);
-  uiItemL(col, IFACE_("Bokeh Type:"), ICON_NONE);
-  uiItemR(col, ptr, "bokeh", DEFAULT_FLAGS, "", ICON_NONE);
-  uiItemR(col, ptr, "angle", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  uiItemR(layout, ptr, "use_gamma_correction", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  col = uiLayoutColumn(layout, false);
-  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer") == true);
-  uiItemR(col, ptr, "f_stop", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  uiItemR(layout, ptr, "blur_max", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(layout, ptr, "threshold", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  col = uiLayoutColumn(layout, false);
-  uiItemR(col, ptr, "use_preview", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  uiTemplateID(layout,
-               C,
-               ptr,
-               "scene",
-               nullptr,
-               nullptr,
-               nullptr,
-               UI_TEMPLATE_ID_FILTER_ALL,
-               false,
-               nullptr);
-
-  col = uiLayoutColumn(layout, false);
-  uiItemR(col, ptr, "use_zbuffer", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  sub = uiLayoutColumn(col, false);
-  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer") == false);
-  uiItemR(sub, ptr, "z_scale", DEFAULT_FLAGS, nullptr, ICON_NONE);
-}
-
-static void node_composit_buts_antialiasing(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  col = uiLayoutColumn(layout, false);
-
-  uiItemR(col, ptr, "threshold", 0, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "contrast_limit", 0, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "corner_rounding", 0, nullptr, ICON_NONE);
-}
-
-/* glare node */
-static void node_composit_buts_glare(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiItemR(layout, ptr, "glare_type", DEFAULT_FLAGS, "", ICON_NONE);
-  uiItemR(layout, ptr, "quality", DEFAULT_FLAGS, "", ICON_NONE);
-
-  if (RNA_enum_get(ptr, "glare_type") != 1) {
-    uiItemR(layout, ptr, "iterations", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-    if (RNA_enum_get(ptr, "glare_type") != 0) {
-      uiItemR(
-          layout, ptr, "color_modulation", DEFAULT_FLAGS | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
-    }
-  }
-
-  uiItemR(layout, ptr, "mix", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(layout, ptr, "threshold", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  if (RNA_enum_get(ptr, "glare_type") == 2) {
-    uiItemR(layout, ptr, "streaks", DEFAULT_FLAGS, nullptr, ICON_NONE);
-    uiItemR(layout, ptr, "angle_offset", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  }
-  if (RNA_enum_get(ptr, "glare_type") == 0 || RNA_enum_get(ptr, "glare_type") == 2) {
-    uiItemR(layout, ptr, "fade", DEFAULT_FLAGS | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
-
-    if (RNA_enum_get(ptr, "glare_type") == 0) {
-      uiItemR(layout, ptr, "use_rotate_45", DEFAULT_FLAGS, nullptr, ICON_NONE);
-    }
-  }
-  if (RNA_enum_get(ptr, "glare_type") == 1) {
-    uiItemR(layout, ptr, "size", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  }
-}
-
-static void node_composit_buts_tonemap(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  col = uiLayoutColumn(layout, false);
-  uiItemR(col, ptr, "tonemap_type", DEFAULT_FLAGS, "", ICON_NONE);
-  if (RNA_enum_get(ptr, "tonemap_type") == 0) {
-    uiItemR(col, ptr, "key", DEFAULT_FLAGS | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
-    uiItemR(col, ptr, "offset", DEFAULT_FLAGS, nullptr, ICON_NONE);
-    uiItemR(col, ptr, "gamma", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  }
-  else {
-    uiItemR(col, ptr, "intensity", DEFAULT_FLAGS, nullptr, ICON_NONE);
-    uiItemR(col, ptr, "contrast", DEFAULT_FLAGS | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
-    uiItemR(col, ptr, "adaptation", DEFAULT_FLAGS | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
-    uiItemR(col, ptr, "correction", DEFAULT_FLAGS | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
-  }
-}
-
-static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  col = uiLayoutColumn(layout, false);
-  uiItemR(col, ptr, "use_projector", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  col = uiLayoutColumn(col, false);
-  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector") == false);
-  uiItemR(col, ptr, "use_jitter", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "use_fit", DEFAULT_FLAGS, nullptr, ICON_NONE);
-}
-
-static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  col = uiLayoutColumn(layout, false);
-  uiItemR(col, ptr, "samples", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(col, ptr, "factor", DEFAULT_FLAGS, IFACE_("Blur"), ICON_NONE);
-
-  col = uiLayoutColumn(layout, true);
-  uiItemL(col, IFACE_("Speed:"), ICON_NONE);
-  uiItemR(col, ptr, "speed_min", DEFAULT_FLAGS, IFACE_("Min"), ICON_NONE);
-  uiItemR(col, ptr, "speed_max", DEFAULT_FLAGS, IFACE_("Max"), ICON_NONE);
-
-  uiItemR(layout, ptr, "use_curved", DEFAULT_FLAGS, nullptr, ICON_NONE);
-}
-
-static void node_composit_buts_filter(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiItemR(layout, ptr, "filter_type", DEFAULT_FLAGS, "", ICON_NONE);
-}
-
-static void node_composit_buts_flip(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiItemR(layout, ptr, "axis", DEFAULT_FLAGS, "", ICON_NONE);
-}
-
-static void node_composit_buts_crop(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
-  uiLayout *col;
-
-  uiItemR(layout, ptr, "use_crop_size", DEFAULT_FLAGS, nullptr, ICON_NONE);
-  uiItemR(layout, ptr, "relative", DEFAULT_FLAGS, nullptr, ICON_NONE);
-
-  col = uiLayoutColumn(layout, true);
-  if (RNA_boolean_get(ptr, "relative")) {
- 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list