Commit Graph

4137 Commits

Author SHA1 Message Date
Bastien Montagne
86fb43d57a Merge commit '2d703e9200985122b4b953be67b452f7679bf113'
Conflicts:
	source/blender/nodes/NOD_node_declaration.hh
2023-10-12 18:56:12 +02:00
Damien Picard
2d703e9200 I18n: add label declaration to node sockets so they can be shortened
In !112591, nodes got the ability to group sockets into panels. The
labels for these sockets are automatically shortened if they begin
with the same text as their parent labels. For instance, "Transmission
Weight" will be shortened to just "Weight" because it is under the
"Transmission" panel.

While this is a good heuristic for English, it breaks down in
languages which do not have the same word order.

This commit adds a `.short_label()` callback to socket declarations so
that a shortened label can be explicitly declared.

It also adds two regexps to the translation script so that these new
fields can be extracted to the .po translation files. One extracts the
label with a translation context, the other without. Only the one
without context is currently in use.

The current automatic shortening logic is kept and will be used only
if a shortened label is not manually provided.

Fixes #112970: Node socket labels under panels are not shortened when
translated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113070
2023-10-12 17:51:37 +02:00
Dalai Felinto
2d9ea10892 GPv3: Curve Fill node
Note, at first this seems to not be working, but it is because the
default grease pencil geometry all on the XZ axis.

Rotating the geometry in X 90 degrees shows the mesh.

Part of #113602.
Reviewed on !113614.
2023-10-12 17:30:15 +02:00
Harley Acheson
651d6eb229 Cleanup: Make format
Formatting changes resulting from Make Format
2023-10-12 08:04:53 -07:00
Falk David
faa24698a5 GPv3: Implement expanding of Grease Pencil component in the spreadsheet
This patch adds the ability for users to expand the grease pencil component in the spreadsheet and see the values for each `CurvesGeometry` in each layer.

It also makes it so that all the geometry components can be expanded for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/113507
2023-10-12 16:51:44 +02:00
Falk David
49b21eba11 GPv3: Support crazyspace in selection code
This adds `GreasePencilEditHints` and correctly implements
`crazyspace::get_evaluated_grease_pencil_drawing_deformation`
to support querying the deformation of points after evaluation.
This is needed for users to properly select points in edit mode while
seeing the effects of the modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/113586
2023-10-12 15:42:04 +02:00
Falk David
43a60ca38e GPv3: Transform Geometry node
Reviewed as part of !113598.
2023-10-12 14:38:42 +02:00
Dalai Felinto
f88c2b6c46 GPv3: Curve Trim node
Original patch (!113444) by Falk David with changes by me.

Reviewed as part of !113598.
2023-10-12 14:38:42 +02:00
Dalai Felinto
da2877f401 GPv3: Curve Length node
Original patch (!113444) by Falk David with changes by me.

Reviewed as part of !113598.
2023-10-12 14:38:42 +02:00
Dalai Felinto
d7fbd92ca7 GPv3: Blur Attribute node
Original patch (!113444) by Falk David with changes by me.

Reviewed as part of !113598.
2023-10-12 14:38:42 +02:00
Falk David
c620b0b00e GPv3: Domain Size node
Reviewed as part of !113598.
2023-10-12 14:38:42 +02:00
Hans Goudey
20d8f27ed2 Geometry Nodes: Add default input option for node groups
In order to recreate the behavior of some builtin nodes
which have implicit inputs for ID/Index or positions, provide
a hard-coded list of default/unconnected fields for sockets.

The point is to let assets recreate the behavior of builtin
nodes in a simple way that's easy to change in the future if
this becomes a more generalized feature. A hardcoded list
makes this predictable and simple in the meantime.

When the option is set to something besides "Default Value"
it overrides the "Hide Value" option. Otherwise the default
input would conflict with the visible default value button.

This makes it possible to add #109846 as an asset in the
essentials bundle. The design is meant to be easily
extendable for shader nodes, though that isn't included
in this commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/113175
2023-10-12 14:04:44 +02:00
Falk David
f43426f0de GPv3: Rename layer domain to just "Layer"
We had a short discussion on this change. "Grease Pencil Layer" is
just a bit too long, especially in the UI. Even though "Layer" might be
ambiguous, it shouldn't be in the context of geometry nodes. There are
currently no other "Layers" and if there were, using the same domain
name could be fine (just like we reuse the point domain for e.g. vertices
in meshes and control points in curves).

This also renames the internal enum to `ATTR_DOMAIN_LAYER`

Pull Request: https://projects.blender.org/blender/blender/pulls/113589
2023-10-12 13:54:32 +02:00
Omar Emara
405ec79a0a Fix #112883: GPU compositor crops viewed image
The GPU compositor crops the viewed images to the render resolution.
While the original size and content of the input to the viewer should be
retained as is.

This patch fixes that by specializing compositors that can use composite
outputs to be able to view images of any arbitrary size. This is still
missing the translation offset of the viewer, but this shall be tackled
separately.
2023-10-12 14:03:12 +03:00
Falk David
8086293989 Cleanup: Missing BKE_grease_pencil.hh header 2023-10-12 12:53:00 +02:00
Dalai Felinto
8e5f1e3d9f Fix tag used for Grease Pencil Resample Curve
Issue introduced as part of 3f13471d65.
2023-10-12 12:47:59 +02:00
Dalai Felinto
64f1ee14d8 GPv3: Subdivide Curve node
Reviewed as part of !113581.
2023-10-12 12:25:39 +02:00
Dalai Felinto
3f13471d65 GPv3: Resample Curve node
Reviewed as part of !113581.
2023-10-12 12:25:39 +02:00
Dalai Felinto
87e03b3f97 GPv3: Set Curve Radius node
Reviewed as part of !113581.
2023-10-12 12:25:39 +02:00
Dalai Felinto
9e9fae7ec0 GPv3: Separate Components node
Reviewed as part of !113581.
2023-10-12 12:25:39 +02:00
Omar Emara
e592763940 Realtime Compositor: Immediately realize transformations
This patch immediately realizes the scale and rotation components of
transformations at the point of transform nodes. The translate component is
still delayed and only realized when really needed to avoid clipping.

Transformed results are always realized in an expanded domain that avoids
clipping due to rotation or scaling. The size of the transformed domain is
clipped to the GPU texture size limit for now until we have support for huge
textures, that limit is typically 16k.

A potential optimization is to join all consecutive transform and realize
operations into a single realize operation.

Fixes #112332.

Pull Request: https://projects.blender.org/blender/blender/pulls/112332
2023-10-12 11:04:50 +02:00
Sergey Sharybin
79dc2c7672 Merge branch 'blender-v4.0-release' 2023-10-11 19:12:12 +02:00
georgiy.m.markelov@gmail.com
782c9273cd Fix Hydra MaterialX error with default materials
Pull Request: https://projects.blender.org/blender/blender/pulls/113541
2023-10-11 19:10:16 +02:00
Hans Goudey
30574bd8a9 Merge branch 'blender-v4.0-release' 2023-10-11 16:51:50 +02:00
Hans Goudey
50ed14f228 Fix: Set selection node crashes with attributes on the wrong domain
Remove the selection attributes on the non-selected domains, since they
will be automatically filled by domain interopolation anyway. Arguably
this should be fixed in a more general way, either by ensuring they are
always on the expected domains or more gracefully handling the case
when they aren't at a lower level. But for this node, for now this is
a simpler approach.
2023-10-11 16:51:32 +02:00
Falk David
559c271a53 Clang-format 2023-10-10 16:59:56 +02:00
Falk David
3931a54e08 GPv3: Initial Geometry Nodes support
This implements the core changes for this design: https://devtalk.blender.org/t/grease-pencil-integration-into-geometry-nodes/31220

The changes include:
* Add `CustomData` for layer attributes
* Add attribute support for the `GreasePencilComponent` to read/write layer attributes. Also introduces a `Layer` domain.
* Implement a `GreasePencilLayerFieldContext` and make `GeometryFieldContext` work with grease pencil layers.
* Implement `Set Position` node for `Grease Pencil`.

Note: These changes are only accessible/visible with the `Grease Pencil 3.0` experimental flag enabled.
Co-authored-by: Jacques Lucke <jacques@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/112535
2023-10-10 16:49:30 +02:00
Jacques Lucke
d5d6da2b1c Cleanup: add comment for why lazy threading hint is send 2023-10-10 12:23:07 +02:00
Omar Emara
203559757a Compositor: Allow variable size Kuwahara
This patch changes the size property of the Kuwahara into a node socket
to allow variable size Kuwahara.

Pull Request: https://projects.blender.org/blender/blender/pulls/112946
2023-10-10 10:10:18 +02:00
Hans Goudey
8f27baf388 Merge branch 'blender-v4.0-release' 2023-10-09 23:54:43 +02:00
Hans Goudey
976eaae02f Cleanup: Move BKE_object.hh to C++
Simplifies the fix to #111120, where the object bounds functions
may return a C++ type instead of `BoundBox`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113462
2023-10-09 23:41:53 +02:00
Miguel Pozo
2bafffd9f0 EEVEE Next: Expose Thickness output 2023-10-09 13:30:21 +02:00
Jacques Lucke
63b39c5aeb Merge branch 'blender-v4.0-release' 2023-10-09 11:46:45 +02:00
Jacques Lucke
fbfeb24588 Fix #113416: never show inspection index warning when set to zero 2023-10-09 11:45:25 +02:00
Jacques Lucke
5830316681 Nodes: use better default for color sockets
Using a fully transparent black is default never was an explicit decision.
Now the default is a light grey, that we use in many nodes already.
2023-10-08 15:25:07 +02:00
Jacques Lucke
1ecc315d34 Nodes: pass node declaration builder to dynamic declaration function
Generally, one should use the declaration builder instead of trying to
do it manually which is more error prone and verbose.
2023-10-08 14:38:28 +02:00
Jacques Lucke
0b3daea393 Geometry Nodes: use declaration builder for simulation zone 2023-10-08 14:14:22 +02:00
Jacques Lucke
b6a3ac5a12 Geometry Nodes: use declaration builder for repeat zone 2023-10-08 13:58:22 +02:00
Jacques Lucke
f3a1dd1eb5 Nodes: move socket declaration methods to base declaration builder
The goal here is to make it easier to use the socket declaration builder
for cases where the actual socket type is not known at compile time.
For that purpose, all the methods that are not dependent on the specific
socket type are moved to the base socket declaration builder.

A nice side effect of this is reduced templated boilerplate and that more
code can be moved out of the header.

With this patch, one is now forced to put type specific method calls before
generic method calls in a chain. For example `.default_value(...).supports_field()`
instead of `supports_field().default_value(...)`. In theory, we could keep
support for both orders but that would involve a lot of additional boilerplate
code. Enforcing this order is simple enough. Note that this limitation only
applies when chaining multiple method calls. This is still possible:
```
auto &decl = b.add_input<decl::Vector>("Value");
decl.supports_field();
decl.default_value(...);
```

Pull Request: https://projects.blender.org/blender/blender/pulls/113410
2023-10-08 13:30:31 +02:00
Jacques Lucke
29d4779bf9 Merge branch 'blender-v4.0-release' 2023-10-07 23:19:41 +02:00
Jacques Lucke
331247fcee Fix: don't set repeat zone output twice 2023-10-07 23:14:04 +02:00
Hans Goudey
36b88bc041 Merge branch 'blender-v4.0-release' 2023-10-07 09:08:37 -04:00
Hans Goudey
e59a2b9a21 Fix: Incorrect rotation from 3D cursor tool node
The 3D cursor's quaternion and euler storage are not always in sync.
The quaternion rotation should be retrieved by speciffic functions,
which I had previously missed.
2023-10-07 09:08:06 -04:00
Campbell Barton
cf7e0c205f Cleanup: sort CMake file lists 2023-10-07 18:29:46 +11:00
Jacques Lucke
144a5aa512 Cleanup: replace use of std::iota with more specific function
`iota` is name that has no meaning, it's not an acronym or initialism.
It's usually very cryptic when I come across it. Replacing it with a
specialized function makes the code more readible.
2023-10-06 23:01:16 +02:00
Jacques Lucke
bef0d6c067 Functions: extract remapped-params to make it reusable
This idea is of remapping parameters of lazy-functions is useful
not only for the repeat zone. For example, it could be used for the
for-each zone as well.

Also, moving it to a more general place indicates that there is no
repeat-zone specific stuff in it.
2023-10-06 22:32:51 +02:00
Jacques Lucke
d6f4a9a09b Merge branch 'blender-v4.0-release' 2023-10-06 18:38:07 +02:00
Jacques Lucke
b04f006a4c Fix: dynamic node declaration is not resetting update-skip flag 2023-10-06 18:37:46 +02:00
Jacques Lucke
57e914fc8a Cleanup: move join geometry functionality to separate file
This allows us to reuse the functionality more easily.
2023-10-06 18:31:44 +02:00
Jacques Lucke
6279be4157 Geometry Nodes: use socket name instead of identifier as debug names
This makes it easier to read generated lazy-function graphs, especially when
there are zones or group nodes, because the socket identifiers on those
are some generated internal name.
2023-10-06 18:31:44 +02:00