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:
authorHans Goudey <h.goudey@me.com>2021-09-04 00:48:47 +0300
committerHans Goudey <h.goudey@me.com>2021-09-04 00:49:47 +0300
commit716682365c6bcc1b5f757232ce1d2499b0d062a9 (patch)
tree23bc58dc317144b861cb1caba505c2abbde81d24
parent4fb7217043627ce952583d99c4b8537e10ee2903 (diff)
Fix T91119: Curve to mesh node inverted face normals
Previously I thought I fixed this by reversing the face corner indices in quads created by the curve to mesh node. But then we fixed a problem with the transforms used in that node by inverting one of their components, so the required direction also reversed. This commit reverts rBcf28398471c84 and reverses the default direction of the quadrilateral primitive so it's the same as the others. Tests will be updated.
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc40
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc12
2 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc
index 0d78d6c08d1..07ddaa8f61e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc
@@ -30,10 +30,10 @@ static void geo_node_curve_primitive_quadrilateral_declare(NodeDeclarationBuilde
b.add_input<decl::Float>("Offset").default_value(1.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>("Bottom Height").default_value(3.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>("Top Height").default_value(1.0f).subtype(PROP_DISTANCE);
- b.add_input<decl::Vector>("Point 1").default_value({-1.0f, 1.0f, 0.0f}).subtype(PROP_DISTANCE);
- b.add_input<decl::Vector>("Point 2").default_value({1.0f, 1.0f, 0.0f}).subtype(PROP_DISTANCE);
- b.add_input<decl::Vector>("Point 3").default_value({1.0f, -1.0f, 0.0f}).subtype(PROP_DISTANCE);
- b.add_input<decl::Vector>("Point 4").default_value({-1.0f, -1.0f, 0.0f}).subtype(PROP_DISTANCE);
+ b.add_input<decl::Vector>("Point 1").default_value({-1.0f, -1.0f, 0.0f}).subtype(PROP_DISTANCE);
+ b.add_input<decl::Vector>("Point 2").default_value({1.0f, -1.0f, 0.0f}).subtype(PROP_DISTANCE);
+ b.add_input<decl::Vector>("Point 3").default_value({1.0f, 1.0f, 0.0f}).subtype(PROP_DISTANCE);
+ b.add_input<decl::Vector>("Point 4").default_value({-1.0f, 1.0f, 0.0f}).subtype(PROP_DISTANCE);
b.add_output<decl::Geometry>("Curve");
}
@@ -106,10 +106,10 @@ static void create_rectangle_curve(MutableSpan<float3> positions,
const float height,
const float width)
{
- positions[0] = float3(width / 2.0f, -height / 2.0f, 0.0f);
- positions[1] = float3(-width / 2.0f, -height / 2.0f, 0.0f);
- positions[2] = float3(-width / 2.0f, height / 2.0f, 0.0f);
- positions[3] = float3(width / 2.0f, height / 2.0f, 0.0f);
+ positions[0] = float3(width / 2.0f, height / 2.0f, 0.0f);
+ positions[1] = float3(-width / 2.0f, height / 2.0f, 0.0f);
+ positions[2] = float3(-width / 2.0f, -height / 2.0f, 0.0f);
+ positions[3] = float3(width / 2.0f, -height / 2.0f, 0.0f);
}
static void create_points_curve(MutableSpan<float3> positions,
@@ -129,10 +129,10 @@ static void create_parallelogram_curve(MutableSpan<float3> positions,
const float width,
const float offset)
{
- positions[0] = float3(width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
- positions[1] = float3(-width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
- positions[2] = float3(-width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
- positions[3] = float3(width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
+ positions[0] = float3(width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
+ positions[1] = float3(-width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
+ positions[2] = float3(-width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
+ positions[3] = float3(width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
}
static void create_trapezoid_curve(MutableSpan<float3> positions,
const float bottom,
@@ -140,10 +140,10 @@ static void create_trapezoid_curve(MutableSpan<float3> positions,
const float offset,
const float height)
{
- positions[0] = float3(bottom / 2.0f, -height / 2.0f, 0.0f);
- positions[1] = float3(-bottom / 2.0f, -height / 2.0f, 0.0f);
- positions[2] = float3(-top / 2.0f + offset, height / 2.0f, 0.0f);
- positions[3] = float3(top / 2.0f + offset, height / 2.0f, 0.0f);
+ positions[0] = float3(top / 2.0f + offset, height / 2.0f, 0.0f);
+ positions[1] = float3(-top / 2.0f + offset, height / 2.0f, 0.0f);
+ positions[2] = float3(-bottom / 2.0f, -height / 2.0f, 0.0f);
+ positions[3] = float3(bottom / 2.0f, -height / 2.0f, 0.0f);
}
static void create_kite_curve(MutableSpan<float3> positions,
@@ -151,10 +151,10 @@ static void create_kite_curve(MutableSpan<float3> positions,
const float bottom_height,
const float top_height)
{
- positions[0] = float3(-width / 2.0f, 0, 0);
- positions[1] = float3(0, top_height, 0);
- positions[2] = float3(width / 2, 0, 0);
- positions[3] = float3(0, -bottom_height, 0);
+ positions[0] = float3(0, -bottom_height, 0);
+ positions[1] = float3(width / 2, 0, 0);
+ positions[2] = float3(0, top_height, 0);
+ positions[3] = float3(-width / 2.0f, 0, 0);
}
static void geo_node_curve_primitive_quadrilateral_exec(GeoNodeExecParams params)
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
index ebaae59fbd6..b0c763c7d06 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
@@ -164,16 +164,16 @@ static void spline_extrude_to_mesh_data(const Spline &spline,
MLoop &loop_a = r_loops[ring_segment_loop_offset];
loop_a.v = ring_vert_offset + i_profile;
- loop_a.e = spline_edge_start + i_ring;
+ loop_a.e = ring_edge_start + i_profile;
MLoop &loop_b = r_loops[ring_segment_loop_offset + 1];
- loop_b.v = next_ring_vert_offset + i_profile;
- loop_b.e = next_ring_edge_offset + i_profile;
+ loop_b.v = ring_vert_offset + i_next_profile;
+ loop_b.e = next_spline_edge_start + i_ring;
MLoop &loop_c = r_loops[ring_segment_loop_offset + 2];
loop_c.v = next_ring_vert_offset + i_next_profile;
- loop_c.e = next_spline_edge_start + i_ring;
+ loop_c.e = next_ring_edge_offset + i_profile;
MLoop &loop_d = r_loops[ring_segment_loop_offset + 3];
- loop_d.v = ring_vert_offset + i_next_profile;
- loop_d.e = ring_edge_start + i_profile;
+ loop_d.v = next_ring_vert_offset + i_profile;
+ loop_d.e = spline_edge_start + i_ring;
}
}