Commit Graph

102997 Commits

Author SHA1 Message Date
Campbell Barton d2c271ec84 CMake: use bf_io_ prefix for IO tests
This simplifies running built-in IO tests with:

  ctest -R bf_io_

Also use "bf_io_" prefix for the libraries since it was already used
by some and it's a useful hint the libraries are used for IO.
2023-09-23 20:22:19 +10:00
Harley Acheson 7c636c1702 Fix #112736: Don't do Subpixel AA if not Antialised
There should be no Subpixel AA if the user has deselected
"Anti-Aliasing". Render target FT_LOAD_TARGET_MONO is strongly
hinted to pixel grid and shouldn't be messed with.

Pull Request: https://projects.blender.org/blender/blender/pulls/112759
2023-09-23 01:32:49 +02:00
Hans Goudey e44932473a Fix: Improve button alignment of single value node group operator inputs
Animation decorators aren't used in the redo panel.
2023-09-22 15:33:45 -04:00
Hans Goudey 0e1aca735a UI: Rename "No Catalog" node assets menus to "Unassigned"
After discussion with module members, it was agreed that "Unassigned"
was better because the word is already used in the asset browser, and
because it sounds more natural.
2023-09-22 14:28:35 -04:00
Hans Goudey 70ffc7a2de Fix: Missing "Add Shortcut" for node group operator
The operator uses the relatively new "GEOMETRY_OT" prefix,
which wasn't handled in the function that finds a keymap for an
operator. To support this, choose the 3D View keymap depending
on the current mode for the geometry object types.
2023-09-22 14:28:35 -04:00
Harley Acheson 8e843920d4 Cleanup: Make format
Formatting changes resulting from Make Format
2023-09-22 09:56:26 -07:00
Harley Acheson 0dab5818d7 UI: Discrete Thumbnail Sizes for Menus
Allow menus to select thumbnail sizes in discrete steps.

Pull Request: https://projects.blender.org/blender/blender/pulls/112455
2023-09-22 18:49:01 +02:00
Hans Goudey f7eb7ced58 Fix: Crashes in geometry nodes group data-block polls
`geometry_node_asset_traits` can be null, that means none
of the flags are set.
2023-09-22 12:25:07 -04:00
Hans Goudey 0fbb958417 Geometry Nodes: Disable viewer node shortcut in tool context
The viewer node doesn't work for tools, this helps clarify that.
2023-09-22 11:59:01 -04:00
Harley Acheson 01c2f72f26 UI: Remove File Browser "small_size" Feature
Remove non-working feature that changes File Browser list view when the
thumbnails are smaller than 64x64.

Pull Request: https://projects.blender.org/blender/blender/pulls/112696
2023-09-22 17:47:42 +02:00
Hans Goudey 1c51f74cb4 Geometry Nodes: Filter data-block buttons for tools and modifiers
In the data-block selectors in the node editor and the header,
apply a few rules to increase the separation between tool and
modifier node groups.
1. The modifier accepts non-asset groups or assets marked
   as modifiers (created in the modifier context). Tool node groups
   cannot be used by modifiers.
2. The tool context can only edit node group assets marked as tools
   (created in the tool context).

When switching contexts, the node group is cleared if the state would
be invalid. The tool node group is still stored in the editor's "root node
tree" property. Since it isn't retrieved from the context, the pin button
is useless, so it isn't displayed in the tool mode.

See #101778, #111526.

Pull Request: https://projects.blender.org/blender/blender/pulls/112389
2023-09-22 17:45:00 +02:00
Sergey Sharybin 015bc7ca4d Light linking: Make list interface look more similar to other places
This change makes it so the list interface in the properties panels looks
closer to things like shape keys, vertex groups and so on: there are two
buttons to add selected objects to the collection and remove active item
from the collection, as well as the "extra" drop down menu.

The add operator adds selected objects to the light linking collection
using the Include policy. For the light linking it means that the objects
are added as receivers that receive the light, and for the shadow linking
it means that objects are added as blockers which cast shadow from the
light.

The communication of the active list element is done via context property
similar to how it was done before. The difference is that these properties
are set on a parent of the list layout, which makes it so they are inherited
by the layout hierarchy needed to place the Remove button.

Pull Request: https://projects.blender.org/blender/blender/pulls/112713
2023-09-22 17:44:25 +02:00
Julian Eisel 427bdc8dcf UI: Remove dead space between tree view items
Part of #107742.

There used to be a small margin between items since the layout feels a
bit crammed otherwise. But this meant the mouse could be between items,
with no item highlighted or reacting to interactions. This was
especially annoying when dragging over items for drag and drop: in
between items dropping wasn't possible, and the drag-tooltip would
disappear, causing notable flickering during motions over the tree view.

The view item is now slightly enlarged to keep a look that is not too
crammed, and still remove the space between items. Item highlights are
still drawn with a smaller height (matching the normal widget height),
since anything else looked odd to me.

This now feels quite consistent with similar UIs (e.g. File Browser list
view or the Outliner), even though we give the items a bit more space.
2023-09-22 17:34:11 +02:00
Hans Goudey b838c34afa Cleanup: Remove unused sculpt mask expand operator
The "mask expand" operator from 0083c96125 is not exposed in
the UI and is redundant with the addition of the more general "expand"
operator from 82e7032477. The latter commit even mentioned
that the first mask expand operator was made obsolete.

Pull Request: https://projects.blender.org/blender/blender/pulls/112726
2023-09-22 17:30:28 +02:00
Hans Goudey c6380d772c Fix: Debug build error after recent cleanup
Caused by 8954b70d49
2023-09-22 11:22:30 -04:00
Hans Goudey 5c9b628596 Fix: Extra period in menu descriptions 2023-09-22 11:20:15 -04:00
Leon Schittek 0edd60b4c7 Fix: UI: Don't show padding buttons in menus
Padding buttons are supposed to be invisible but were drawn like
regular menu items.

For the most part it doesn't make a difference, since most themes
use transparent menu items anyway.
But e.g. the "White" theme is using opaque menu items, which
would causes the padding button to overlap at the corner when
the roundness of the menu background is very high.

Pull Request: https://projects.blender.org/blender/blender/pulls/112731
2023-09-22 17:19:33 +02:00
Lukas Tönne 354915cf3c Nodes: revert the inline (pass-through) socket feature
Inlined sockets in the same vertical space are no longer supported.
This removes `input_output` socket declarations, the inlining feature in
node drawing, and the `Both` option for node group interface sockets.

Versioning code splits existing node group sockets into individual
sockets again. Unfortunately some links may get lost in versioning files
using the feature, because of an unnoticed bug: Socket identifiers have
to be unique in the node group items list but inlined input/output
sockets have the same identifier. This still works for most situations
because uniqueness is only required within input/output lists. Creating
proper unique identifiers will discard any link from the previous output
socket. This cannot easily be fixed without `after_linking` versioning
code, which should be avoided.

Pull Request: https://projects.blender.org/blender/blender/pulls/112560
2023-09-22 16:56:59 +02:00
Hans Goudey 2419acf756 Nodes: Move float values to "Value" node with link-drag-search
This was handled for other nodes in 9726e4a0ad, but the older
"Value" node stores its value differently, so that was left for later.

Pull Request: https://projects.blender.org/blender/blender/pulls/112722
2023-09-22 15:45:05 +02:00
Hans Goudey 8954b70d49 Cleanup: Small changes in node interface item addition
- Use `StringRef` over `StringRefNull`, since it handles `nullptr` in
  its constructor and gives more flexibility about the string's source.
- Change `const char *` to `StringRef` as well, for improved ergonomics
  and efficiency.
- Move `add_interface_socket_from_node` to a .cc file. It's not small
  or performance sensitive enough to be inlined.
- Avoid allocating empty strings for item descriptions.
- Allocate with `BLI_strdupn` to avoid unnecessary `strlen` calls.
- Move a bit more code into a proper namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/112721
2023-09-22 15:43:59 +02:00
Philipp Oeser 1b7d257ce5 Fix #112664: Expand face sets freeze when cursor is on mesh boundaries
Mistake/typo in f4505e7b0a (not actually setting the bit).

Pull Request: https://projects.blender.org/blender/blender/pulls/112706
2023-09-22 14:52:07 +02:00
Hans Goudey 7b597c2bef Cleanup: Add nodiscard to BitSpan and BitVector lookup methods
To avoid situations where `operator[]` is used but one forgets to type
`.set(...);`, like #112706.
2023-09-22 08:13:17 -04:00
Hans Goudey 8a9dad1f2c Cleanup: Remove unnecessary struct keyword from newly C++ headers
Also remove `void` in `(void)`.
2023-09-22 08:08:19 -04:00
Pratik Borhade bb39f4fa41 Fix #112441: Restore Key Map Item does not restore the active property
`Restore item` button is not resetting `active` property when keyitem is registered
as `inctive` by default. To fix this, clear `inactive` flag then use default keyitem's
flag to correctly restore the keyitem.

Pull Request: https://projects.blender.org/blender/blender/pulls/112497
2023-09-22 12:58:02 +02:00
Lukas Tönne 0d708cd68a Fix incorrect item position returned for items in the root panel
Sockets in the layout would always have position 0, which breaks
operators relying on the position for moving items.

Pull Request: https://projects.blender.org/blender/blender/pulls/112714
2023-09-22 12:18:14 +02:00
Philipp Oeser 8094309474 Fix: Changing theme color for recent additions doesn't save
affected were:
- VSE Transition color
- Enum Highlighting color

which missed version bumps from 5f0a8759b0 / a7ad0ad8fb.

Similar to 179c419115.

Pull Request: https://projects.blender.org/blender/blender/pulls/112615
2023-09-22 12:13:32 +02:00
Brecht Van Lommel 70ac1e5df1 Fix #112645: switching view transform unnecessarily resets look
AgX and Filmic have different looks in the configuration, but the looks
share the same UI name and purpose. So we can switch to the
corresponding look when switching view transforms.

Thanks to Yiming Wu for helping track down the problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/112686
2023-09-22 12:05:55 +02:00
Jason Fielder c9f44a2f9d EEVEE Next: Add info count for shader optimization jobs in progress
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/112533
2023-09-22 11:38:06 +02:00
Jacques Lucke dacb768cb6 Geometry Nodes: use lazy evaluation in repeat zone
The goal is to make the evaluation of repeat zones more efficient by making
use of the lazy-function evaluation system. Performance is improved in two ways:
* Unnecessary nodes are not evaluated anymore. E.g. if a repeat zone outputs two
  geometries but only one of those is actually used, the other one will not be
  computed anymore.
* Support evaluating different iteration indices at the same time on different threads.

It is possible that some uses of repeat zones become slower with this refactor,
especially when each iteration does very little work and there are a lot of iterations.
The old implementation was not optimized for this use case either but now there
is a bit more overhead constant overhead per iteration than before.

On the bright side, this change can result in some very significant speedups when
some computations can be skipped. See #112421 for some example setups.

There is one todo comment for adding back-links for socket usages. Properly linking
those up can result in better (shorter) life-times for anonymous attributes. Even without
that, performance is already better than before.

The implementation reuses the existing lazy-function graph system for the repeat
zone, by building a dynamically sized graph based on the number of iterations.

Building a lazy-function graph makes it possible to use the lazyness and multi-threading
features of the lazy-function graph executor. This is much easier than reimplementing
this behavior for repeat zones specifically (hence there was only single-threaded eager
execution before).

Pull Request: https://projects.blender.org/blender/blender/pulls/112421
2023-09-22 08:58:16 +02:00
Campbell Barton 94a8dafab0 BLI_string_cursor_utf8: assert the cursor isn't negative 2023-09-22 14:51:53 +10:00
Campbell Barton 7a4aa60d4e Fix word selection in the console failing past line end
Selecting a word when the cursor was past the line end wasn't working.
2023-09-22 14:40:44 +10:00
Campbell Barton 25179efb51 Fix word selection at the beginning & end of the string
Double-clicking on a works for 3D text & the Python console failed
when the cursor was at the very beginning or end of the string.
2023-09-22 14:30:48 +10:00
Campbell Barton a5cd497543 Console: add support for displaying tab-stops
Without this it was necessary to convert pasted text into spaces
for them to display properly.

Since tabs are a valid part of a string, it's incorrect to assume
tabs can always be expanded to spaces.

Pasted text and console output now display tabs properly,
the tab still uses spaces for indenting though.
2023-09-22 13:43:12 +10:00
Harley Acheson 18e07098ef UI: Support additional console text operations
Adds the ability to set text cursor position in the Console editor
by clicking with the mouse and many other expected operations such as
cut, select all & deselect on text entry.

Ref !108626
2023-09-22 13:36:29 +10:00
Campbell Barton 5fbcb4c27e Cleanup: remove spaces from commented arguments
Also use local enums for `MA_BM_*` in versioning code.
2023-09-22 12:21:18 +10:00
Hans Goudey 867f99c2af Cleanup: Move depsgraph headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/110816
2023-09-22 03:18:17 +02:00
Campbell Barton aba119e192 Cleanup: quiet CMake uninitialized variable warning, sort file lists 2023-09-22 11:04:25 +10:00
Campbell Barton 31aa6fa073 Cleanup: various non-functional C++ changes 2023-09-22 10:52:40 +10:00
Campbell Barton 4e46803e04 Docs: add warning regarding WM_redraw_windows 2023-09-22 10:02:05 +10:00
Campbell Barton 6a8fc659ba Cleanup: spelling in comments 2023-09-22 10:02:05 +10:00
Hans Goudey ef5e57bbff Cleanup: Move softbody.c to C++
See #103343.

We had attempted to move the file to C++ twice before but found failing
tests each time. To find the code with changed behavior between C and
C++, I temporarily added a header declaring all the functions and moved
them one by one. The problem ended up being one function's use of `exp`
which used floats instead of doubles in C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/112693
2023-09-22 00:34:17 +02:00
Harley Acheson f58f6d0338 UI: Replace UI Font with Inter Regular v3.19
Replace default UI font DevaVuSans with Inter Regular v3.19

Pull Request: https://projects.blender.org/blender/blender/pulls/112603
2023-09-21 22:44:07 +02:00
Harley Acheson a0b4ead737 BLF: Subpixel Positioning, Anti-aliasing, Hinting
Text output using subpixel positioning, subpixel anti-aliasing, and
typographically-correct hinting.

Pull Request: https://projects.blender.org/blender/blender/pulls/105441
2023-09-21 22:43:17 +02:00
Hans Goudey 89422a7719 Fix: Crash drawing node with null panel name
Don't call `strlen` on a null pointer.
2023-09-21 14:02:22 -04:00
Hans Goudey 72a33623e6 Cleanup: Sculpt: Use C++ threading API
Also remove unnecessarily parallelized loop that was just setting a
flag for every PBVH node.
2023-09-21 13:42:13 -04:00
Jeroen Bakker 805c58d9ec Fix 112641: OpenGL Shader Draw Parameter Workaround Broken
The workaround for shader draw parameters isn't working for OpenGL. The
reason is that it isn't looking for the correct attribute to attach the
buffer to.

This fixes the issue that all objects where drawn using the unit matrix when
starting blender with `--debug-gpu-force-workarounds`.

![image](/attachments/f05b712e-e3f2-4ad5-b098-7e9d01bc4ca4)

Fixes #112641

Pull Request: https://projects.blender.org/blender/blender/pulls/112668
2023-09-21 19:34:07 +02:00
Harley Acheson e7df63ca72 Revert "UI: File Loading Waiting Feedback"
This reverts commit 9173c142d6 as this can cause problems from scripts
and command-line.

Pull Request: https://projects.blender.org/blender/blender/pulls/112682
2023-09-21 18:48:07 +02:00
Brecht Van Lommel 13fac109d3 UI: support drawing buttons inside node panels
With a callback to node panels similar to the one for nodes. Used in the
Principled BSDF to place enums in the relevant panels.

Longer term we want to make enums into sockets, but even then there are
still potentially some types of buttons we want to have in panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/112591
2023-09-21 18:46:30 +02:00
Brecht Van Lommel 8e602d914b UI: draw node panels in material properties editor
The layout for this is not great but consistent with existing
collapse/expand functionality there. There are ideas to replace this
entire material properties drawing longer term, but for 4.0 it's
important to show the panels in some way.

Pull Request: https://projects.blender.org/blender/blender/pulls/112591
2023-09-21 18:46:30 +02:00
Brecht Van Lommel a4a5ac545c UI: shorten node socket labels when they start with the panel name
Shortening names based on context is something we do in the user
interface throughout Blender. This is a simple automatic mechanism to do
it for node panels as well, which significantly improves the Principled
BSDF layout.

We want the properties and sockets to be identifiable outside of the
panel contextcontent, for example in the animation editor, API docs, or
when exposing a single socket as a group input. So making the actual
name shorter is not an option.

Pull Request: https://projects.blender.org/blender/blender/pulls/112591
2023-09-21 18:46:30 +02:00