Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
These functions provided little benefit compared to simply setting
the function pointers directly.
|
|
Currently there are both "EDGERENDER" and "EDGEDRAW" flags, which are
almost always used together. Both are runtime data and not exposed to
RNA, used to skip drawing some edges after the subdivision surface
modifier. The render flag is a relic of the Blender internal renderer.
This commit removes the render flag and replaces its uses with the
draw flag.
|
|
The goal is to improve clarity and readability, without
introducing big design changes.
Follows the recent obmat to object_to_world refactor: the
similar naming is used, and it is a run-time only rename,
meaning, there is no affect on .blend files.
This patch does not touch the redundant inversions. Those
can be removed in almost (if not all) cases, but it would
be the best to do it as a separate change.
Differential Revision: https://developer.blender.org/D16367
|
|
As described in T92474 and T91650, this patch adds two features to the
sample curve node. First is an index input, to allow choosing the curve
to sample for each point. Second is a custom field input, which is
evaluated on the control points of the curve and then sampled like the
other outputs. There is an "All Curves" option for the old behavior
which takes the length of all curves into account.
For invalid curve indices, the node outputs zeros (default values).
Invalid lengths and factors are clamped.
There have been various discussions about splitting the node up more,
but this is an intuitive combination of options and will work well
enough for current use cases. The node could still be generalized more
in the future.
Keep in mind that the source field is evaluated on curve control points,
not the evaluated points used for sampling. This is necessary so that
fields like "Index" work as expected.
Differential Revision: https://developer.blender.org/D16147
|
|
Motivation is to disambiguate on the naming level what the matrix
actually means. It is very easy to understand the meaning backwards,
especially since in Python the name goes the opposite way (it is
called `world_matrix` in the Python API).
It is important to disambiguate the naming without making developers
to look into the comment in the header file (which is also not super
clear either). Additionally, more clear naming facilitates the unit
verification (or, in this case, space validation) when reading an
expression.
This patch calls the matrix `object_to_world` which makes it clear
from the local code what is it exactly going on. This is only done
on DNA level, and a lot of local variables still follow the old
naming.
A DNA rename is setup in a way that there is no change on the file
level, so there should be no regressions at all.
The possibility is to add `_matrix` or `_mat` suffix to the name
to make it explicit that it is a matrix. Although, not sure if it
really helps the readability, or is it something redundant.
Differential Revision: https://developer.blender.org/D16328
|
|
Retrieve the surface UV coordinates with the attribute API instead of
the helper function. This allows more flexibility of data types (and
domains), which is helpful especially because geometry nodes
can't write 2D vectors yet.
|
|
|
|
|
|
Attribute copying often uses identical logic for copying selected
elements or copying with an index map. Instead of reimplementing
this in each file, use the common implementation in the array_utils
namespace. This makes the commonality more obvious, gives improved
performance (this implementation is multithreaded), reduces binary
size (I observed a 173KB reduction), and probably reduces compile time.
|
|
String attributes are intentionally not fully supported in geometry nodes
yet because more design work is necessary to decide how they should behave.
For now just disable handling string attributes to avoid crashes.
|
|
|
|
There might be more or fewer curves in the input to the deform curves on
surface node than the original, so the curve's surface UV coordinates
need to be retrieved from the original curves.
|
|
A vertex might be connected to no edges or no faces. Most of these nodes
worked fine in that case, but we might as well make that explicit
and skip the sorting anyway.
|
|
This makes instance handling more consistent with all the other geometry
component types. For example, `MeshComponent` contains a `Mesh *` and
now `InstancesComponent` has a `Instances *`.
Differential Revision: https://developer.blender.org/D16137
|
|
|
|
|
|
|
|
Mesh corners are called "loops" in the code currently. Avoid diverging
naming and just use that convention in some newly added code.
|
|
Unfortunately this commit changed behavior in a fundamental way that
can't be addressed without larger changes. Previously the position
outputs were evaluated on the edge domain and then interpolated to the
context domain, which could be useful for some rudimentary mesh smoothing.
After the commit they were just evaluated at the specified index, which
looks practically random when evaluated on a different domain. We may need
a new node that doesn't have the implicit behavior in the future.
This reverts commit 4ddc5a936e07129aaf94ed7d188b8f5f5ea14085.
|
|
|
|
Also remove an unnecessary cast.
|
|
"Mode" is obvious and isn't worth cutting off the text.
|
|
|
|
This is the conventional way of dealing with unused arguments in C++,
since it works on all compilers.
Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
|
|
Previously the edge index was always determined by the field context,
and the node didn't work when the context was in any other domain.
Adding an index input makes it work much more nicely with the other
topology nodes. It's now in the topology submenu too.
I also reimplemented the edge positions input to use the field at index
node internally. That will probably make it slower for now, but we need
to optimize that to do nothing in some special cases anyway.
Differential Revision: https://developer.blender.org/D16105
|
|
The input supports fields, the outputs are fields only if either of the
inputs are fields. Also, .hide_value() is redundant for implicit fields.
|
|
Rename the node to "Offset Point in Curve"
Since this was committed, more mesh and curve topology nodes have been
committed with a different naming scheme (482d431bb6735e82069). Change
the name of this node to match "Offset Corner in Face". Because the
node was only added recently, it's a full rename, including the ID,
so forward compatibility is broken.
|
|
It's a bit more natural if the "Total" output come second, and it's
also consistent with the Accumulate Field node.
|
|
This node allows for curves to have their evaluated normal mode changed
between MINIMUM_TWIST and Z_UP. A selection input allows for choosing
which spline in the curves object will be affected.
Differential Revision: D16118
|
|
|
|
This node allows sampling an attribute on a mesh surface based
on a UV coordinate. Internally, this has to do a "reverse uv lookup",
i.e. the node has to find the polygon that corresponds to the uv
coordinate. Therefore, the uv map of the mesh should not have
overlapping faces.
Differential Revision: https://developer.blender.org/D15440
|
|
|
|
- Use `enum class`
- Use shorter names for field input classes for better line wrapping
- Use "Vert" instead of "Vertex"
|
|
Issue found in file from T101256.
|
|
|
|
|
|
This patch contains an initial set of nodes to access basic
mesh topology information, as explored in T100020.
The nodes allow six direct topology mappings for meshes:
- **Corner -> Face** The face a corner is in, the index in the face
- **Vertex -> Edge** Choose an edge attached to the vertex
- **Vertex -> Corner** Choose a corner attached to the vertex
- **Corner -> Edge** The next and previous edge at each face corner
- **Corner -> Vertex** The vertex associated with a corner
- **Corner -> Corner** Offset a corner index within a face
And two new topology mappings for curves:
- **Curve -> Points** Choose a point within a curve
- **Point -> Curve** The curve a point is in, the index in the curve
The idea is that some of the 16 possible mesh mappings are more
important, and that this is a useful set of nodes to start exploring
this area. For mappings with an arbitrary number of connections, we
must sort them and use an index to choose a single element, because
geometry nodes does not support list fields. Note that the sort
index has repeating behavior as it goes over the "Total" number of
connections, and negative sort indices choose from the end.
Currently which of the "start" elements is used is determined by the
field context, so the "Field at Index" and "Interpolate Domain" nodes
will be quite important. Also, currently the "Sort Index" inputs are
clamped to the number of connections.
One important feature that isn't implemented here is using the winding
order for the output elements. This can be a separate mode for some
of these nodes. It will be optional because of the performance impact.
There are several todos for separate commits after this:
- Rename "Control Point Neighbors" to be consistent with this naming
- Version away the "Vertex Neighbors" node which is fully redundant now
- Implement a special case for when no weights are used for performance
- De-duplicating some of the sorting logic between the nodes
- Improve performance and memory use of topology mappings
- Look into caching some of the mappings on meshes
Differential Revision: https://developer.blender.org/D16029
|
|
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
|
|
Needs a call to remember_deformed_curve_positions_if_necessary, missed
in rB1f94b56d7744.
Thx @JacquesLucke for the solution!
Differential Revision: https://developer.blender.org/D16078
|
|
|
|
- Use const and whitespace more consistently
- Fix "Offset Valid" output only working on point domain
- Use the smallest output array that can contain the result.
- Consistent include ordering
- Use "data-block" term instead of "object" in tooltip
- Remove unnecessary call to set default output values
|
|
This node allows access to the indices of neighboring control points
within a curve via an offset. This includes taking into consideration
curves that are cyclic.
Differential Revision: D13373
|
|
Previously, all implicit inputs where stored in a centralized place.
Now the information which nodes have which implicit inputs is
stored in the nodes directly.
|
|
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast
This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
|
|
|