Commit Graph

122952 Commits

Author SHA1 Message Date
Brecht Van Lommel
8d16e8f726 Merge branch 'blender-v3.5-release' 2023-03-28 16:33:34 +02:00
Brecht Van Lommel
6e51f8d202 Fix Python Module build on Windows
Don't install libraries in blender.shared and don't generate manifest
as it's not working and not important to have a clean directory here.

Always detect MSVC_REDIST_DIR as it is used by oneAPI. The way
InstallRequiredSystemLibraries is called it already only sets some
variables and doesn't install anything by itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/105999
2023-03-28 16:32:25 +02:00
Sebastian Herholz
ac0ed09735 Fix #104329 viewport render with path guiding crashes
This is a workaround fix for Open PGL 0.4.1 when the first volume
samples are collected in a later training iteration.

The problem is fixed in Open PGL > 0.5.0 and the workaround
can be removed after upgrading Open PGL.
2023-03-28 14:45:35 +02:00
Jacques Lucke
a58c951c98 Merge branch 'blender-v3.5-release' 2023-03-28 14:30:12 +02:00
Jacques Lucke
45c16f43ad Fix #105953: division by zero in quadriflow leads to crash
The bug was found by ASAN when running the file from #105953. It's not
entirely clear what the root issue for the division by zero is, but
at least now the result is more predictable.

Pull Request: https://projects.blender.org/blender/blender/pulls/106165
2023-03-28 14:25:19 +02:00
Jacques Lucke
d81d743537 BLI: support == and != for Set
This makes it more convenient to check if two sets contain the same keys.
2023-03-28 14:16:57 +02:00
Jacques Lucke
fbcddfcd68 BLI: add core types for supporting implicit-sharing
The overall goal is to use implicit-sharing in many places in Blender
that currently do unnecessary copies. See #95845 for more details.

This commit only adds the base data structures in blenlib and uses those
in `GeometrySet` and `AnonymousAttributeID`, which used a more ad-hoc
version of implicit sharing already. #105994 lists some more places where
support for implicit sharing can be added (most notably: custom data layers).

Pull Request: https://projects.blender.org/blender/blender/pulls/105994
2023-03-28 13:57:51 +02:00
Thomas Dinges
1987cbb12a Merge branch 'blender-v3.5-release' 2023-03-28 13:41:43 +02:00
Thomas Dinges
aa7293f555 Update license doc for OIIO lib update. 2023-03-28 13:40:39 +02:00
Bastien Montagne
3d49d738b7 Fix references to some nodegroups from new essentials staying around.
Previous fix/hack a60f65150267  made it so that all 'Fake User' linked
IDs are considered as directly linked, so that some IDs (like linked
Text) references are not lost on file save becaus they are not
effectively used.

However, this created unwanted references to all linked assets data,
because an asset always has its fake user set. This ended up keeping
lots of references to sub-assets when appending from the new Essentials
node groups.

NOTE: This is adding another hack to the collection, the whole handling
of 'which unused linked data reference to keep on file save' needs to be
reworked for Blender 3.6.
2023-03-28 13:29:03 +02:00
Jacques Lucke
57712d7b18 Fix #106177: modal operator does not work from Node menu
This was an issue with the `operator_context`. It's a bit confusing because it
looks like every `uiLayout` has its own, but in `uiLayoutSetOperatorContext`
you can see that the `operator_context` is always set on the root layout for
some reason.

The fix is to set `INVOKE_REGION_WIN` as the operator context after it has been
set to something else (I found this to be the default by printing the operator
context before it was changed).

Pull Request: https://projects.blender.org/blender/blender/pulls/106213
2023-03-28 13:13:30 +02:00
Julian Eisel
0256bfd309 UI: Support minimum row count for tree views
No user visible changes expected.

With this, empty rows will be added to the tree view so that the
background box is at least a few lines high (like with UI lists). If the
view is used as a drop target, data can be dropped on these empty rows
too then.
This was requested for the Cycles light linking project.
2023-03-28 12:39:24 +02:00
Habib Gahbiche
3ea5a8fbb9 Fix #105590: Compositor: Masks don't consider anamorphic aspect ratio
This PR adds support for anamorphic aspect rations when using
masks. As viewport compositor doesn't support masks yet, this
has not been added yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/106121
2023-03-28 12:36:14 +02:00
Jeroen Bakker
aa69ec7f80 Vulkan: Clearing Framebuffer + Scissors
This PR adds support for clearing framebuffers and scissor testing.
Tweaks had to be made to VKTexture to keep track of its layout
on the device. Based on the actual call the layout can switch
to a more optimum layout.

For example during upload of a texture the texture will be converted
to a transfer destination optimized layout. When reading from the
texture it will be converted to a transfer source optimized layout.

The order of the attachments in the framebuffer follows the next rules

- When only color attachments are there the color attachments will
  be placed in the slot they are defined. This way it will match
  the ShaderCreateInfo binding location.
- When a stencil/depth attachment is added it will be placed
  right after the color attachments. When there isn't a color
  attachment it will be the first attachment.

Pull Request: https://projects.blender.org/blender/blender/pulls/106044
2023-03-28 11:51:32 +02:00
eb9ab4fae4 Refactor: draw code for anim channel widget
A few small refactors of the `draw_setting_widget()` function for drawing
animation channel widgets (like 'modifier mute', etc.)

- Use `const` where appropriate.
- Move some variable declarations to their actual use, to clarify their
  scope and make it possible to use `const`.
- Return earlier where possible, which should improve performance as some
  unnecessary code gets skipped.

No functional changes.
2023-03-28 11:19:30 +02:00
Kazashi Yoshioka
a64877f045 Vulkan: Added prerequisite checks for using VK_Layer_Validation
This PR adds pre-checks when enabling validation layers.

For validation layers to work some platforms require that
the Vulkan SDK is installed. Validation layers are activated
when running blender with `--debug-gpu`.

Sometimes we expect users to run with `--debug-gpu` for
narrowing down an issue and we cannot expect them to have
the Vulkan SDK installed.

This patch will check if the `VK_LAYER_PATH` is available
and that the configuration file of the validation layer is
present. If this isn't the case we don't activate the
requested validation layer.

Pull Request: https://projects.blender.org/blender/blender/pulls/105922
2023-03-28 10:45:44 +02:00
Jeroen Bakker
f8e190aac5 Cleanup: Silence Compilation Warnings
In recent Vulkan changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/106204
2023-03-28 08:53:56 +02:00
Campbell Barton
a88c77eaac Cleanup: use struct comments for gwl_registry_handlers declaration 2023-03-28 17:05:25 +11:00
Campbell Barton
1cf2ad8e15 Fix #106203: Memory leak with dynamics enabled in particle edit mode
particle_batch_cache_init was called with allocated memory in
ParticleBatchCache. Now particle_batch_cache_clear frees all allocated
memory.
2023-03-28 16:58:50 +11:00
Campbell Barton
3071ec486b GHOST/Wayland: support window activation
Calling render (for example) with an existing window open now activates
the window on Wayland. Tested to work on GNOME & KDE.

Use the xdg-activation protocol which typically brings the
window to the foreground.

Partially resolves #102985.
2023-03-28 16:08:10 +11:00
Campbell Barton
8132b4a927 GHOST/Wayland: GWL_Seat::data_source_serial when modifiers are set
All keyboard/cursor events should set the data_source_serial,
also update doc-string.
2023-03-28 16:05:32 +11:00
Campbell Barton
4ee705ca4f Cleanup: use a system method to access the APP_ID
Move the app-id out window initialization code.
Make it possible for other methods to access the APP_ID.
2023-03-28 16:05:31 +11:00
Campbell Barton
10b03e66b9 Cleanup: remove unreachable code 2023-03-28 15:57:48 +11:00
Campbell Barton
4bead379c6 Cleanup: remove redundant (void) in C++ function declarations 2023-03-28 15:57:48 +11:00
Campbell Barton
2ec4ce18ae Cleanup: use 'override' specifier for GHOST: X11, SDL & None with CLANG
Clang would warn about failure to use 'override' when a single
method was added that used 'override' when none of the other methods
did.

This meant a single correct use of override caused noisy compiler
warnings (for CLANG but not GCC).
Avoid this by using 'override' where appropriate.
2023-03-28 15:57:48 +11:00
Campbell Barton
47e065f165 Cleanup: quiet unused but set warnings with CLANG 2023-03-28 15:57:48 +11:00
Campbell Barton
bbcfdb844c Cleanup: quiet strict-prototypes warning with CLANG 2023-03-28 15:57:48 +11:00
Campbell Barton
1b0816929f Cleanup: quiet unreachable-code-generic-assoc warnings with CLANG
Duplicate types in type checking macros caused many warnings.
2023-03-28 15:57:48 +11:00
Campbell Barton
5379c0aa00 Fix particle system creating over-sized KD-tree
Particles were counted but the result was ignored.
2023-03-28 15:57:48 +11:00
Campbell Barton
55f6c97185 Fix redundant memcmp in BLI_array_store, correct assertion
Assert failed in BLI_array_store_test, failing to compare chunks
caused an unnecessary memcmp call in rare cases.
2023-03-28 15:57:48 +11:00
Chris Blackbourn
8ac67a798b Cleanup: Simplify aspect ratio usage in uv unwrapper
Replace `aspx` and `aspy` with `aspect_y`.

No functional changes.
2023-03-28 15:52:34 +13:00
Chris Blackbourn
ceaaf7f0ca Cleanup: format 2023-03-28 15:05:54 +13:00
Hans Goudey
16576beb22 Fix: Mistake in mesh vertex normal dirty tag in previous commit
The "clear dirty" call was removed, that shouldn't happen (yet!).
2023-03-27 19:56:21 -04:00
Hans Goudey
9bb6f92fe0 Cleanup: Use Vector for metaball tessellation vertex data
Avoid manually reallocating arrays here, and simplify future changes
to the ownership and assignment of mesh vertex normals.
2023-03-27 19:48:04 -04:00
Chris Blackbourn
b828641a93 UV: Add alpaca_rotate variant for improved packing efficiency
Improvements to packing efficiency and updating UV packing API.

* Add #pack_islands_alpaca_rotate, the fast alpaca-style packer with rotation.

* Update heuristic for sorting islands based on longest edge.
(Improves pack efficiency when rotation is enabled.)

* Add `aspect_y` to UV Packing API, to support non-square materials in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/105977
2023-03-28 00:35:27 +02:00
Hans Goudey
00bb30c0e9 Geometry Nodes: Copy cached no loose edge status in realize instances
When all of the input meshes have no loose edges, the output won't have
any either, but finding that out for the output is much more expensive.
Copy this tag to the output mesh to save processing time when drawing.
In my test creating 1 million instances of a 16 face mesh, this changed
the time for the draw cache loose geometry extraction from 220 ms to
131 ms.

For now, only do this when the loose edges of the inputs are already
cached (primitive nodes, for example). This avoids paying the cost of
calculation when we don't know it will be necessary.
2023-03-27 16:40:04 -04:00
Hans Goudey
63689e4756 Geometry Nodes: Tag no loose edges after curve to mesh node
It doesn't take much time to know whether all of the curves have more
than a single point, and if that's the case, we know for sure there are
no loose edges in the mesh. This can save time when creating the mesh
draw cache. The time for finding loose geometry goes from 180 ms to
104 ms for a large molecular nodes test file.
2023-03-27 16:39:33 -04:00
Hans Goudey
52eced3eef Geometry Nodes: Slightly improve curve to mesh performance
For the single-threaded part of the curve to mesh conversion, avoid
writing to two logically separate arrays in the same loop. Instead
run the calculation on two separate threads if the output is large.

Timing for `calculate_result_offsets` when processing 1 million curves:
Before: Average: 10.4 ms, Min: 9.4 ms
After: Average: 9.2 ms, Min: 7.7 ms
2023-03-27 15:53:34 -04:00
Hans Goudey
de5ec852f3 Merge branch 'blender-v3.5-release' 2023-03-27 14:52:51 -04:00
Hans Goudey
ba4442ef41 Fix #105965: Add fur modifier properties missing UI data
Currently assigning values to IDProperties clears their UI data.
That is fixed by #106161, but that is too risky for 3.5. Instead,
work around the issue by triggering `MOD_nodes_update_interface`
function which recreates the UI data of the modifier properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/106190
2023-03-27 20:51:35 +02:00
Hans Goudey
59c0e19db2 Geometry: Skip recomputing bounds after translation
Now that mesh primitive nodes calculate their bounds in constant time,
it's worth updating the bounds eagerly when translating a geometry
since doing so should be very cheap and might save a more significant
amount of time if they're needed later.

Also slightly unify the translation functions for the different types.

Pull Request: https://projects.blender.org/blender/blender/pulls/106159
2023-03-27 20:51:01 +02:00
Aras Pranckevicius
05a63e3705 OBJ: improve UV values merging in the exporter
Previous code was using BKE_mesh_uv_vert_map_get_vert to somewhat
detect identical UV values on mesh vertices. But this was not
handling the case when separate mesh vertices still use the same UV
values (e.g. cube with all six faces mapped to whole image).

Replace usage of BKE_mesh_uv_vert_map_get_vert with a simple "unique UV
value" map, very similar to how OBJ normals are calculated for export.

Measurements on a somewhat extreme case: exporting "Rungholt" Minecraft
level from https://casual-effects.com/data time (Win10, Ryzen 5950X)
goes 2.9sec -> 2.2sec, and resulting file size 486MB -> 231MB. This
particular model has a lot of mesh faces mapping to the same places
in UV map.

On less extreme cases the timings are similar between old and new
code, with a tiny speedup in most tests I've tried.
2023-03-27 21:39:13 +03:00
Harley Acheson
8ad0935ed6 Fix #106108: Allow Arrow Increment on Sequence Values
Allow clicking the "up" and "down" arrows to increment/decrement by a
frame for Video Sequencer strip Frame Start, Strip Offset Start, and
Strip Offset End.

Pull Request: https://projects.blender.org/blender/blender/pulls/106117
2023-03-27 20:26:56 +02:00
Harley Acheson
2215ee9358 UI: Noto Emoji Font with Unicode 15.0 Updates
Updated version of our monochrome Noto Emoji (variable) font with 31
new emojis that were released as part of Unicode 15.0

Pull Request: https://projects.blender.org/blender/blender/pulls/106142
2023-03-27 20:05:44 +02:00
Germano Cavalcante
bb67d4c298 Transform: expose hardcoded 'Rotate Normals' key
"Rotate Normals" is a changeable operation like any other and does not
need to be hardcoded.

An advantage of exposing this modal is that the shortcut key now
appears in the header when rotating an edited mesh.
2023-03-27 14:38:47 -03:00
Germano Cavalcante
040ea1637d Cleanup: deduplicate code that changes transform mode
Avoid calling `restoreTransObjects`, `resetTransModal`,
`resetTransRestrictions` and `initSnapping` for each change.

Also bring `applyMouseInput` close to the rest of the code.
2023-03-27 14:05:59 -03:00
Germano Cavalcante
7af13f0ae9 Cleanup: remove unnecessary code
Since `t->values_final` was created, `t->values` is no longer changed
by the mode, so the solution in dfaf26412d is no longer needed.
2023-03-27 14:05:59 -03:00
Germano Cavalcante
195c2b77ae Transform: modify constants for improved readability
No functional changes.

The lack of organization in the values of the constants that indicate
the properties was prone to errors.

One error that can be noticed is that the values of
`P_ORIENT_AXIS_ORTHO` and `P_VIEW2D_EDGE_PAN` were the same.
(not really a problem though)
2023-03-27 14:05:59 -03:00
Bastien Montagne
6cfc43fd76 Merge branch 'blender-v3.5-release' 2023-03-27 18:49:43 +02:00
Bastien Montagne
3ea5006416 Updated from SVN trunk (r6409). 2023-03-27 18:49:00 +02:00