A Curve Primitive node for creating squares, rectangles, trapezoids, kites, and parallelograms.
Details
- Reviewers
Hans Goudey (HooglyBoogly) - Maniphest Tasks
- T89220: Curve Primitive Nodes
- Commits
- rB2a41ab5e6ca4: Geometry Nodes: Curve Primitive Quadrilateral
Diff Detail
- Repository
- rB Blender
Event Timeline
I'm curious, what did you base the inputs on? I've seen "shear" before, but never "pinch". (It's possible I've just never seen it!)
| source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc | ||
|---|---|---|
| 43 | How about using something like this: spline->resize(4); MutableSpan<float3> positions = spline->positions(); positions[0] = ... Also, then you don't need to reallocate the spline attributes, resize does that for you. | |
It was the best word I could come up with for what it does. I wanted to make it easy to make a trapezoid and this was a shot in the dark. I'm open to suggestions.
I wonder if specifying an offset for the top from left to right would be a bit more intuitive. It could be called "Top Offset" or something similar.
So instead of shearing, we offset the top? Would that change make Top Size a better wording for "pinch" (which was in desperate need of a name change)
Yeah, right, I think the inputs could be: "Height", "Bottom", "Top", "Top Offset", or maybe with "Length" after "Bottom" and "Top". Does that make sense?
We talked about this one more time at the meeting today. We thought the changes made sense, but Simon suggested adding a "Points" mode, similar to the other primitives, where you could choose the points directly as vectors.
| source/blender/makesrna/intern/rna_nodetree.c | ||
|---|---|---|
| 9843 | typo: Rectange -> Rectangle | |
The modes are a nice way to do this actually, I like it! Just one more review iteration.
| source/blender/makesdna/DNA_node_types.h | ||
|---|---|---|
| 1381 | What about calling this NodeGeometryCurvePrimitiveQuad? Otherwise it's sort of absurdly long : P | |
| 1939 | Same here, GeometryNodeCurvePrimitiveQuadMode is a bit shorter at least | |
| source/blender/makesrna/intern/rna_nodetree.c | ||
| 9952 | Extra newline | |
| 9975 | Extra newline | |
| source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc | ||
| 50–51 | Unused variable | |
| 95–98 | It looks like mostly these are set to false. What about this: loop through all input sockets with LISTBASE_FOREACH
set their availability to false
switch (mode) {
for each mode, set the availability to true for the sockets it uses
} | |
| 192 | All of the p[4] variables are unused in this file | |
| 256–262 | It strikes me that all these functions except for choosing the position values are the same. Maybe we could move the common parts to the caller and be left with five functions that just take a MutableSpan<float3> and their options. | |
