Nodes: Rename "Fac" sockets to "Factor"

This PR renames "Fac" sockets to "Factor" in the user interface across
shading and compositing nodes, while keeping the identifier unchanged
for scripting compatibility.

The only texture node affected by this renaming (Color Ramp) was not
updated, as it still uses the old style node declaration and this is
legacy anyway.

This also changes "Bright" to "Brightness" in both shading and
compositing.

Ref #96219

Pull Request: https://projects.blender.org/blender/blender/pulls/140498
This commit is contained in:
Brecht Van Lommel
2025-10-03 18:58:23 +02:00
parent 45c4a42ed4
commit f47a84e710
28 changed files with 68 additions and 34 deletions

View File

@@ -43,7 +43,11 @@ static void node_declare(NodeDeclarationBuilder &b)
b.is_function_node();
b.add_input<decl::Color>("Background").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Foreground").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_input<decl::Menu>("Type")
.default_value(CMP_NODE_ALPHA_OVER_OPERATION_TYPE_OVER)
.static_items(type_items)

View File

@@ -33,7 +33,7 @@ static void cmp_node_brightcontrast_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f}).hide_value();
b.add_output<decl::Color>("Image").align_with_previous();
b.add_input<decl::Float>("Bright").min(-100.0f).max(100.0f);
b.add_input<decl::Float>("Brightness", "Bright").min(-100.0f).max(100.0f);
b.add_input<decl::Float>("Contrast").min(-100.0f).max(100.0f);
}
@@ -75,7 +75,7 @@ static float4 brightness_and_contrast(const float4 &color,
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
{
static auto function = mf::build::SI3_SO<float4, float, float, float4>(
"Bright And Contrast",
"Brightness And Contrast",
[](const float4 &color, const float brightness, const float contrast) -> float4 {
return brightness_and_contrast(color, brightness, contrast);
},

View File

@@ -53,7 +53,11 @@ static void cmp_node_color_spill_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Color>("Image");
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_input<decl::Menu>("Spill Channel")
.default_value(RGBChannel::G)
.static_items(rgb_channel_items)

View File

@@ -57,7 +57,11 @@ static void cmp_node_colorbalance_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f}).hide_value();
b.add_output<decl::Color>("Image").align_with_previous();
b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_input<decl::Menu>("Type")
.default_value(CMP_NODE_COLOR_BALANCE_LGG)

View File

@@ -35,7 +35,7 @@ static void cmp_node_time_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Int>("Start Frame").default_value(1);
b.add_input<decl::Int>("End Frame").default_value(250);
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
}
static void node_composit_init_curves_time(bNodeTree * /*ntree*/, bNode *node)
@@ -133,7 +133,7 @@ static void cmp_node_rgbcurves_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.description("Image/Color input on which RGB color transformation will be applied");
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)

View File

@@ -34,7 +34,7 @@ static void cmp_node_despeckle_declare(NodeDeclarationBuilder &b)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic).align_with_previous();
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)

View File

@@ -45,7 +45,7 @@ static void cmp_node_filter_declare(NodeDeclarationBuilder &b)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic).align_with_previous();
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)

View File

@@ -43,7 +43,11 @@ static void cmp_node_huesatval_declare(NodeDeclarationBuilder &b)
.max(2.0f)
.subtype(PROP_FACTOR)
.translation_context(BLT_I18NCONTEXT_COLOR);
b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
}
using namespace blender::compositor;

View File

@@ -28,7 +28,11 @@ static void cmp_node_huecorrect_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_output<decl::Color>("Image");
}

View File

@@ -31,7 +31,11 @@ static void cmp_node_invert_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Color").default_value({1.0f, 1.0f, 1.0f, 1.0f}).hide_value();
b.add_output<decl::Color>("Color").align_with_previous();
b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_input<decl::Bool>("Invert Color").default_value(true);
b.add_input<decl::Bool>("Invert Alpha").default_value(false);
}

View File

@@ -17,7 +17,7 @@ static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Color>("Color");
b.add_output<decl::Vector>("Vector");
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
b.add_output<decl::Float>("Alpha");
}

View File

@@ -11,10 +11,14 @@ static void node_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Color")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.description("Color input on which correction will be applied");
b.add_input<decl::Float>("Bright").default_value(0.0f).min(-100.0f).max(100.0f).description(
"Brightness correction value.\n"
"An additive-type factor by which to increase the overall brightness of the image. "
"Use a negative number to darken an image, and a positive number to brighten it");
b.add_input<decl::Float>("Brightness", "Bright")
.default_value(0.0f)
.min(-100.0f)
.max(100.0f)
.description(
"Brightness correction value.\n"
"An additive-type factor by which to increase the overall brightness of the image. "
"Use a negative number to darken an image, and a positive number to brighten it");
b.add_input<decl::Float>("Contrast")
.default_value(0.0f)
.min(-100.0f)

View File

@@ -22,7 +22,7 @@ namespace blender::nodes::node_shader_color_ramp_cc {
static void sh_node_valtorgb_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(0.5f)
.min(0.0f)
.max(1.0f)

View File

@@ -21,7 +21,7 @@ namespace blender::nodes::node_shader_curves_cc::vec {
static void sh_node_curve_vec_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.min(0.0f)
.max(1.0f)
.default_value(1.0f)
@@ -159,7 +159,7 @@ namespace blender::nodes::node_shader_curves_cc::rgb {
static void sh_node_curve_rgb_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.min(0.0f)
.max(1.0f)
.default_value(1.0f)

View File

@@ -10,7 +10,7 @@ static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("IOR").default_value(1.5f).min(0.0f).max(1000.0f);
b.add_input<decl::Vector>("Normal").hide_value();
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
}
static int node_shader_gpu_fresnel(GPUMaterial *mat,

View File

@@ -29,7 +29,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.description(
"Value shift. 0 makes the color black, 1 keeps it the same, and higher values make it "
"brighter");
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)

View File

@@ -21,7 +21,7 @@ static void node_declare(NodeDeclarationBuilder &b)
.max(1000000.0f)
.description("Strength of the light source")
.translation_context(BLT_I18NCONTEXT_AMOUNT);
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
}
static void node_shader_buts_ies(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -12,7 +12,7 @@ namespace blender::nodes::node_shader_invert_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)

View File

@@ -22,7 +22,11 @@ namespace blender::nodes::node_shader_mix_rgb_cc {
static void sh_node_mix_rgb_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac").default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
b.add_input<decl::Float>("Factor", "Fac")
.default_value(0.5f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR);
b.add_input<decl::Color>("Color1").default_value({0.5f, 0.5f, 0.5f, 1.0f});
b.add_input<decl::Color>("Color2").default_value({0.5f, 0.5f, 0.5f, 1.0f});
b.add_output<decl::Color>("Color");

View File

@@ -8,7 +8,7 @@ namespace blender::nodes::node_shader_mix_shader_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Fac")
b.add_input<decl::Float>("Factor", "Fac")
.default_value(0.5f)
.min(0.0f)
.max(1.0f)

View File

@@ -85,7 +85,9 @@ NODE_SHADER_MATERIALX_BEGIN
BLI_assert_unreachable();
}
int index = STREQ(socket_out_->identifier, "Red") ? 0 : STREQ(socket_out_->identifier, "Green") ? 1 : 2;
int index = STREQ(socket_out_->identifier, "Red") ? 0 :
STREQ(socket_out_->identifier, "Green") ? 1 :
2;
return convert[index];
}
#endif

View File

@@ -73,7 +73,7 @@ static void sh_node_tex_brick_declare(NodeDeclarationBuilder &b)
.no_muted_links()
.description("Ratio of brick's row height relative to the texture scale");
b.add_output<decl::Color>("Color");
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
}
static void node_shader_buts_tex_brick(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -31,7 +31,7 @@ static void sh_node_tex_checker_declare(NodeDeclarationBuilder &b)
"Overall texture scale.\n"
"The scale is a factor of the bounding box of the face divided by the Scale value");
b.add_output<decl::Color>("Color");
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
}
static void node_shader_init_tex_checker(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -23,7 +23,7 @@ static void sh_node_tex_gradient_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Vector>("Vector").hide_value().implicit_field(
NODE_DEFAULT_INPUT_POSITION_FIELD);
b.add_output<decl::Color>("Color").no_muted_links();
b.add_output<decl::Float>("Fac").no_muted_links();
b.add_output<decl::Float>("Factor", "Fac").no_muted_links();
}
static void node_shader_buts_tex_gradient(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -26,7 +26,7 @@ static void sh_node_tex_magic_declare(NodeDeclarationBuilder &b)
.default_value(1.0f)
.description("Amount of distortion");
b.add_output<decl::Color>("Color").no_muted_links();
b.add_output<decl::Float>("Fac").no_muted_links();
b.add_output<decl::Float>("Factor", "Fac").no_muted_links();
}
static void node_shader_buts_tex_magic(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -67,7 +67,7 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b)
.max(1000.0f)
.default_value(0.0f)
.description("Amount of distortion");
b.add_output<decl::Float>("Fac").no_muted_links();
b.add_output<decl::Float>("Factor", "Fac").no_muted_links();
b.add_output<decl::Color>("Color").no_muted_links();
}

View File

@@ -51,7 +51,7 @@ static void sh_node_tex_wave_declare(NodeDeclarationBuilder &b)
"Position of the wave along the Bands Direction.\n"
"This can be used as an input for more control over the distortion");
b.add_output<decl::Color>("Color").no_muted_links();
b.add_output<decl::Float>("Fac").no_muted_links();
b.add_output<decl::Float>("Factor", "Fac").no_muted_links();
}
static void node_shader_buts_tex_wave(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -16,7 +16,7 @@ namespace blender::nodes::node_shader_wireframe_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Size").default_value(0.01f).min(0.0f).max(100.0f);
b.add_output<decl::Float>("Fac");
b.add_output<decl::Float>("Factor", "Fac");
}
static void node_shader_buts_wireframe(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)