Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc2
-rw-r--r--source/blender/nodes/shader/node_shader_util.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc9
5 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc
index efc2dff48c1..8d5f4855512 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc
@@ -77,7 +77,7 @@ static bool colinear_f3_f3_f3(const float3 p1, const float3 p2, const float3 p3)
{
const float3 a = (p2 - p1).normalized();
const float3 b = (p3 - p1).normalized();
- return (a == b || a == b * -1.0f);
+ return (ELEM(a, b, b * -1.0f));
}
static std::unique_ptr<CurveEval> create_point_circle_curve(
diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
index 25f0d355c9e..e293cd9b8fe 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
@@ -202,7 +202,7 @@ static void copy_masked_edges_to_new_mesh(const Mesh &src_mesh, Mesh &dst_mesh,
BLI_assert(src_mesh.totedge == edge_map.size());
for (const int i_src : IndexRange(src_mesh.totedge)) {
const int i_dst = edge_map[i_src];
- if (i_dst == -1 || i_dst == -2) {
+ if (ELEM(i_dst, -1, -2)) {
continue;
}
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index abc2c7008c7..97041b3fdfd 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -40,7 +40,7 @@ static bool sh_fn_poll_default(bNodeType *UNUSED(ntype),
bNodeTree *ntree,
const char **r_disabled_hint)
{
- if (!STREQ(ntree->idname, "ShaderNodeTree") && !STREQ(ntree->idname, "GeometryNodeTree")) {
+ if (!STR_ELEM(ntree->idname, "ShaderNodeTree", "GeometryNodeTree")) {
*r_disabled_hint = "Not a shader or geometry node tree";
return false;
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c
index 2d3957d159e..cb4f0594310 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c
@@ -183,7 +183,7 @@ static void node_shader_update_principled(bNodeTree *UNUSED(ntree), bNode *node)
}
}
- if (STREQ(sock->name, "Subsurface IOR") || STREQ(sock->name, "Subsurface Anisotropy")) {
+ if (STR_ELEM(sock->name, "Subsurface IOR", "Subsurface Anisotropy")) {
if (sss_method == SHD_SUBSURFACE_BURLEY) {
sock->flag |= SOCK_UNAVAIL;
}
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 07904123ace..574260f3c36 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc
@@ -157,7 +157,7 @@ static void node_shader_update_tex_voronoi(bNodeTree *UNUSED(ntree), bNode *node
nodeSetSocketAvailability(outWSock,
tex->feature != SHD_VORONOI_DISTANCE_TO_EDGE &&
tex->feature != SHD_VORONOI_N_SPHERE_RADIUS &&
- (tex->dimensions == 1 || tex->dimensions == 4));
+ (ELEM(tex->dimensions, 1, 4)));
nodeSetSocketAvailability(outRadiusSock, tex->feature == SHD_VORONOI_N_SPHERE_RADIUS);
}
@@ -211,7 +211,7 @@ class VoronoiMinowskiFunction : public fn::MultiFunction {
if (dimensions != 1) {
signature.single_output<float3>("Position");
}
- if ((dimensions == 1 || dimensions == 4)) {
+ if (ELEM(dimensions, 1, 4)) {
signature.single_output<float>("W");
}
@@ -547,7 +547,7 @@ class VoronoiMetricFunction : public fn::MultiFunction {
if (dimensions != 1) {
signature.single_output<float3>("Position");
}
- if ((dimensions == 1 || dimensions == 4)) {
+ if (ELEM(dimensions, 1, 4)) {
signature.single_output<float>("W");
}
@@ -1048,8 +1048,7 @@ static void sh_node_voronoi_build_multi_function(blender::nodes::NodeMultiFuncti
NodeTexVoronoi *tex = (NodeTexVoronoi *)node.storage;
bool minowski = (tex->distance == SHD_VORONOI_MINKOWSKI && tex->dimensions != 1 &&
!ELEM(tex->feature, SHD_VORONOI_DISTANCE_TO_EDGE, SHD_VORONOI_N_SPHERE_RADIUS));
- bool dist_radius = (tex->feature == SHD_VORONOI_DISTANCE_TO_EDGE ||
- tex->feature == SHD_VORONOI_N_SPHERE_RADIUS);
+ bool dist_radius = ELEM(tex->feature, SHD_VORONOI_DISTANCE_TO_EDGE, SHD_VORONOI_N_SPHERE_RADIUS);
if (dist_radius) {
builder.construct_and_set_matching_fn<VoronoiEdgeFunction>(tex->dimensions, tex->feature);
}