Commit Graph

128230 Commits

Author SHA1 Message Date
Campbell Barton 224e623e3c Fix bf_animation_fcurves tests failing depending on preferences
User preferences could cause this test to fail,
tests should never read the users configuration.
2023-09-23 21:17:50 +10:00
Campbell Barton d4dbbab5d9 Cleanup: locate break statements inside the case body
Follow the convention used almost everywhere in Blender's code.
2023-09-23 21:17:50 +10:00
Pratik Borhade 90f22739f7 Fix #112650: UI: Missing Header Status in Node Editor after Turning off Auto-offset
Caused by 42f8b49581
When auto-offset is OFF, garbage characters was displayed due to
uninitialized string.

Pull Request: https://projects.blender.org/blender/blender/pulls/112657
2023-09-23 12:37:25 +02:00
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
Hans Goudey 652aab0b31 Fix: Swapped icons in node tool header popover 2023-09-22 20:51:34 -04:00
Hans Goudey 2cb34f7c0d UI: Improve geometry nodes tool popover layout
See #101778, #111524

Separate the layout into one popover for object types and another for
object modes. Use checkboxes with icons and full phrases like "Object
Mode". Also rename the modifier popover to "Modifier". Thought
it just has one option right now, so it looks quite weird.

---

![image](https://projects.blender.org/attachments/17e86c35-3c13-48e4-8113-817c5a80fdd3)
![image](https://projects.blender.org/attachments/f92a55a9-e4f0-4c29-8d15-a47a3154ed70)
![image](https://projects.blender.org/attachments/50cd0a93-0abb-4766-819b-62d265251822)

Pull Request: https://projects.blender.org/blender/blender/pulls/112749
2023-09-23 02:33:51 +02: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
Philipp Oeser 29dfb73eb7 Fix: bl_previews_render.py still using lamp.falloff_type
This was removed in 57d85b32a9.

Pull Request: https://projects.blender.org/blender/blender/pulls/112728
2023-09-22 17:17:05 +02:00
Ray Molenkamp 974bb38c51 CMake: Update platform_win32.cmake with webp 1.3 support
WebP 1.3 changed the library filenames to include a lib prefix and
added an additional library.
2023-09-22 08:59:03 -06: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
Ray Molenkamp 3735a4d104 deps_builder: Fix missing Webp support in OIIO build on windows
webp 1.3 changed the filenames on windows to include a `lib` prefix
(ie libwebp.lib rather than webp.lib) now this is a common thing
on linux and cmake has a `CMAKE_FIND_LIBRARY_PREFIXES` variable that
has a list of prefixes to look for during a `find_library` call.

`CMAKE_FIND_LIBRARY_PREFIXES` gets set during the call to the
`project` method in the main CMakeLists of a project. Now for windows
`lib` is *not* a common prefix by CMake, and it doesn't add "lib" to
CMAKE_FIND_LIBRARY_PREFIXES during that call.

so find library doesn't look for it, the libs are not found and an
unhappy time is had by all. Now the most obvious solution would be to
pass `-DCMAKE_FIND_LIBRARY_PREFIXES=lib` to CMake to sidestep this
however, the `project` call will set the variable overwriting
anything you passed through the CLI.

So the fix here is to have `find_library` counter-intuitively look
for both `libwebp` and `webp`
2023-09-22 08:47:23 -06:00
Ray Molenkamp af9523d7c2 deps_builder: OIIO validate deps at configure time
The last webp update changed the filenames of the webp libraries
on windows causing oiio not to find them and oiio silently build
without webp support, which only came to light after all of
blender was build and a test failed.

This change makes the OIIO validate and error out if certain
dependencies are not found at configure time so these mistakes
are caught early.
2023-09-22 08:32:26 -06: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
Alexander Gavrilov be7e2d01a8 Python: support the step and precision arguments in rna_idprop_ui_create.
Support the property settings that were implemented some time ago.

As an aside, change the defaults for min and max to integers: integer
values can be implicitly cast to float, but the reverse results in an
error. Also, pointer properties don't support a default value.

Pull Request: https://projects.blender.org/blender/blender/pulls/112712
2023-09-22 12:07:26 +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
Jeroen Bakker 7b379eb657 Cleanup: Make format 2023-09-22 08:32:03 +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 f13f61df98 GHOST/Wayland: follow SDL's method of XDG window initialization
Using SDL's initialization logic, this is mainly a change for XDG
as LIBDECOR already required a configure event before accessing
the underlying XDG window.

While I didn't notice functional changes with this change window
flickering on startup remains an issue with some compositors
(KDE & river). Debugging these issues is simpler when both windowing
decoration systems work in a similar way & window configuration
is guaranteed to have run before the window is returned.
(via #xdg_surface_ack_configure).
2023-09-22 12:43:22 +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