264 Commits

Author SHA1 Message Date
Charlie Jolly
52ccb44501 Geometry Nodes: Add Brick Texture node
Port brick shader node to GN

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12783
2021-10-26 15:39:53 +01:00
Dalai Felinto
cfde1f9f3b Geometry Nodes: Keep Add menu sorted alphabetically 2021-10-25 15:14:40 +02:00
Jacques Lucke
039094c1ec Geometry Nodes: new Image Texture node
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
2021-10-25 13:03:57 +02:00
Erik Abrahamsson
dc2524eaae Geometry Nodes: Rename node "String Substring"
This patch renames the node "String Substring" to "Slice String"
to conform to the "verb first" naming convention.
Default length is also changed to 10 to make it easier for users
to understand what the node does.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D12931
2021-10-24 11:43:54 +02:00
Jarrett Johnson
3af597d16b Geometry Nodes: Add Instances to Points Node
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
2021-10-23 00:01:59 -05:00
Hans Goudey
2a7a8a04e3 Fix: Empty geometry nodes input menu with legacy nodes enabled
Caused by a misplaced comma at the end of a line in Python.
2021-10-22 22:35:27 -05:00
Dorian
781289e31f Geometry Nodes: add Boolean and Integer Input nodes
These nodes just output a single value of their respective types,
making it possible to control multiple inputs with the same value.

Differential Revision: https://developer.blender.org/D12932
2021-10-22 15:01:28 +02:00
Charlie Jolly
2537b32392 Geometry Nodes: Add Checker Texture
Port checker shader to GN

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12762
2021-10-20 16:45:35 +01:00
Hans Goudey
334a8d9b3e Geometry Nodes: Fields version of Curve to Points node
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
2021-10-20 10:25:49 -05:00
Erik Abrahamsson
a83b405a45 Geometry Nodes: Replace String node
This commit adds a node that can be used to find and replace strings
inside of the input string. One initial use case is to have an easier
way to add line breaks to strings to the string to curves node.

Differential Revision: https://developer.blender.org/D12721
2021-10-19 15:27:47 -05:00
Charlie Jolly
67dbb42236 Geometry Nodes: Add Wave texture node
Port shader wave texture node

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12733
2021-10-19 17:30:24 +01:00
Charlie Jolly
56bf34aa17 Geometry Nodes: Add Magic texture node
Port shader node magic texture

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12732
2021-10-19 17:18:33 +01:00
Hans Goudey
0a6cf3ed0c Geometry Nodes: Fields version of the raycast node
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
2021-10-19 09:01:39 -05:00
Jacques Lucke
cd36f59027 Cleanup: trailing whitespace 2021-10-19 15:30:46 +02:00
Charlie Jolly
729b2d026d Geometry Nodes: Add shader Musgrave texture node
Port shader node musgrave texture

Differential Revision: https://developer.blender.org/D12701
2021-10-18 14:24:14 +01:00
Johnny Matthews
1f51037676 Geometry Nodes: Endpoint Selection Nodes
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
2021-10-18 06:45:16 -05:00
Jarrett Johnson
88d295f952 Geometry Nodes: Updated Subdivision Surface Node
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
2021-10-15 15:12:04 -05:00
Hans Goudey
76f386a37a Geometry Nodes: Fields transfer attribute node
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
2021-10-15 14:09:08 -05:00
Charlie Jolly
104887800c Geometry Nodes: Add Voronoi Texture
Port shader Voronoi to GN

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12725
2021-10-15 15:28:20 +01:00
Charlie Jolly
d4f1bc5f39 Geometry Nodes: Port shader gradient texture node
Reviewed By: HooglyBoogly, JacquesLucke

Differential Revision: https://developer.blender.org/D12717
2021-10-15 15:03:21 +01:00
Johnny Matthews
cddda70618 Geometry Nodes: Merge Conflict Cleanup
Removing a line that remained from a merge.
2021-10-14 12:22:33 -05:00
Johnny Matthews
42a05ff6ea Geometry Nodes: Rename Nodes ID Names + Menu Org
Re-alphabetize the main add menu.

Rename Node ID Names:
FloatCompare => CompareFloats
AttributeCapture => CaptureAttribute
Boolean => MeshBoolean
CurveFill => FillCurve
CurveFillet => FilletCurve
CurveReverse => ReverseCurve
CurveSample => SampleCurve
CurveResmaple => ResampleCurve
CurveSubdivide => SubdivideCurve
CurveTrim => TrimCurve
MaterialReplace => ReplaceMaterial
MeshSubdivide => SubdivideMesh
EdgeSplit => SplitEdges

Differential Revision: https://developer.blender.org/D12865
2021-10-14 12:10:52 -05:00
Hans Goudey
17b8da7196 Geometry Nodes: Field version of mesh to curve node
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
2021-10-14 12:06:48 -05:00
Charlie Jolly
2341ca990c Geometry Nodes: Add White Noise texture
Port White Noise shader to geometry nodes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12719
2021-10-14 14:56:48 +01:00
Johnny Matthews
9ca567bc4e Geometry Nodes: Reorganize Add Menu
- Move Converters to 'From' menus
  - Create Instances Menu
  - Realphabetize the Curve Menu

  Differential Revision: https://developer.blender.org/D12860
2021-10-14 06:41:52 -05:00
Hans Goudey
366cea95c5 Geometry Nodes: Fields version of edge split node
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
2021-10-13 11:34:29 -05:00
Erik Abrahamsson
78445ebd5f Geometry Nodes: Rotate Instances Node
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
2021-10-13 09:42:10 -05:00
Erik Abrahamsson
6c11b320c4 Geometry Nodes: Scale Instances Node
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
2021-10-13 09:10:06 -05:00
Erik Abrahamsson
9d49fc2ba0 Geometry Nodes: Translate Instances Node
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
2021-10-13 09:02:29 -05:00
Johnny Matthews
24cc552cf4 Geometry Nodes: Material Index, Set Material
Add Get/Set Nodes for Material Index
Rename Assign Material to Set Material

Differential Revision: https://developer.blender.org/D12837
2021-10-13 08:41:35 -05:00
Hans Goudey
4b31a21bcd Geometry Nodes: Use a separator in the add menu input category
This can help separate the field inputs from the other nodes,
like some other categories.
2021-10-11 18:14:03 -05:00
Charlie Jolly
f7ef68514b Geometry Nodes: Add Color input node
Adds a color input node with picker.

Differential Revision: https://developer.blender.org/D12793
2021-10-11 23:43:01 +01:00
Johnny Matthews
c1b4abf527 Geometry Nodes: Add Nodes to Get/Set Built-in Attributes
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
2021-10-11 11:03:57 -05:00
Wannes Malfait
9c00486451 Geometry Nodes: Separate and Delete Geometry for fields
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
2021-10-11 08:38:02 -05:00
Jarrett Johnson
79425ed326 Geometry Nodes: Align Euler to Vector Node
This commit introduces the Align Euler to Vector function node which
rotates to a body into a given direction. The node replaces the legacy
"Align Rotation to Vector" node, which only worked on an attribute
named `rotation` internally. The "Euler" in the name is meant to make
it clearer that the rotation isn't interchangeable with a regular
vector.

Addresses T91374.

Differential Revision: https://developer.blender.org/D12726
2021-10-09 14:40:37 -05:00
Johnny Matthews (guitargeek)
2305f270c5 Geometry Nodes: Handle Type Selection Node Update
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
2021-10-03 15:01:30 -05:00
Johnny Matthews (guitargeek)
fb34cdc7da Geometry Nodes: Points to Volume Fields Update
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
2021-10-03 08:03:46 -05:00
Jarrett Johnson
c5c94e3eae Geometry Nodes: Add Rotate Euler Node
This commit introduces the Rotate Euler function node which modifies
an input euler rotation. The node replaces the "Point Rotate" node.

Addresses T91375.

Differential Revision: https://developer.blender.org/D12531
2021-10-02 20:04:45 -05:00
guitargeek
1476d35870 Geometry Nodes: Set Handle Type Node Field Update
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
2021-10-01 14:22:24 -05:00
guitargeek
1fb364491b Geometry Nodes: Set Spline Type Node Field Update
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
2021-10-01 11:59:29 -05:00
guitargeek
dc30a9087c Geometry Nodes: Spline Length Input Node
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
2021-10-01 09:58:49 -05:00
guitargeek
aae96176e8 Geometry Nodes: Curve Subdivide Node with Fields
The curve subdivide node can now take an int field to specify the
number of subdivisions to make at each curve segment.

Reviewed by: Hans Goudey
Differential Revision: https://developer.blender.org/D12534
2021-10-01 09:43:04 -05:00
Charlie Jolly
be70827e6f Nodes: Add Float Curve for GN and Shader nodes.
Replacement for float curve in legacy Attribute Curve Map node.

Float Curve defaults to [0.0-1.0] range.

Reviewed By: JacquesLucke, brecht

Differential Revision: https://developer.blender.org/D12683
2021-09-30 19:24:40 +01:00
Hans Goudey
9f0a3a99ab Geometry Nodes: Fields version of attribute proximity node
Add a fields-aware implementation of the attribute proximity node.
The Source position is an implicit position field, but can be
connected with a position input node with alterations before use.
The target input and mode function the same as the original node.

Patch by Johnny Matthews with edits from Hans Goudey (@HooglyBoogly).

Differential Revision: https://developer.blender.org/D12635
2021-09-28 15:21:36 -05:00
Johnny Matthews
85aac0ef6a Geometry Nodes: Field version of curve reverse node
The updated version has a selection input as a field
and does not realize instances implicitly.

Differential Revision: https://developer.blender.org/D12506
2021-09-28 13:53:20 -05:00
Jacques Lucke
95fca22bfe Geometry Nodes: Remove experimental option for fields
This enables fields as the official workflow for geometry nodes.
While many features are converted to use fields rather than the old
attribute workflow, many are not yet converted. In that case, the
unconverted nodes are still accessible with an experimental option.
In the coming weeks the rest of the nodes will be converted.

Differential Revision: https://developer.blender.org/D12672
2021-09-28 13:22:52 -05:00
Hans Goudey
262b211856 Geometry Nodes: Mesh Point Cloud Conversion Nodes
This commit adds nodes to do direct conversion between meshes and point
clouds in geometry nodes. The conversion from mesh to points is helpful
to instance once per face, or once per edge, which was previously only
possibly with ugly work-arounds. Fields can be evaluated on the mesh
to pass them to the points with the attribute capture node.

The other conversion, point cloud to mesh vertices, is a bit less
obvious, though it is still a common request from users. It's helpful
for flexibility when passing data around, better visualization in the
viewport (and in the future, cycles), and the simplicity of points.

This is a step towards T91754, where point clouds are currently
combined with meshes when outputing to the next modifier after geometry
nodes. Since we're removing the implicit behavior for realizing
instances, it feels natural to use an explicit node to convert points
to vertices too.

Differential Revision: https://developer.blender.org/D12657
2021-09-28 12:14:13 -05:00
Hans Goudey
f35ea668a1 Geometry Nodes: Move more nodes to legacy
- Curve to Points: Needs output sockets
- Curve Endpoitns: Needs the same output sockets
- Edge Split: Should have a selection input instead
- Subdivision Surface: Should not use "crease" implicitly
All new versions of these nodes should also not implicitly
realize instances.
2021-09-28 11:03:12 -05:00
Jacques Lucke
617954c143 Geometry Nodes: new Instance on Points node
This adds a new Instance on Points node that is a replacement
for the old Point Instance node. Contrary to the old node,
it does not have a mode to instance objects or collections
directly. Instead, the node has to be used with an Object/
Collection Info to achieve the same effect.

Rotation and scale of the instances can be adjusted in the node
directly or can be controlled with a field to get some variation
between instances.

The node supports placing different instances on different points.
The user has control over which instance is placed on which point
using an Instance Index input. If that functionality is used, the
Instance Geometry has to contain multiple instances that can are
instanced separately.

Differential Revision: https://developer.blender.org/D12478
2021-09-27 10:17:17 +02:00
Johnny Matthews
536f9eb82e Geometry Nodes: Random Value Node
This node replaces the deprecated Attribute Randomize node, populating
a vector, float, integer or boolean field with random values. Vector,
float, and integer have min/max settings, which are also field aware.
The boolean type has a probability value for controlling what portion
of the output should be true. All four types have a field seed input
which is implicitly driven by the index, otherwise, all values would
be the same "random" value.

The Random Float node is now deprecated like other nodes, since it is
redundant with this node.

Differential Revision: https://developer.blender.org/D12603
2021-09-24 14:03:42 -05:00