Compositor: Remove Variable Size blur option
This patch removes the Variable Size blur option from the Blur and Bokeh Blur nodes. So now, whatever the user connects to the size input will be used, be it variable or constant. The option previously could be used to force the node to ignore variable size inputs and assume a size of 1, so it was useless. Versioning would be difficult, as we don't know if incoming links to the size input is variable or single. So this is a breaking change. But I can't think of a real reason why the user might use this option, so this seems safe from a practical point of view. Pull Request: https://projects.blender.org/blender/blender/pulls/138261
This commit is contained in:
@@ -1052,7 +1052,6 @@ typedef enum CMPNodeMaskFlags {
|
||||
} CMPNodeMaskFlags;
|
||||
|
||||
enum {
|
||||
CMP_NODEFLAG_BLUR_VARIABLE_SIZE = (1 << 0),
|
||||
CMP_NODEFLAG_BLUR_EXTEND_BOUNDS = (1 << 1),
|
||||
};
|
||||
|
||||
|
||||
@@ -7307,9 +7307,11 @@ static void def_cmp_blur(BlenderRNA * /*brna*/, StructRNA *srna)
|
||||
|
||||
/* duplicated in def_cmp_bokehblur */
|
||||
prop = RNA_def_property(srna, "use_variable_size", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "custom1", CMP_NODEFLAG_BLUR_VARIABLE_SIZE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "custom1", 1);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Variable Size", "Support variable blur per pixel when using an image for size input");
|
||||
prop,
|
||||
"Variable Size",
|
||||
"Support variable blur per pixel when using an image for size input. (Deprecated: Unused.)");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_extended_bounds", PROP_BOOLEAN, PROP_NONE);
|
||||
@@ -9662,9 +9664,11 @@ static void def_cmp_bokehblur(BlenderRNA * /*brna*/, StructRNA *srna)
|
||||
|
||||
/* duplicated in def_cmp_blur */
|
||||
prop = RNA_def_property(srna, "use_variable_size", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "custom1", CMP_NODEFLAG_BLUR_VARIABLE_SIZE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "custom1", 1);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Variable Size", "Support variable blur per pixel when using an image for size input");
|
||||
prop,
|
||||
"Variable Size",
|
||||
"Support variable blur per pixel when using an image for size input. (Deprecated: Unused.)");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_extended_bounds", PROP_BOOLEAN, PROP_NONE);
|
||||
|
||||
@@ -59,14 +59,10 @@ static void node_composit_buts_blur(uiLayout *layout, bContext * /*C*/, PointerR
|
||||
|
||||
col = &layout->column(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", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
|
||||
if (filter != R_FILTER_FAST_GAUSS) {
|
||||
uiItemR(col, ptr, "use_variable_size", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
if (!reference) {
|
||||
uiItemR(col, ptr, "use_bokeh", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
}
|
||||
uiItemR(col, ptr, "use_bokeh", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
uiItemR(col, ptr, "use_gamma_correction", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
}
|
||||
|
||||
@@ -124,7 +120,7 @@ class BlurOperation : public NodeOperation {
|
||||
if (node_storage(bnode()).filtertype == R_FILTER_FAST_GAUSS) {
|
||||
recursive_gaussian_blur(context(), *blur_input, *blur_output, compute_blur_radius());
|
||||
}
|
||||
else if (use_variable_size()) {
|
||||
else if (!this->get_input("Size").is_single_value()) {
|
||||
execute_variable_size(*blur_input, *blur_output);
|
||||
}
|
||||
else if (use_separable_filter()) {
|
||||
@@ -482,12 +478,6 @@ class BlurOperation : public NodeOperation {
|
||||
}
|
||||
}
|
||||
|
||||
bool use_variable_size()
|
||||
{
|
||||
return get_variable_size() && !get_input("Size").is_single_value() &&
|
||||
node_storage(bnode()).filtertype != R_FILTER_FAST_GAUSS;
|
||||
}
|
||||
|
||||
float2 get_size_factor()
|
||||
{
|
||||
return float2(node_storage(bnode()).percentx, node_storage(bnode()).percenty) / 100.0f;
|
||||
@@ -502,11 +492,6 @@ class BlurOperation : public NodeOperation {
|
||||
{
|
||||
return bnode().custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS;
|
||||
}
|
||||
|
||||
bool get_variable_size()
|
||||
{
|
||||
return bnode().custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE;
|
||||
}
|
||||
};
|
||||
|
||||
static NodeOperation *get_compositor_operation(Context &context, DNode node)
|
||||
|
||||
@@ -51,8 +51,6 @@ static void node_composit_init_bokehblur(bNodeTree * /*ntree*/, bNode *node)
|
||||
|
||||
static void node_composit_buts_bokehblur(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
|
||||
{
|
||||
uiItemR(layout, ptr, "use_variable_size", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
// uiItemR(layout, ptr, "f_stop", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
uiItemR(layout, ptr, "blur_max", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
uiItemR(layout, ptr, "use_extended_bounds", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
|
||||
}
|
||||
@@ -72,7 +70,7 @@ class BokehBlurOperation : public NodeOperation {
|
||||
return;
|
||||
}
|
||||
|
||||
if (get_input("Size").is_single_value() || !get_variable_size()) {
|
||||
if (this->get_input("Size").is_single_value()) {
|
||||
execute_constant_size();
|
||||
}
|
||||
else {
|
||||
@@ -390,11 +388,6 @@ class BokehBlurOperation : public NodeOperation {
|
||||
return bnode().custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS;
|
||||
}
|
||||
|
||||
bool get_variable_size()
|
||||
{
|
||||
return bnode().custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE;
|
||||
}
|
||||
|
||||
int get_max_size()
|
||||
{
|
||||
return int(bnode().custom4);
|
||||
|
||||
Submodule tests/data updated: 06951a813c...eec6ff3e17
Reference in New Issue
Block a user