diff --git a/source/blender/nodes/shader/node_shader_util.cc b/source/blender/nodes/shader/node_shader_util.cc index c8bd93d9b45..9bc5c80e3f3 100644 --- a/source/blender/nodes/shader/node_shader_util.cc +++ b/source/blender/nodes/shader/node_shader_util.cc @@ -38,9 +38,9 @@ bool sh_node_poll_default(const blender::bke::bNodeType * /*ntype*/, return true; } -static bool sh_fn_poll_default(const blender::bke::bNodeType * /*ntype*/, - const bNodeTree *ntree, - const char **r_disabled_hint) +static bool common_poll_default(const blender::bke::bNodeType * /*ntype*/, + const bNodeTree *ntree, + const char **r_disabled_hint) { if (!STR_ELEM(ntree->idname, "ShaderNodeTree", "GeometryNodeTree")) { *r_disabled_hint = RPT_("Not a shader or geometry node tree"); @@ -60,12 +60,12 @@ void sh_node_type_base(blender::bke::bNodeType *ntype, ntype->gather_link_search_ops = blender::nodes::search_link_ops_for_basic_node; } -void sh_fn_node_type_base(blender::bke::bNodeType *ntype, - std::string idname, - const std::optional legacy_type) +void common_node_type_base(blender::bke::bNodeType *ntype, + std::string idname, + const std::optional legacy_type) { sh_node_type_base(ntype, idname, legacy_type); - ntype->poll = sh_fn_poll_default; + ntype->poll = common_poll_default; ntype->gather_link_search_ops = blender::nodes::search_link_ops_for_basic_node; } diff --git a/source/blender/nodes/shader/node_shader_util.hh b/source/blender/nodes/shader/node_shader_util.hh index dd1fa1c33a7..e4632611cc1 100644 --- a/source/blender/nodes/shader/node_shader_util.hh +++ b/source/blender/nodes/shader/node_shader_util.hh @@ -45,9 +45,9 @@ bool sh_node_poll_default(const blender::bke::bNodeType *ntype, void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, std::optional legacy_type = std::nullopt); -void sh_fn_node_type_base(blender::bke::bNodeType *ntype, - std::string idname, - std::optional legacy_type = std::nullopt); +void common_node_type_base(blender::bke::bNodeType *ntype, + std::string idname, + std::optional legacy_type = std::nullopt); bool line_style_shader_nodes_poll(const bContext *C); bool world_shader_nodes_poll(const bContext *C); bool object_shader_nodes_poll(const bContext *C); diff --git a/source/blender/nodes/shader/nodes/node_shader_blackbody.cc b/source/blender/nodes/shader/nodes/node_shader_blackbody.cc index 78d287a9034..2587baa2abd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_blackbody.cc +++ b/source/blender/nodes/shader/nodes/node_shader_blackbody.cc @@ -70,7 +70,7 @@ void register_node_type_sh_blackbody() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeBlackbody", SH_NODE_BLACKBODY); + common_node_type_base(&ntype, "ShaderNodeBlackbody", SH_NODE_BLACKBODY); ntype.ui_name = "Blackbody"; ntype.ui_description = "Convert a blackbody temperature to an RGB value"; ntype.enum_name_legacy = "BLACKBODY"; diff --git a/source/blender/nodes/shader/nodes/node_shader_clamp.cc b/source/blender/nodes/shader/nodes/node_shader_clamp.cc index e0651c239da..28215234578 100644 --- a/source/blender/nodes/shader/nodes/node_shader_clamp.cc +++ b/source/blender/nodes/shader/nodes/node_shader_clamp.cc @@ -99,7 +99,7 @@ void register_node_type_sh_clamp() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeClamp", SH_NODE_CLAMP); + common_node_type_base(&ntype, "ShaderNodeClamp", SH_NODE_CLAMP); ntype.ui_name = "Clamp"; ntype.ui_description = "Clamp a value between a minimum and a maximum"; ntype.enum_name_legacy = "CLAMP"; diff --git a/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc b/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc index 5fa06f893cc..b9188f76d38 100644 --- a/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc +++ b/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc @@ -162,7 +162,7 @@ void register_node_type_sh_valtorgb() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeValToRGB", SH_NODE_VALTORGB); + common_node_type_base(&ntype, "ShaderNodeValToRGB", SH_NODE_VALTORGB); ntype.ui_name = "Color Ramp"; ntype.ui_description = "Map values to colors with the use of a gradient"; ntype.enum_name_legacy = "VALTORGB"; diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.cc b/source/blender/nodes/shader/nodes/node_shader_curves.cc index 1761b246dac..39b52e0b60b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.cc +++ b/source/blender/nodes/shader/nodes/node_shader_curves.cc @@ -132,7 +132,7 @@ void register_node_type_sh_curve_vec() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeVectorCurve", SH_NODE_CURVE_VEC); + common_node_type_base(&ntype, "ShaderNodeVectorCurve", SH_NODE_CURVE_VEC); ntype.ui_name = "Vector Curves"; ntype.ui_description = "Map input vector components with curves"; ntype.enum_name_legacy = "CURVE_VEC"; @@ -296,7 +296,7 @@ void register_node_type_sh_curve_rgb() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeRGBCurve", SH_NODE_CURVE_RGB); + common_node_type_base(&ntype, "ShaderNodeRGBCurve", SH_NODE_CURVE_RGB); ntype.ui_name = "RGB Curves"; ntype.ui_description = "Apply color corrections for each color channel"; ntype.enum_name_legacy = "CURVE_RGB"; @@ -428,7 +428,7 @@ void register_node_type_sh_curve_float() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeFloatCurve", SH_NODE_CURVE_FLOAT); + common_node_type_base(&ntype, "ShaderNodeFloatCurve", SH_NODE_CURVE_FLOAT); ntype.ui_name = "Float Curve"; ntype.ui_description = "Map an input float to a curve and outputs a float value"; ntype.enum_name_legacy = "CURVE_FLOAT"; diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc index aef4bce6cd9..e38d2a900df 100644 --- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc +++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc @@ -524,7 +524,7 @@ void register_node_type_sh_map_range() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeMapRange", SH_NODE_MAP_RANGE); + common_node_type_base(&ntype, "ShaderNodeMapRange", SH_NODE_MAP_RANGE); ntype.ui_name = "Map Range"; ntype.ui_description = "Remap a value from a range to a target range"; ntype.enum_name_legacy = "MAP_RANGE"; diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc index 11ec6c9502c..d46d906505c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_math.cc @@ -361,7 +361,7 @@ void register_node_type_sh_math() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeMath", SH_NODE_MATH); + common_node_type_base(&ntype, "ShaderNodeMath", SH_NODE_MATH); ntype.ui_name = "Math"; ntype.ui_description = "Perform math operations"; ntype.enum_name_legacy = "MATH"; diff --git a/source/blender/nodes/shader/nodes/node_shader_mix.cc b/source/blender/nodes/shader/nodes/node_shader_mix.cc index 311bfb289ba..b5fb7f245ee 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mix.cc @@ -599,7 +599,7 @@ void register_node_type_sh_mix() namespace file_ns = blender::nodes::node_sh_mix_cc; static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeMix", SH_NODE_MIX); + common_node_type_base(&ntype, "ShaderNodeMix", SH_NODE_MIX); ntype.ui_name = "Mix"; ntype.ui_description = "Mix values by a factor"; ntype.enum_name_legacy = "MIX"; diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc index ac20b82822d..78edbbb5c0e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc @@ -158,7 +158,7 @@ void register_node_type_sh_mix_rgb() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeMixRGB", SH_NODE_MIX_RGB_LEGACY); + common_node_type_base(&ntype, "ShaderNodeMixRGB", SH_NODE_MIX_RGB_LEGACY); ntype.ui_name = "Mix (Legacy)"; ntype.ui_description = "Mix two input colors"; ntype.enum_name_legacy = "MIX_RGB"; diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc index 801ffd42ff5..031ca8f2a25 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc @@ -79,7 +79,7 @@ void register_node_type_sh_seprgb() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeSeparateRGB", SH_NODE_SEPRGB_LEGACY); + common_node_type_base(&ntype, "ShaderNodeSeparateRGB", SH_NODE_SEPRGB_LEGACY); ntype.ui_name = "Separate RGB (Legacy)"; ntype.ui_description = "Deprecated"; ntype.enum_name_legacy = "SEPRGB"; @@ -127,7 +127,7 @@ void register_node_type_sh_combrgb() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeCombineRGB", SH_NODE_COMBRGB_LEGACY); + common_node_type_base(&ntype, "ShaderNodeCombineRGB", SH_NODE_COMBRGB_LEGACY); ntype.ui_name = "Combine RGB (Legacy)"; ntype.ui_description = "Deprecated"; ntype.enum_name_legacy = "COMBRGB"; diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc index 1039de8d834..18431162eaf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc @@ -137,7 +137,7 @@ void register_node_type_sh_sepxyz() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeSeparateXYZ", SH_NODE_SEPXYZ); + common_node_type_base(&ntype, "ShaderNodeSeparateXYZ", SH_NODE_SEPXYZ); ntype.ui_name = "Separate XYZ"; ntype.ui_description = "Split a vector into its X, Y, and Z components"; ntype.enum_name_legacy = "SEPXYZ"; @@ -229,7 +229,7 @@ void register_node_type_sh_combxyz() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeCombineXYZ", SH_NODE_COMBXYZ); + common_node_type_base(&ntype, "ShaderNodeCombineXYZ", SH_NODE_COMBXYZ); ntype.ui_name = "Combine XYZ"; ntype.ui_description = "Create a vector from X, Y, and Z components"; ntype.enum_name_legacy = "COMBXYZ"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc b/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc index dd53796dbf0..428caec09cb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc @@ -301,7 +301,7 @@ void register_node_type_sh_tex_brick() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexBrick", SH_NODE_TEX_BRICK); + common_node_type_base(&ntype, "ShaderNodeTexBrick", SH_NODE_TEX_BRICK); ntype.ui_name = "Brick Texture"; ntype.ui_description = "Generate a procedural texture producing bricks"; ntype.enum_name_legacy = "TEX_BRICK"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc b/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc index 35106911c1a..39257fbd8cb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc @@ -139,7 +139,7 @@ void register_node_type_sh_tex_checker() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexChecker", SH_NODE_TEX_CHECKER); + common_node_type_base(&ntype, "ShaderNodeTexChecker", SH_NODE_TEX_CHECKER); ntype.ui_name = "Checker Texture"; ntype.ui_description = "Generate a checkerboard texture"; ntype.enum_name_legacy = "TEX_CHECKER"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gabor.cc b/source/blender/nodes/shader/nodes/node_shader_tex_gabor.cc index 9bf077bf57c..a3f1647dbe4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gabor.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gabor.cc @@ -207,7 +207,7 @@ void register_node_type_sh_tex_gabor() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexGabor", SH_NODE_TEX_GABOR); + common_node_type_base(&ntype, "ShaderNodeTexGabor", SH_NODE_TEX_GABOR); ntype.ui_name = "Gabor Texture"; ntype.ui_description = "Generate Gabor noise"; ntype.enum_name_legacy = "TEX_GABOR"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc index 844fdbc89ce..dbd82401272 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc @@ -197,7 +197,7 @@ void register_node_type_sh_tex_gradient() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexGradient", SH_NODE_TEX_GRADIENT); + common_node_type_base(&ntype, "ShaderNodeTexGradient", SH_NODE_TEX_GRADIENT); ntype.ui_name = "Gradient Texture"; ntype.ui_description = "Generate interpolated color and intensity values based on the input vector"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc b/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc index 1a5d29a9aea..1aa74ad603d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc @@ -183,7 +183,7 @@ void register_node_type_sh_tex_magic() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexMagic", SH_NODE_TEX_MAGIC); + common_node_type_base(&ntype, "ShaderNodeTexMagic", SH_NODE_TEX_MAGIC); ntype.ui_name = "Magic Texture"; ntype.ui_description = "Generate a psychedelic color texture"; ntype.enum_name_legacy = "TEX_MAGIC"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc index 5a1a50368f4..a005d45630a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc @@ -461,7 +461,7 @@ void register_node_type_sh_tex_noise() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexNoise", SH_NODE_TEX_NOISE); + common_node_type_base(&ntype, "ShaderNodeTexNoise", SH_NODE_TEX_NOISE); ntype.ui_name = "Noise Texture"; ntype.ui_description = "Generate fractal Perlin noise"; ntype.enum_name_legacy = "TEX_NOISE"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc index 02b20d43047..b54e58e0df1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc @@ -818,7 +818,7 @@ void register_node_type_sh_tex_voronoi() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexVoronoi", SH_NODE_TEX_VORONOI); + common_node_type_base(&ntype, "ShaderNodeTexVoronoi", SH_NODE_TEX_VORONOI); ntype.ui_name = "Voronoi Texture"; ntype.ui_description = "Generate Worley noise based on the distance to random points. Typically used to generate " diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc index f72d7afcc1f..df2a68f6065 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc @@ -335,7 +335,7 @@ void register_node_type_sh_tex_wave() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexWave", SH_NODE_TEX_WAVE); + common_node_type_base(&ntype, "ShaderNodeTexWave", SH_NODE_TEX_WAVE); ntype.ui_name = "Wave Texture"; ntype.ui_description = "Generate procedural bands or rings with noise"; ntype.enum_name_legacy = "TEX_WAVE"; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc index b23e9fea0ac..a8c57d78710 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc @@ -260,7 +260,7 @@ void register_node_type_sh_tex_white_noise() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeTexWhiteNoise", SH_NODE_TEX_WHITE_NOISE); + common_node_type_base(&ntype, "ShaderNodeTexWhiteNoise", SH_NODE_TEX_WHITE_NOISE); ntype.ui_name = "White Noise Texture"; ntype.ui_description = "Return a random value or color based on an input seed"; ntype.enum_name_legacy = "TEX_WHITE_NOISE"; diff --git a/source/blender/nodes/shader/nodes/node_shader_value.cc b/source/blender/nodes/shader/nodes/node_shader_value.cc index beebfb78409..1657abe26b5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_value.cc +++ b/source/blender/nodes/shader/nodes/node_shader_value.cc @@ -54,7 +54,7 @@ void register_node_type_sh_value() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeValue", SH_NODE_VALUE); + common_node_type_base(&ntype, "ShaderNodeValue", SH_NODE_VALUE); ntype.ui_name = "Value"; ntype.ui_description = "Input numerical values to other nodes in the tree"; ntype.enum_name_legacy = "VALUE"; diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc index 76594715c4a..ca616bc9344 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc @@ -556,7 +556,7 @@ void register_node_type_sh_vect_math() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeVectorMath", SH_NODE_VECTOR_MATH); + common_node_type_base(&ntype, "ShaderNodeVectorMath", SH_NODE_VECTOR_MATH); ntype.ui_name = "Vector Math"; ntype.ui_description = "Perform vector math operation"; ntype.enum_name_legacy = "VECT_MATH"; diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc b/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc index e6e687c5fb7..27f7259d2ed 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc @@ -268,7 +268,7 @@ void register_node_type_sh_vector_rotate() static blender::bke::bNodeType ntype; - sh_fn_node_type_base(&ntype, "ShaderNodeVectorRotate", SH_NODE_VECTOR_ROTATE); + common_node_type_base(&ntype, "ShaderNodeVectorRotate", SH_NODE_VECTOR_ROTATE); ntype.ui_name = "Vector Rotate"; ntype.ui_description = "Rotate a vector around a pivot point (center)"; ntype.enum_name_legacy = "VECTOR_ROTATE";