Commit Graph

346 Commits

Author SHA1 Message Date
Leon Schittek
db5d410164 Node Editor: add overlay to automatically label reroute nodes
Add an overlay option to automatically display a label on reroute nodes.

This automatic label is propagated through chained reroute nodes and
is based on the explicit label of linked reroute nodes.

The automatic label is dimmed to distinguish it from manually set ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/113368
2024-06-05 10:02:37 +02:00
Iliya Katueshenock
022620b490 Fix: Missing space in tooltip
Fix of change from e6ccff1044

Pull Request: https://projects.blender.org/blender/blender/pulls/122434
2024-05-29 14:05:54 +02:00
Lukas Tönne
1080a94a3d Geometry Nodes: Value logging for Volume geometry and Grid sockets
Volumes and grids were not yet handled by the Geometry Nodes value
logging system. This patch adds basic information (number of grids)
to the value logger and node tooltips.

Pull Request: https://projects.blender.org/blender/blender/pulls/121622
2024-05-28 12:05:58 +02:00
Omar Emara
0dca908191 Compositor: Add GPU per-node execution time report
This patch adds support for timing GPU compositor executions. This was
previously not possible since there was no mechanism to measure GPU
calls, which is still the case. However, since 2cf8b5c4e1, we now flush
GPU calls immediately for interactive editing, so we can now measure the
GPU evaluation on the host, which is not a very accurate method, but it
is better than having no timing information. Therefore, timing is only
implemented for interactive editing.

This is different from the CPU implementation in that it measures the
total evaluation time, including any preprocessing of the inputs like
implicit type conversion as well as things like previews.

The profiling implementation was moved to the realtime compositor since
the compositor module is optional.

Pull Request: https://projects.blender.org/blender/blender/pulls/122230
2024-05-28 08:13:46 +02:00
Damien Picard
b37d121e0a I18n: extract and disambiguate a few messages
Extract
- Add to Quick Favorites tooltip.
- "Mask", the name of a newly created mask (DATA_).
- "New" in the context of the new mask ID button.
- A few strings using BLI_STR_UTF8_ defines were not extracted.
  Take the special characters out of the translation macros.
- "External" menu items from the filebrowser's Files context
  menu (right-click on a file). These items were already extracted,
  but not translated.

Improve
- Separate formatted error message "%s is not compatible with
  ["the specified", "any"] 'refresh' options" into two messages.

Disambiguate
- Use Action context for new F-modifiers' names. This is already used
  for the "type" operator prop.
- Translate ImportHelper's default confirmation text using the
  Operator context, as it uses the operator name which is extracted
  with this context.
- "Scale" can be a noun, the scale of something, or a verb, to scale
  something. The latter mostly uses the Operator context, so apply
  this context to verbs, and the default contexts to nouns.
- "Scale Influence" can mean "Influence on Scale" (tracking
  stabilization) and "to Scale the Influence" (dynamic paint canvas).
- "Object Line Art" as type of Line Art to add, as opposed to the
  active object's Line Art settings.
- Float to Integer node: use NodeTree context for the node label, as
  this is already extracted and used for the enum.

Do not translate
- Sequencer labels containing only a string formatting field.

Some issues reported by Gabriel Gazzán and Ye Gui.

Pull Request: https://projects.blender.org/blender/blender/pulls/122283
2024-05-27 19:33:35 +02:00
Iliya Katueshenock
788b34649e Nodes: improve tooltip for extend-sockets
Display descriptive tooltip for this socket function in any editor.
In case of geometry nodes, there is no point to display info about
lack of value, so cleanup this.

Pull Request: https://projects.blender.org/blender/blender/pulls/121798
2024-05-24 11:39:08 +02:00
Jacques Lucke
399f6a1c60 Nodes: add descriptions for why links are invalid
Blender shows invalid links in red in the node editor. However, it's not always
obvious why some links don't work, especially for beginners. This patch adds
additional information for every invalid link on the node that it links to.

The following error messages are added:
* Invalid link because of missing implicit conversions.
* Link cycle in node tree.
* A link from a field to a socket that does not support fields.
* Using the same menu on multiple Menu Switch nodes.

Currently, there are some per tree-type special cases in the link validation code.
In the future, this should be moved to tree type specific callbacks.

Pull Request: https://projects.blender.org/blender/blender/pulls/121976
2024-05-23 14:31:16 +02:00
Jacques Lucke
0ce1c34e25 Fix #122051: crash when node overlay tooltip has allocated argument 2024-05-21 16:39:18 +02:00
Jacques Lucke
d1782f13c8 Nodes: show extra info tooltip when hovering over text
Previously, the tooltip was only shown when hovering over the icon.
2024-05-19 14:41:28 +02:00
Sergey Sharybin
727a90a0f1 Compositor: Make GPU compositor an official feature
Effectively, make GPU compositor available without need to enable
an experimental feature set.

The compositor device is now exposed in the Performance panel of
Render Buttons. It is also still available in the compositor's
N-panel, together with some other options which are more about how
editing works, and not exactly related to render performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/121398
2024-05-14 15:49:20 +02:00
Iliya Katueshenock
75d17b1db5 Cleanup: Move BKE_node to namespace
Move all header file into namespace.
Unnecessary namespaces was removed from implementations file.
Part of forward declarations in header was moved in the top part
of file just to do not have a lot of separate namespaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/121637
2024-05-13 16:07:12 +02:00
Iliya Katueshenock
73d75be5de Fix: Nodes: Don't show default value in reroute dummy tooltip
This is issue that was acsidentially introduced in 8e830a95de.

Pull Request: https://projects.blender.org/blender/blender/pulls/121689
2024-05-13 15:48:15 +02:00
Sergey Sharybin
7b4232e8aa Compositor: Move Execution Mode and Precision from bNodeTree to Scene
This allows to expose these settings in the Performance panel in the
render buttons. Also moves compositor-specific options away from the
generic node tree structure.

For the backwards-compatibility the options are still present in the
DNA for the bNodeTree. This is to minimize the impact on the Studio
which has used the GPU compositor for a while now. They can be
removed in a future release.

There is no functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/121583
2024-05-10 18:08:33 +02:00
Hans Goudey
e6ccff1044 Cleanup: Use fmt instead of stringstream for node tooltips 2024-05-09 09:35:02 -04:00
Jacques Lucke
6176e66636 Nodes: add node group description
This allows node groups to have a description that is shown in the add menu
or when hovering over the node header.

This new description is stored in `bNodeTree.description`. Unfortunately, it
conflicts a bit with `ID.asset_data.description`. The difference is that the latter
only exists for assets. However, it makes sense for node groups to have
descriptions even if they are not assets (just like `static` functions in C++ should
also be able to have comments). In some cases, node groups are also generated
by addons for a specific purpose. Those should still have a description without
being reusable to make it easier to understand for users.

The solution here is to use the asset description if the node group is an asset,
and to use `bNodeTree.description` otherwise. The description is synced
automatically when marking or clearing assets.

A side benefit of this solution is that appended node group assets can keep their
description, which is currently always lost.

Pull Request: https://projects.blender.org/blender/blender/pulls/121334
2024-05-08 11:25:00 +02:00
Jacques Lucke
18600e430c Geometry Nodes: show correct type in menu socket tooltips
Previously, menu sockets were sometimes shown as integers or strings
in socket tooltips. Now, they are always shown as "Menu" type. This also
changes how these values are logged. Previously, they were logged as
strings. Now, only the integer identifier is logged and the name is looked
up when drawing the tooltip.

Pull Request: https://projects.blender.org/blender/blender/pulls/121236
2024-05-05 09:30:02 +02:00
Campbell Barton
c0def6c93d Cleanup: spelling in comments 2024-04-27 11:58:02 +10:00
Bartosz Kosiorek
749433f20b UI: Add tooltips with node description to node titles
These were already displayed in the node add menu. But it can also be
useful to see node descriptions when opening existing projects.

Pull Request: https://projects.blender.org/blender/blender/pulls/119705
2024-04-26 16:29:46 +02:00
Iliya Katueshenock
fa66b52d0a Nodes: tooltips for value of dangling reroute node
Dangling reroute nodes have no source of value. For that reason, such reroute nodes
are ignored by geometry nodes. Other node systems still have to handle this case
more explicitly. To users this behavior generally makes sense, but it's also not completely
obvious. Now, there is a new tooltip when hovering over dangling reroute nodes that
mentions how those work.

Pull Request: https://projects.blender.org/blender/blender/pulls/120851
2024-04-25 10:48:06 +02:00
Iliya Katueshenock
8e830a95de Nodes: Add default socket value to tooltip of socket
Even if node is not used, socket value is still there.
This value can be placed in tooltip instead of evaluated one.

Pull Request: https://projects.blender.org/blender/blender/pulls/120497
2024-04-24 17:03:55 +02:00
Iliya Katueshenock
ed9921185a Geometry Nodes: more detailed socket tooltips for multi-input sockets
Tooltip for multi-input socket. This kind of inspection can help to
see what data are passed into a node. Any invalid, muted or dangling
link will not be taken into account. This feature reuse the already
existing tooltip formatting and just add column indentation in multi-line case.

Pull Request: https://projects.blender.org/blender/blender/pulls/104468
2024-04-22 19:48:57 +02:00
Iliya Katueshenock
0bd6279504 Nodes: Display node label for tooltips on a free reroute
It is not so informative to display `Input` (name of input socket)
tooltip for free reroute node. Instead, use label for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/120534
2024-04-11 19:16:07 +02:00
Iliya Katueshenock
9f89cc5072 Refactor: Nodes: Generate socket tooltips in more generic way
Split code to separate functions depending on the source of info for
socket inspection. Each function retrieves some optional string.
Collecting of result string is just loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/120496
2024-04-11 17:52:59 +02:00
Jacques Lucke
9a78d523b0 Fix: matrices were printed in transposed order in some tooltips 2024-04-11 17:27:24 +02:00
Iliya Katueshenock
4049309071 Fix: Geometry Nodes: GP3 component in tooltip without experimental option ON
Do not display this GP component in tooltip for some nodes which is support this.

Pull Request: https://projects.blender.org/blender/blender/pulls/120525
2024-04-11 15:21:04 +02:00
Iliya Katueshenock
a03c3d16d8 Fix: Ensure null terminator for TIP_ string
Make sure TIP_ function will be called for string with null terminator.

Pull Request: https://projects.blender.org/blender/blender/pulls/120524
2024-04-11 14:59:57 +02:00
Iliya Katueshenock
de6834e5c2 Cleanup: Unused argument
`ntree` is unused after 3357658c13

Pull Request: https://projects.blender.org/blender/blender/pulls/120495
2024-04-11 00:36:31 +02:00
Iliya Katueshenock
3357658c13 Cleanup: Nodes: Remove unnecessary socket tooltip check
There is no context in which socket can't have data to display in tooltip.
The most basic info is the name of the socket. Such tooltip can be even
for output Shader socket. If is there, socket tooltip can be built from
data of socket declaration. Description, constraints and so. Such as supported
components. At point socket was used in evaluation on CPU, there is value
to display. Any trivial types or statistic about them value. Fields can
have dependencies, which is also can be known from evaluated value.

Pull Request: https://projects.blender.org/blender/blender/pulls/120492
2024-04-11 00:21:34 +02:00
Harley Acheson
27c95da888 Refactor: Remove BLF _ex functions using default arguments
Remove all BLF "_ex" versions of functions by using default arguments.
These functions only differ by having an optional argument that can
return extra details about the result of the operation. This PR just
make these part of the main function as optional arguments with default
values - all nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/119994
2024-03-28 04:02:13 +01:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Leon Schittek
3d867af642 Fix #115899: Prevent transparent gaps on nodes
Add some padding to the different shapes used to draw nodes to
prevent transparent gaps between them.
Also improve positoning of the node's outline.

Pull Request: https://projects.blender.org/blender/blender/pulls/119001
2024-03-22 09:15:00 +01:00
Leon Schittek
5acf2984d4 Node Editor: Improve padding around buttons and sockets
Make the padding that is added above and below buttons and sockets
more consistent across nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118972
2024-03-22 09:09:47 +01:00
Jacques Lucke
68c5e35be1 Merge branch 'blender-v4.1-release' 2024-03-12 17:33:59 +01:00
Sean Kim
1982cad490 Fix: update comparator for std::sort for NamedAttribute
This PR applies a fix for the comparator being passed into std::sort to
avoid potential Mac / libc++ issues as seen in #119189

Pull Request: https://projects.blender.org/blender/blender/pulls/119385
2024-03-12 17:31:02 +01:00
Jacques Lucke
d6829fa7cc Merge branch 'blender-v4.1-release' 2024-03-11 19:49:34 +01:00
Jacques Lucke
9feb02e9ad Fix #113170: node editor background color affects node panel color
The offset `-15` that's passed to `UI_GetThemeColorShade4fv` is chosen so that the color
stays almost the same in the default theme.

Pull Request: https://projects.blender.org/blender/blender/pulls/119283
2024-03-11 19:47:52 +01:00
Jacques Lucke
55cda490ab Fix #119171: show node panels when they have ui even if they don't have sockets
Pull Request: https://projects.blender.org/blender/blender/pulls/119287
2024-03-11 14:08:59 +01:00
Hans Goudey
d29ce3d531 UI: Remove uiBut a1 and a2 values
Over the last couple years (!) UI buttons have moved to derived classes,
meaning we don't need to use the same "a1" and "a2" variables to store
different information. At this point, that information is set specifically
by internal UI code, or functions like `UI_but_*_set`.

These values are only set to their default 0 values now (or -1 in some
non-meaningful cases). This commit removes the values from buttons
and removes the remaining a1 and a2 arguments from the UI API.
2024-03-01 14:27:57 -05:00
Jacques Lucke
086b808671 Merge branch 'blender-v4.1-release' 2024-02-27 20:40:29 +01:00
Jacques Lucke
f65e6da101 Fix #118073: show exact integer representation in some cases in socket inspection
Without the extra precision, `fmt::format` rounds the resulting float to one with
fewer significant digits. This is generally nice, but not desired in this specific
case for consistency with the value stored in the socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/118797
2024-02-27 20:38:41 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Jacques Lucke
1f30f41af8 Geometry Nodes: align input and output sockets in simulation and repeat zone nodes
This changes the drawing of the zone nodes to align corresponding input
and output sockets. The resulting nodes are smaller and it's easier to see
how data is passed through them.

Drawing aligned sockets is already technically supported for quite a while
already, but we haven't used it so far. Using them for zone nodes seems to
provide benefits only. How we use aligned sockets in other nodes still has
to be discussed more.

This patch only changes run-time data. It doesn't affect what is written to
.blend files.

In the node declaration, aligned sockets are created by tagging a socket
so that it is aligned with the previous socket. This is a bit different from
what we had before where a single socket declaration would be used for
an input and output socket. I think the approach used here works better,
especially in a potential future scenario where the input and output socket
has a different type.

Pull Request: https://projects.blender.org/blender/blender/pulls/118335
2024-02-19 13:32:01 +01:00
Sergey Sharybin
a8a05ebba1 Compositor: Switch CPU compositor to Full-Frame
The tiled compositor code is mainly still around, which is only
expected to be a short-lived period. Eventually it will also be
removed.

The OpenCL, Group Buffers, and Chunk size options are already removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118010
2024-02-14 14:23:49 +01:00
Hans Goudey
1cfe9dd08c Geometry Nodes: Matrix socket type, attribute type, and initial nodes
Implements the design from #116067.
The socket type is called "Matrix" but it is often referred to as "Transform"
when that's what it is semantically. The attribute type is "4x4 Matrix" since
that's a lower level choice. Currently matrix sockets are always passed
around internally as `float4x4`, but that can be optimized in the future
when smaller types would give the same behavior.

A new "Matrix" utilities category has the following set of initial nodes"
- **Combine Transform**
- **Separate Transform**
- **Multiply Matrices**
- **Transform Direction**
- **Transform Vector**
- **Invert Matrix**
- **Transpose Matrix**

The nodes and socket type are behind an experimental flag for now,
which will give us time to make sure it's the right set of initial nodes.
The viewer node overlay doesn't support matrices-- they aren't supported
for rendering in general. They also aren't supported in the modifier interface
currently. But they are supported in the spreadsheet, where the value is
displayed in a tooltip.

Pull Request: https://projects.blender.org/blender/blender/pulls/116166
2024-02-13 18:59:36 +01:00
Bastien Montagne
5aaadebbe4 Cleanup: Make BKE_scene.h a full Cpp header. 2024-02-10 19:16:25 +01:00
Bastien Montagne
54618dbae3 Cleanup: Make BKE_global.h a Cpp header. 2024-02-10 18:25:14 +01:00
Bastien Montagne
45e7827898 Clenup: Move BLT headers to Cpp.
Noisy but fairly straight forward.
2024-02-09 18:59:42 +01:00
Sergey Sharybin
467a132166 Compositor: Implement per-node execution time report
Visually it is the same as the execution time implemented for the
geometry nodes, and it is to be enabled in the overlay popover.

The implementation is separate from the geometry nodes, as it is
not easy or practical to re-use the geometry nodes implementation.

The execution time is stored in a run-time hash, indexed by a node
instance key. This is similar to the storage of the mode preview
images, but is stored on the scene runtime data and not on the node
tree. Indexing the storage by key allows to easily copy execution
statistics from localized tree to its original version.

The time is only implemented for full-frame compositor, as for the
tiled compositor it could be tricky to calculate reliable time for
pixel processing nodes which process one pixel at a time.

Pull Request: https://projects.blender.org/blender/blender/pulls/117885
2024-02-09 10:19:24 +01:00
Jacques Lucke
e1ee422d12 Nodes: improve handling of deprecated nodes
In 4.1 we deprecate the `Rotate Euler` node in favor of the `Rotate Rotation`
node which uses the new rotation socket type. The node is not removed
(for now) because that would come with compatibility issues. More generally,
we'll likely run into the situation where nodes are deprecated more often in the
future, without actually removing them to keep compatibility. This patch improves
how such nodes are handled in the UI.

The patch does three things:
* Adds a new `Utilities > Deprecated` entry in the add node menu in geometry nodes.
* Moves search items which are deprecated to the bottom in the search results
  (currently, this only works in English, can be fixed in bcon3).
* Adds a new `bNodeType->deprecation_notice` that will result in a deprecation
  warning when the node is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/117905
2024-02-06 19:08:01 +01:00
Jacques Lucke
442429a97c BLI: support formatting StringRef with the fmt library
People were manually converting it to `std::string_view` in many places already.
It's easy enough to allow using `StringRef` directly by providing a `format_as` function.

Also see https://fmt.dev/latest/api.html#udt.

Pull Request: https://projects.blender.org/blender/blender/pulls/117788
2024-02-03 19:14:51 +01:00