Age | Commit message (Collapse) | Author |
|
This commit adds a Volume Cube primitive node. It outputs a volume that
contains a single "density" float grid. The density per voxel can be
controlled with a field that depends on the voxel position (using the
existing Position node). Other field inputs are not supported.
The density field is evaluated on every voxel.
Possible future improvements are listed in D15198.
Differential Revision: https://developer.blender.org/D15198
|
|
A field input node for the scale of each top-level instance transform.
The scale can be set with the "Scale Instances" node, but previously
could not be retrieved.
Differential Revision: https://developer.blender.org/D15132
|
|
A field input node for the rotation of each top-level instance transform.
The rotation can be set with the "Rotate Instances" node, but previously
could not be retrieved.
Differential Revision: https://developer.blender.org/D15131
|
|
This commit removes the implementations of legacy nodes,
their type definitions, and related code that becomes unused.
Now that we have two releases that included the legacy nodes,
there is not much reason to include them still. Removing the
code means refactoring will be easier, and old code doesn't
have to be tested and maintained.
After this commit, the legacy nodes will be undefined in the UI,
so 3.0 or 3.1 should be used to convert files to the fields system.
The net change is 12184 lines removed!
The tooltip for legacy nodes mentioned that we would remove
them before 4.0, which was purposefully a bit vague to allow
us this flexibility. In a poll in a devtalk post showed that the
majority of people were okay with removing the nodes.
https://devtalk.blender.org/t/geometry-nodes-backward-compatibility-poll/20199
Differential Revision: https://developer.blender.org/D14353
|
|
This commit adds three nodes:
- `Remove Attribute`: Removes an attribute with the given name
- `Named Attribute`: A field input node
- `Store Named Attribute`: Puts results of a field in a named attribute
They are added behind a new experimental feature flag, because further
development of attribute search and name dependency visualization will
happen as separate steps.
Ref T91742
Differential Revision: https://developer.blender.org/D12685
|
|
I've had trouble finding this node a few times now,
it's simpler if the file name matches the name in the UI.
|
|
This adds a node with a boolean field output which returns true if all of the
points of the evaluated face are on the same plane. A float field input allows
for the threshold of the face/point comparison to be adjusted on a per face basis.
One clear use case is to only triangulate faces that are not planar.
Differential Revision: https://developer.blender.org/D13906
|
|
This adds a node which copies part of a geometry a dynamic number
of times.
Different parts of the geometry can be copied differing amounts
of times, controlled by the amount input field. Geometry can also
be ignored by use of the selection input.
The output geometry contains only the copies created by the node.
if the amount input is set to zero, the output geometry will be
empty. The duplicate index output is an integer index with the copy
number of each duplicate.
Differential Revision: https://developer.blender.org/D13701
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
This implements a merge by distance operation for point clouds.
Besides the geometry input, there are two others-- a selection
input to limit the operation to certain points, and the merge
distance. While it would be a reasonable feature, the distance
does not support a field currently, since that would make
the algorithm significantly more complex.
All attributes are merged to the merged points, with the values
mixed together. This same generic method is used for all attributes,
including `position`. The `id` attribute uses the value from the
first merged index for each point.
For the implementation, most of the effort goes into creating a
merge map to speed up attribute mixing. Some parts are inherently
single-threaded, like finding the final indices accounting for the
merged points. By far most of the time is spend balancing the
KD tree.
Mesh support will be added in the next commit.
Differential Revision: https://developer.blender.org/D13649
|
|
This patch introduces an extrude node with three modes. The vertex mode
is quite simple, and just attaches new edges to the selected vertices.
The edge mode attaches new faces to the selected edges. The faces mode
extrudes patches of selected faces, or each selected face individually,
depending on the "Individual" boolean input.
The default value of the "Offset" input is the mesh's normals, which
can be scaled with the "Offset Scale" input.
**Attribute Propagation**
Attributes are transferred to the new elements with specific rules.
Attributes will never change domains for interpolations. Generally
boolean attributes are propagated with "or", meaning any connected
"true" value that is mixed in for other types will cause the new value
to be "true" as well. The `"id"` attribute does not have any special
handling currently.
Vertex Mode
- Vertex: Copied values of selected vertices.
- Edge: Averaged values of selected edges. For booleans, edges are
selected if any connected edges are selected.
Edge Mode
- Vertex: Copied values of extruded vertices.
- Connecting edges (vertical): Average values of connected extruded
edges. For booleans, the edges are selected if any connected
extruded edges are selected.
- Duplicate edges: Copied values of selected edges.
- Face: Averaged values of all faces connected to the selected edge.
For booleans, faces are selected if any connected original faces
are selected.
- Corner: Averaged values of corresponding corners in all faces
connected to selected edges. For booleans, corners are selected
if one of those corners are selected.
Face Mode
- Vertex: Copied values of extruded vertices.
- Connecting edges (vertical): Average values of connected selected
edges, not including the edges "on top" of extruded regions.
For booleans, edges are selected when any connected extruded edges
were selected.
- Duplicate edges: Copied values of extruded edges.
- Face: Copied values of the corresponding selected faces.
- Corner: Copied values of corresponding corners in selected faces.
Individual Face Mode
- Vertex: Copied values of extruded vertices.
- Connecting edges (vertical): Average values of the two neighboring
edges on each extruded face. For booleans, edges are selected
when at least one neighbor on the extruded face was selected.
- Duplicate edges: Copied values of extruded edges.
- Face: Copied values of the corresponding selected faces.
- Corner: Copied values of corresponding corners in selected faces.
**Differences from edit mode**
In face mode (non-individual), the behavior can be different than the
extrude tools in edit mode-- this node doesn't handle keeping the back-
faces around in the cases that the edit mode tools do. The planned
"Solidify" node will handle that use case instead. Keeping this node
simpler and faster is preferable at this point, especially because that
sort of "smart" behavior is not that predictable and makes less sense
in a procedural context.
In the future, an "Even Offset" option could be added to this node
hopefully fairly simply. For now it is left out in order to keep
the patch simpler.
**Implementation**
For the implementation, the `Mesh` data structure is used directly
rather than converting to `BMesh` and back like D12224. This optimizes
for large extrusion operations rather than many sequential extrusions.
While this is potentially more verbose, it has some important benefits:
First, there is no conversion to and from `BMesh`. The code only has
to fill arrays and it can do that all at once, making each component of
the algorithm much easier to optimize. It also makes the attribute
interpolation more explicit, and likely faster. Only limited topology
maps must be created in most cases.
While there are some necessary loops and allocations with the size of
the entire mesh, I tried to keep everything I could on the order of the
size of the selection rather than the size of the mesh. In that respect,
the individual faces mode is the best, since there is no topology
information necessary, and the amount of work just depends on the size
of the selection.
Modifying an existing mesh instead of generating a new one was a bit
of a toss-up, but has a few potential benefits:
- Avoids manually copying over attribute data for original elements.
- Avoids some overhead of creating a new mesh.
- Can potentially take advantage of future ammortized mesh growth.
This could be changed easily if it turns out to be the wrong choice.
Differential Revision: https://developer.blender.org/D13709
|
|
This node can scale individual edges and faces. When multiple selected
faces/edges share the same vertices, they are scaled together.
The center and scaling factor is averaged in this case.
For some examples see D13757.
Differential Revision: https://developer.blender.org/D13757
|
|
Currently there is no way to flip normals in geometry nodes. This node
makes that possible by flipping the winding order of selected faces.
The node is purposely not called "Flip Normals", because normals are
derived data, changing them is only a side effect. The real change is
that the vertex and edge indices in the face corners of every selected
polygon are reversed, and face corner attribute data is reversed.
While there are existing utilities to flip a polygon and its custom
data, this node aims to process an attribute's data together instead
of processing all attributes separately for each index.
Differential Revision: https://developer.blender.org/D13809
|
|
This adds a new curve primitive to generate arcs.
Radius mode (default): Generates a fixed radius arc on XY plane
with controls for Angle, Sweep and Invert.
Points mode: Generates a three point curve arc from Start to End
via Middle with an Angle Offset and option to invert the arc.
There are also outputs for arc center, radius and normal direction
relative to the Z-axis.
This patch is based on previous patches
D11713 and D13100 from @guitargeek. Thank you.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D13640
|
|
This node allows accessing data of other elements in the context geometry.
It is similar to the Transfer Attribute node in Index mode. The main difference
is that this node does not require a geometry input, because the context
is used.
The node can e.g. be used to generalize what the Edge Vertices node is doing.
Instead of only being able to get the position of the vertices of an edge,
any field/attribute can be accessed on the vertices.
Differential Revision: https://developer.blender.org/D13825
|
|
Calculates the angle in radians between two faces that meet at an edge.
0 to PI in either direction with flat being 0 and folded over on itself PI.
If there are not 2 faces on the edge, the angle will be 0.
For valid edges, the angle is the same as the 'edge angle' overlay.
For the Face and Point domain, the node uses simple interpolation to calculate a value.
Differential Revision: https://developer.blender.org/D13366
|
|
This function node creates a running total of a given Vector, Float, or
Int field.
Inputs:
- Value: The field to be accumulated
- Group Index: The values of this input are used to aggregate the input
into separate 'bins', creating multiple accumulations.
Outputs:
- Leading and Trailing: Returns the running totals starting
at either the first value of each accumulations or 0 respectively.
- Total: Returns the total accumulation at all positions of the field.
There's currently plenty of duplicate work happening when multiple outputs
are used that could be optimized by a future refactor to field inputs.
Differential Revision: https://developer.blender.org/D12743
|
|
|
|
This commit adds a search menu when links are dragged above empty
space. When releasing the drag, a menu displays all compatible
sockets with the source link. The "main" sockets (usually the first)
are weighted above other sockets in the search, so they appear first
when you type the name of the node.
A few special operators for creating a reroute or a group input node
are also added to the search.
Translation is started after choosing a node so it can be placed
quickly, since users would likely adjust the position after anyway.
A small "+" is displayed next to the cursor to give a hint about this.
Further improvements are possible after this first iteration:
- Support custom node trees.
- Better drawing of items in the search menu.
- Potential tweaks to filtering of items, depending on user feedback.
Thanks to Juanfran Matheu for developing an initial patch.
Differential Revision: https://developer.blender.org/D8286
|
|
This node outputs the current scene time in seconds or in frames.
Use of this node eliminates the need to use drivers to control values
in the node tree that are driven by the scene time.
Frame is a float value to provide for subframe rendering for motion
blur.
Differential Revision: https://developer.blender.org/D13455
|
|
This node is a field input that outputs a separate index for each mesh island.
The indices are based on the order of the lowest-numbered vertex in each island.
Authoring help from @hooglyboogly
Differential Revision: https://developer.blender.org/D13504
|
|
Creates a new Edge Neighbors node which outputs a field
containing the number of faces connected to each edge.
Differential Revision: https://developer.blender.org/D13493
|
|
This adds a new Geometry to Instance node that turns every
connected input geometry into an instance. Those instances
can for example be used in the Instance on Points node.
Differential Revision: https://developer.blender.org/D13500
|
|
Creates 4 new nodes which provide topology information
for the mesh. Values are interpolated from the primary
domain in each case using basic attribute interpolation.
Vertex Neighbors
- Vertex Count
- Face Count
Face Neighbors
- Vertex Count
- Neighboring Face Count
Edge Vertices
- Vertex Index 1
- Vertex Index 2
- Position 1
- Position 2
Face Area
- Face Area
Differential Revision: https://developer.blender.org/D13343
|
|
This node calculates the dual of the input mesh. This means that faces
get replaced with vertices and vertices with faces. In principle this
only makes sense when the mesh in manifold, but there is an option to
keep the (non-manifold) boundaries of the mesh intact.
Attributes are propagated:
- Point domain goes to face domain and vice versa
- Edge domain and Face corner domain gets mapped to itself
Because of the duality, when the mesh is manifold, the attributes get
mapped to themselves when applying the node twice.
Thanks to Leul Mulugeta (@Leul) for help with the
ascii diagrams in the code comments.
Note that this does not work well with some non-manifold geometry,
like an edge connected to more than 2 faces, or a vertex connected to
only two faces, while not being in the boundary. This is because there
is no good way to define the dual at some of those points. This type
of non-manifold vertices are just removed for this reason.
Differential Revision: https://developer.blender.org/D12949
|
|
- Rename the Curve Parameter node to Spline Parameter.
- Add "Index on Spline" to the node. This output is the index of
the current point on it's parent spline rather than the entrire curve.
Differential Revision: https://developer.blender.org/D13275
|
|
The Domain Size node has a single geometry input and a selection for
the component type. Based on the component chosen, outputs containing
single values for the related domains are shown.
Mesh:
- Point Count
- Edge Count
- Face Count
- Face Corner Count
Curve:
- Point Count
- Spline Count
Point Cloud:
- Point Count
Instances:
- Instance Count
Differential Revision: https://developer.blender.org/D13365
|
|
These nodes allow accessing and changing the stable/random ID used
for motion blur with instances and stable randomness.
Since rB40c3b8836b7a, the stable ID is a built-in attribute, so to be
consistent and allow changing it in the node tree like other built-in
attributes, it has get and set nodes.
|
|
|
|
In future use cases, a volume can contain many grids that represent the
density information. In this case, it's better if the volume to mesh node
creates a mesh based on all of the grids in the volume.
This is also a benefit to share-ability, since one doesn't have to
specify the grid name in the node. Instead, in the future we can have
a way to split particular grids into separate volumes, if only one
grid should be considered.
The code changes are relatively simple:
- Move the old volume to mesh node to the legacy folder.
- Run the volume to mesh node on all instance geometry, like elsewhere.
- Make the blenkernel's volume to mesh API a bit more specific.
Differential Revision: https://developer.blender.org/D12997
|
|
This adds a new image texture node for geometry nodes. It does not
reuse the same node that is used in shading, because we want to be
able to expose the image and frame as sockets.
There is a known update issue when a movie or image sequence is
used. That will be fixed separately (also see D12957).
Currently, the image socket is just a pointer to an Image ID data block.
This can contain single images but also movies and image sequences.
In the future, the definition of an image socket can be expanded to
include images that are generated from scratch in the node tree.
For more details read the discussion in D12827.
Some of the code is a direct port from cycles and should be cleaned
up a bit in the future. For example `image_cubic_texture_lookup`.
For still images, the frame input is ignored. Otherwise, the frame
has to be in a valid range for the node to work. In the future we
may add e.g. automatic looping functionality.
Differential Revision: https://developer.blender.org/D12827
|
|
This node takes a geometry set with instances as input and outputs
points located on the origins of the top level of instances in the
geometry set (not nested instances). It also has position and radius
inputs to allow overriding the default, and a selection input to only
generate points for some instances.
The use case for this node is a method to use geometry proximity on
instance origins, but in a more generic way that is flexible and useful
in other situations.
Differential Revision: https://developer.blender.org/D12893
|
|
This commit adds an updated version of the curve to points that
supports fields. Only the position and radius are transferred
by default now, which should improve performance. The other outputs
like tangent and rotation are outputted with anonymous attributes.
I took the opportunity to change a few other small things:
- Name geometry sockets "Curve" and "Points" like other nodes.
- Remove the radius multiple of 0.1, which was confusing.
Thanks to @Johnny Matthews (guitargeek) for an initial patch.
Differential Revision: https://developer.blender.org/D12887
|
|
This patch includes an updated version of the raycast node that uses
fields instead of attributes for inputs instead of outputs. This makes
the node's UI much clearer. It should be faster too, since the
evaluation system for fields provides multi-threading.
The source position replaces the input geometry (since this node is
evaluated in the context of a geometry like the other field nodes).
Thanks to @guitargeek for an initial version of this patch.
Differential Revision: https://developer.blender.org/D12638
|
|
The Endpoint Selection node allows for the Selection of an aribitrary
number of endpoints from each spline in a curve. The start and end
inputs are evaluated on the spline domain. The result is outputted
as a boolean field on the point domain.
Differential Revision: https://developer.blender.org/D12846
|
|
Replaces the old Subdivision Surface Node.
Changes:
- Removes implicit instance realization, instead the node runs once
per unique instance.
- "Use Creases" becomes a crease field input applied to edges.
The values are clamped between zero and one.
Addresses T91763
Differential Revision: https://developer.blender.org/D12830
|
|
This commit adds an updated version of the old attribute transfer node.
It works like a function node, so it works in the context of a
geometry, with a simple data output.
The "Nearest" mode finds the nearest element of the specified domain on
the target geometry and copies the value directly from the target input.
The "Nearest Face Interpolated" finds the nearest point on anywhere on
the surface of the target mesh and linearly interpolates the value on
the target from the face's corners.
The node also has a new "Index" mode, which can pick data from specific
indices on the target geometry. The implicit default is to do a simple
copy from the target geometry, but any indices could be used. It is also
possible to use a single value for the index to to retrieve a single
value from an attribute at a certain index.
Differential Revision: https://developer.blender.org/D12785
|
|
This commit adds a fields version of the mesh to curve node, with a
field for the input selection. In order to reduce code duplication,
it adds the mesh to curve conversion to the new geometry module
and calls that implementation from both places.
More details on the geometry module can be found here: T86869
Differential Revision: https://developer.blender.org/D12579
|
|
This changes the edge split node to have a selection input, which is
more aligned with the other design changes. This loses the ability to
split edges based on an angle, but the edge angle can be added as a
field input node in the future, which will make for a much more
flexible system.
Differential Revision: https://developer.blender.org/D12829
|
|
Adds a node that can rotate each of a geometry's instances in global
(to the modifier object) or local space (of each point) by a specified
angle around a pivot point.
In the future, separating the local-global choice for the pivot and the
rotation might be useful. However, for now the node is kept simple.
Differential Revision: https://developer.blender.org/D12682
|
|
Adds a node that can scale a geometry's instances. With "Local" turned
on, the instance is scaled individually from the center point input,
while when local space is turned off, it's more like the transform
node, except it scales outward from the center point instead of only
from the origin.
Differential Revision: https://developer.blender.org/D12681
|
|
Adds a node that can translate instances in the transform space of
the modifier object, or the local space of their original transform.
One reason to have a special node for instances is that they always
have the existing transform, unlike mesh or point cloud points.
Differential Revision: https://developer.blender.org/D12679
|
|
Add Get/Set Nodes for Material Index
Rename Assign Material to Set Material
Differential Revision: https://developer.blender.org/D12837
|
|
This commit implements T91780, adding nodes to get and set builtin
attributes. Individual set nodes are used so that the values can be
exposed for direct editing, which is useful for attributes like shade
smooth and spline resolution. Individual input nodes are used to allow
reusing nodes for multiple components, and to allow grouping multiple
outputs conceptually in the same node in the future.
Input Nodes
- Radius
- Curve Tilt
- Curve Handle Positions
- Is Shade Smooth
- Spline Resolution
- Is Spline Cyclic
'Set' Nodes
- Curve Radius
- Point Radius
- Curve Tilt
- Curve Handle Positions
- Is Shade Smooth
- Spline Resolution
- Is Spline Cyclic
Using hardcoded categories is necessary to add separators to the node
menu.
Differential Revision: https://developer.blender.org/D12687
|
|
Delete Geometry:
This adds a copy of the old node in the legacy folder and updates the
node to work with fields. The invert option is removed, because it is
something that should be very easy with fields, and to be consistent
with other nodes which have a selection. There is also a dropdown to
select the domain, because the domain can't be determined from the
field input. When the domain does not belong on any of the components
an info message is displayed.
Separate Geometry:
A more general version of the old Point Separate node. The "inverted"
output is the same as using the delete geometry node.
Differential Revision: https://developer.blender.org/D12574
|
|
This node creates a boolean field selection of bezier spline points
that have a handle of the given type on the selected 'side' of the
contol point. This is evaluated on the point domain.
Differential Revision: https://developer.blender.org/D12559
|
|
This update of the Points to Volume node allows a field to populate the
radius input of the node and removes the implicit realization of
instances.
Differential Revision: https://developer.blender.org/D12531
|
|
This update of the Set Handle Type node allows for a bool field to be
used as the selection of the affected control point handles for
bezier splines. If no bezier splines are provided a info message is
shown.
Differential Revision: https://developer.blender.org/D12526
|
|
This update of the Set Spline Type node allows for a bool field to be
used as the selection of the affected splines.
Differential Revision: https://developer.blender.org/D12522
|
|
The Spline Length Input node provides a field containing the
length of the current evaluated spline to the Point and Spline
domains.
Differential Revision: https://developer.blender.org/D12706
|