Commit Graph

103767 Commits

Author SHA1 Message Date
Jeroen Bakker
159e798cdb Vulkan: Add Viewport Array/Layer Workarounds
This PR adds workarounds for platforms that don't support `shaderOutputLayer`
or `shaderOutputViewportIndex`. Some NVIDIA laptop GPUs and ARM GPUs don't
have those device features.

The workaround uses the same approach as OpenGL. A geometry shader is injected
to emulate the feature.

For testing the workarounds they have also been connected to the
`--debug-gpu-force-workarounds` command line argument.

Fixes #113475 by implementing #113529

Pull Request: https://projects.blender.org/blender/blender/pulls/113605
2023-10-13 10:40:11 +02:00
Jacques Lucke
0d83083f29 Merge branch 'blender-v4.0-release' 2023-10-13 10:01:26 +02:00
Jacques Lucke
a9bf212de0 Fix #113563: prioritize main group length in string search
For node search that means that shorter matching node names
are moved further to the top, even if the entire search result is longer
because it is in a deeper menu.

This also more closely resembles how the search worked in Blender 3.6
where the menu path was not included in the search.
2023-10-13 09:59:21 +02:00
Hans Goudey
3e81f66998 Cleanup: Use C++ arrays for SculptUndoNode
Significantly reduce the amount of manual memory management by
replacing owning pointers with `blender::Array`. This also simplifies
counting the size of the undo steps and iterating over the array values
in some cases.
2023-10-13 09:44:35 +02:00
Campbell Barton
91c5eca81f Fix crash dragging images into the animation player
Resolve issues with the animation player drag & drop.

- IMB_exit ran before attempting to load the dropped image,
  crashing when the image was loaded.
- The old event consumer wasn't removed from the system
  causing events to be processed that accessed freed stack memory.
2023-10-13 17:51:53 +11:00
Campbell Barton
51467b0611 Fix crash dragging images into the animation player
Resolve issues with the animation player drag & drop.

- IMB_exit ran before attempting to load the dropped image,
  crashing when the image was loaded.
- The old event consumer wasn't removed from the system
  causing events to be processed that accessed freed stack memory.
2023-10-13 17:49:36 +11:00
Campbell Barton
9306bb9084 Merge branch 'blender-v4.0-release' 2023-10-13 17:32:51 +11:00
Jeroen Bakker
4cedbb9cb7 Fix #113310: Python gpu.state.scissor_test_set Not Updating State
When using scissor_test_set the framebuffer wasn't marked dirty and
would not always translate the start to actual driver commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/113642
2023-10-13 07:44:11 +02:00
Campbell Barton
08e5f94a70 Fix #113309: Broken key-map after "Reload Scripts"
Regression caused by [0]. Resolve by adding a 'keep_properties' argument
to KeyConfig.update so the key-map items can be restored after the
operators have been reloaded.

[0]: 88a875ec3a
2023-10-13 14:37:48 +11:00
Campbell Barton
604c0d8d5c Cleanup: add "_data" suffix to wm_keymap_item_free
Clarify that the wmKeyMapItem it's self isn't freed.
2023-10-13 14:37:48 +11:00
Campbell Barton
63586d0f6b Fix #113309: Broken key-map after "Reload Scripts"
Regression caused by [0]. Resolve by adding a 'keep_properties' argument
to KeyConfig.update so the key-map items can be restored after the
operators have been reloaded.

[0]: 88a875ec3a
2023-10-13 14:37:07 +11:00
Campbell Barton
60a17fae47 Cleanup: add "_data" suffix to wm_keymap_item_free
Clarify that the wmKeyMapItem it's self isn't freed.
2023-10-13 14:20:29 +11:00
Campbell Barton
845f7f6d44 Cleanup: move AudaSpace members into their own struct
Avoid having common terms like 'source' as static variables.
2023-10-13 12:10:10 +11:00
Campbell Barton
432bef802f Cleanup: use early returns in wm_window_title
Also avoid unnecessary std::string creation.
2023-10-13 11:22:01 +11:00
Campbell Barton
c0333b811e Merge branch 'blender-v4.0-release' 2023-10-13 10:57:20 +11:00
Campbell Barton
aebb32748e Fix UB issue calculating the frame duration for images with FFMPEG
AVFormatContext::duration was used without checking it was set,
calculations for the frame-rate cast -INT64_MAX to a double,
scaled it then cast to an integer - overflowing.
On my system the result was a negative number so the duration was never
usable in practice.

Add an explicit check for this so the duration is left at zero instead.
2023-10-13 10:55:47 +11:00
Campbell Barton
3488533ac3 Merge branch 'blender-v4.0-release' 2023-10-13 10:31:50 +11:00
Campbell Barton
e86fbcd4f0 Merge branch 'blender-v4.0-release' 2023-10-13 10:31:44 +11:00
Campbell Barton
df108825c0 Fix subtle path handling bugs caused by recent changes to the title
Resolve issues with corner-cases introduced by [0].

- Comparing the filename & filepath was no longer a valid way to check
  for a directory component since the extension was stripped.
- Use BLI_path_extension_or_end which doesn't confuse extensions with
  the dot from hidden files.

The variable name include_directory was also misleading.

[0]: 1a648f5b22
2023-10-13 10:29:55 +11:00
Campbell Barton
fb58aa5900 Cleanup: typos, duplicate words 2023-10-13 10:21:06 +11:00
Harley Acheson
4320f1a217 Merge branch 'blender-v4.0-release' 2023-10-12 11:56:24 -07:00
Harley Acheson
1c4b2ad17f Fix #113352: UI: Round Pen When Subpixel AA is Off
Testing to see if rounding the advancing pen seems to give slightly
nicer spacing when subpixel anti-aliasing is turned off.

Pull Request: https://projects.blender.org/blender/blender/pulls/113399
2023-10-12 20:54:54 +02:00
Harley Acheson
3c4f84e0fc UI: Input Placeholders
Optional inline hint describing the expected value of an input field.

Pull Request: #112104
2023-10-12 11:44:08 -07:00
Harley Acheson
70af02e0dd Cleanup: Make format
Changes resulting from Make Format
2023-10-12 10:38:12 -07:00
Harley Acheson
9071ed6a7f Cleanup: Make format
Changes resulting in Make Format
2023-10-12 10:35:19 -07:00
Harley Acheson
2c7d15b19c Merge branch 'blender-v4.0-release' 2023-10-12 10:33:29 -07:00
Bastien Montagne
5cf3654d9d Fix USD Export crash with complex scenes, due to race condition during depsgraph building.
Building the depsgraph from non-main thread is unsafe currently, as it
may trigger some deferred processing on the Main data itself (here, the
update/resync of viewlayer collections).

So this commit moves the building of the export depsgraph back into the
main thread for the USD exporter, while keeping the depsgraph evaluation
code (which is typically the heavy part with complex scenes) into the
threaded job worker code.

Issue was randomly (but fairly commonly) reproducible when trying to export
most of the Pets project production files (on linux debug build with ASAN).

Root issue has been reported and is being discussed in #112534, ideally a
better solution can be designed at depsgraph level in the future.

NOTE: Should likely also be back-ported to 3.6 and 3.3 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/113537
2023-10-12 19:10:37 +02:00
Bastien Montagne
86fb43d57a Merge commit '2d703e9200985122b4b953be67b452f7679bf113'
Conflicts:
	source/blender/nodes/NOD_node_declaration.hh
2023-10-12 18:56:12 +02:00
Julian Eisel
dab7ac1739 Refactor: Make drop-box callbacks more general, not drawing specific
These callbacks were named for the purpose of drawing (and that's probably
their main use case still), but nothing limits them to be used for that only.
They can be useful for non-drawing related things, essentially they act as
drop-box entering and exiting event handlers. Reflect that in the name, so also
more clear when they will be called, as opposed to what they are typically used
for. Drop-boxes already have such event handler callbacks, this makes their API
naming more consistent.
Also better differentiates between drawing and handling callbacks, the
difference matters (attempting to draw during handling won't work).
2023-10-12 18:39:24 +02:00
Harley Acheson
b688414223 UI: Type To Search And Space Bar Search
Continue allowing spacebar search for all dropdown and context menus,
but also add the ability to allow some menus to have type to search,
like Add Modifiers, Objects, Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113520
2023-10-12 17:54:59 +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
Christoph Lendenfeld
7be1b59daa Refactor: keyframing_auto.cc code cleanup
No functional changes

Clean up code by
* moving variables closer to their use
* inverting "if" for early returns
* using the enum type instead of int

Pull Request: https://projects.blender.org/blender/blender/pulls/113617
2023-10-12 17:45:16 +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
Julian Eisel
8a5aacfdaa Refactor: Store view item in the view item drop target
Avoids repeated and redundant lookups. Also simplifies some code.

Note that currently, these drop targets are volatile objects created whenever
needed, but not kept in memory. Should they ever be kept over multiple redraws,
this view item reference will have to be updated for each.
2023-10-12 17:15:33 +02:00
Harley Acheson
651d6eb229 Cleanup: Make format
Formatting changes resulting from Make Format
2023-10-12 08:04:53 -07:00
Harley Acheson
56aa7f58e9 Merge branch 'blender-v4.0-release' 2023-10-12 07:58:44 -07:00
Harley Acheson
1a648f5b22 UI: Window Title Blender Path Changes
Do not show extension of initial name, and include full file name
in the path section.

Pull Request: https://projects.blender.org/blender/blender/pulls/113560
2023-10-12 16:56:56 +02: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
Christoph Lendenfeld
3792c2720d Refactor: remove ED_ prefix from autokeying functions
No functional changes

Since the functions now live in a namespace,
they no longer need the prefix

as a result there are now 2 functions named
`autokeyframe_object`
which is fine because they take different parameters

If both are needed is for a future patch to investigate

Pull Request: https://projects.blender.org/blender/blender/pulls/113612
2023-10-12 16:32:29 +02:00
Christoph Lendenfeld
1f995917a9 Refactor: Replace autokey macros with functions
No functional changes

The following macros have been replaced with identically named functions
* IS_AUTOKEY_ON
* IS_AUTOKEY_MODE
* IS_AUTOKEY_FLAG

Pull Request: https://projects.blender.org/blender/blender/pulls/113610
2023-10-12 16:20:18 +02:00
Christoph Lendenfeld
a3831fe7af Refactor: Move autokeyframing functions to animrig
No functional changes

The following functions have been moved
`autokeyframe_cfra_can_key`
`autokeyframe_object`
`ED_autokeyframe_object`
`ED_autokeyframe_pchan`
`ED_autokeyframe_property`

they are all in a new file
keyframing_auto.cc
while the declarations are in
ANIM_keyframing.cc

The autokeyframe makros also have been moved

Pull Request: https://projects.blender.org/blender/blender/pulls/113607
2023-10-12 15:44:58 +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
Jeroen Bakker
7501a686c2 Vulkan: Fix Subpass Transition Compilation Errors
Vulkan backend doesn't support subpass transition yet. Currently
shader_builder fails as when compiling shaders that use subpass
transitions.

This PR adds a dummy global variable to the GLSL so the compilation
continues.

Development of subpass would take some time as the current API doesn't
fit Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/113604
2023-10-12 15:11:26 +02:00
Campbell Barton
69f437c061 Cleanup: remove redundant call to BLI_freelistN 2023-10-13 00:05:47 +11:00
Campbell Barton
1c9eae982a Merge branch 'blender-v4.0-release' 2023-10-13 00:04:16 +11:00
Campbell Barton
59db44ad65 Fix animation player failing to play back JPEG 2000 image sequences 2023-10-13 00:02:02 +11:00
Hans Goudey
de47c2a8b4 Cleanup: Use const pbvh node pointers for some accessor functions 2023-10-12 14:51:51 +02:00
Hans Goudey
9ab290e1b3 Cleanup: Simplify sculpt faces mask undo loop
This is already separated per PBVH type, we can make use of that
to simplify the loops for the types with the aim of sharing code in
a simpler and more performance-friendly way. Ideally this could
be written as `array_utils::scatter`, but we don't have that utility
function now, so just write the raw loop for now.
2023-10-12 14:51:51 +02:00
Campbell Barton
82105bc408 Merge branch 'blender-v4.0-release' 2023-10-12 23:42:30 +11:00
Campbell Barton
78d1e9f48c Merge branch 'blender-v4.0-release' 2023-10-12 23:42:27 +11:00