Commit Graph

150077 Commits

Author SHA1 Message Date
Julien Duroure
5789031072 glTF exporter: fix invalid escape sequence 2024-05-24 09:15:13 +02:00
Campbell Barton
4f73df2b7b Extensions: enable extensions.blender.org, adjust welcome screen
Splash screen notification text:

- When starting in "Offline mode" with repositories with installed
  packages enabled, the text is clickable unless launched with
  `--offline-mode`, the tooltip notes that the command line setting
  can't be changed at run-time.
- Don's show anything if there are not extensions installed.

Preferences:

- Don't show the welcome message on preferences if:
  - Blender is online.
  - The message was dismissed.
  - There are no enabled remote repositories.

- The option to enable extensions.blender.org has been replaced with
  a button that switches to the "System" tab where Online Access
  can be enabled.

Also expose bpy.app.online_access_override needed for the UI to check
if online access was disabled using command line arguments.
2024-05-24 16:51:36 +10:00
Campbell Barton
91cab8f992 Extensions: remove use of BaseException
This can cause unexpected behavior, even in cases where SystemExit
or KeyboardInterrupt needs to be caught, it's better to list them
explicitly.
2024-05-24 16:16:55 +10:00
Campbell Barton
7f0903fdbf Fix scandir always shown an error
Incorrect use of BaseException meant the generator finishing
would print as an error
2024-05-24 16:16:55 +10:00
Omar Emara
6ae98e43a9 Fix #122070: Crash when calling python render method
Blender crashes when calling the python render operator when GPU
compositor execution is enabled. This is due to a missing system GPU
context, which is not initialized for blocking rendering. So this patch
ensures the system GPU context before compositing. Additionally, it
removes the assert that ensures a non main thread execution, since the
assumption apparently does not really hold.

Pull Request: https://projects.blender.org/blender/blender/pulls/122176
2024-05-24 07:58:39 +02:00
Jesse Yurkovich
1f243f1d36 Cleanup: fix -Wpessimizing-move warning in GHOST_XrGraphicsBinding 2024-05-24 07:28:55 +02:00
Campbell Barton
ad09b175f9 Extensions: only check updates for repos that have packages installed 2024-05-24 14:08:34 +10:00
Campbell Barton
61e4d1818e Cleanup: follow operator callback & argument naming 2024-05-24 14:08:33 +10:00
Campbell Barton
1831e2579a Cleanup: prefix return arguments with "r_" 2024-05-24 14:08:32 +10:00
Campbell Barton
765ab695d1 Cleanup: remove light preferences operator
This only avoided setting the "section" property for
SCREEN_OT_userpref_show.
2024-05-24 14:08:31 +10:00
Campbell Barton
c39c3825e8 UI: add a description callback for the preferences
Tool-tips which open preferences in a section now include this in the
description.
2024-05-24 14:06:59 +10:00
Campbell Barton
aacf14ae95 UI: remove option to enable online access on startup
Setting up online access is being updated and this isn't required.
2024-05-24 14:06:58 +10:00
Hans Goudey
da1ea4cdd1 Revert "Draw: Avoid temporary copy for mesh triangulation index buffer"
This reverts commit 108ab1df2d.

This causes issues when duplicating objects that I don't have time
to investigate right now.
2024-05-23 23:43:34 -04:00
Campbell Barton
701acd01b1 Build: fix building OIDN on Linux
Linux needed an include for std::thread.
2024-05-24 09:28:45 +10:00
Sergey Sharybin
2a5892e013 Fix compilation error after recent cleanup 2024-05-23 22:17:36 +02:00
Sergey Sharybin
68a76c3c77 Fix #121719: Sound does not play when playback starts outside of strip
The issue was caused by an integer overflow in the `FFMPEGReader::seek`, which
lead to different results depending on an exact compiler version and platform.

The overflow happened in the equation which calculates `m_position`, in its
`packet.pts - st_time` part, which is effectively `int64_t - uint64_t` which is
expected to result in `uint64_t` due to the way how upcasting works in C++.

With the values `packet.pts=0` and `st_time=353600` from the test file the
calculation resulted in a negative value, which then wrapped around due to the
unsigned nature of the type, resulting in very big value on arm64. The value
was wrong, but it did not manifest itself as an error, since the seek code
believed it found the place.

However, when built on x86 platform, the result value was very large negative
value. It is possible that the type upcasting went different, due to the
multiplication with a double value later in the formula. And this large negative
value lead to the seeking code to read the entire file, trying to make it so
the `m_position` is not less than the requested position.

Fortunately, the `AVStream::start_time` is `int64_t`, which leads to a simple
fix which avoids signed/unsigned cast, making the seeking code to properly
calculate `m_position` on both arm64 and x64 platforms, regardless of the
compiler.

Pull Request: https://projects.blender.org/blender/blender/pulls/122149
2024-05-23 21:25:04 +02:00
Clément Foucault
f46e3d1067 Fix: EEVEE-Next: No shading from lights for volume only scenes
The issue was that the shadow module was never setup by any
other pipeline before the volume lighting pass.

Fix #121971
2024-05-23 21:20:57 +02:00
Hans Goudey
427b356b87 Cleanup: Rename mesh render data orig index variables 2024-05-23 15:19:10 -04:00
Hans Goudey
e77c2d77e4 Cleanup: Remove unused function argument 2024-05-23 14:06:56 -04:00
Hans Goudey
3b93e8adca Cleanup: Mesh: Fix complicated index retrieval for loose points 2024-05-23 14:02:23 -04:00
Hans Goudey
108ab1df2d Draw: Avoid temporary copy for mesh triangulation index buffer
The mesh triangulation data is stored in CPU memory with the same format
as the triangles GPU index buffer. Because of that we can skip creating a
temporary copied owned by the GPU API. One way to do that is to just
upload the data directly and avoid keeping a reference to it. However, we
can only upload GPU data from the main thread with OpenGL, so instead
reference the data and keep track of whether to free it.

When drawing a mesh with a single material and 1.8 million faces, this
change gives a 12-15% improvement in framerate, from about 32 to 37 FPS.

Part of #116901.

Pull Request: https://projects.blender.org/blender/blender/pulls/122175
2024-05-23 19:59:36 +02:00
Jacques Lucke
ebb61ef30f Nodes: avoid removing link when inserting incompatible node
Previously, when dropping a node on a link with incompatible sockets, the link
would be removed. While sometimes useful in super simple setup, it is generally
useless for most work. Even worse, users might not notice that they accidentally
removed a link (this has been reported in the recent geometry nodes workshop).

This patch changes this behavior in two ways:
* A node can't be inserted onto an incompatible link anymore.
* A link will be dimmed while dragging a node over it, if it is incompatible or if
  alt is pressed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121975
2024-05-23 19:52:37 +02:00
Clément Foucault
2e3ad7404a Fix: EEVEE: Broken bias for sunlights
The pixels size was not computed in the right space.

This is the easy fix as refactoring the directional
shadows is too risky/time consuming right now.

Fix #121641
2024-05-23 19:30:43 +02:00
Mangal Kushwah
d37342e185 Fix #108105: Fix operators affecting hidden geometry
These operators in sculpt mode affect hidden geometry which is undesirable.
- bpy.ops.sculpt.face_set_edit
- bpy.ops.sculpt.face_sets_init
- bpy.ops.sculpt.face_sets_create(mode='SELECTION')
- bpy.ops.mesh.paint_mask_extract()
- bpy.ops.mesh.paint_mask_slice()

This PR adds checks for hidden faces in these operators.

For operator `bpy.ops.sculpt.face_sets_init` it also modifies the way
face sets indices were generated so generated indices is unique. This
is needed so new initialized face sets do not get same indices as hidden
face sets.

For generating unique face set index I have created a set container
which stores hidden face sets indices. Before assigning indices to a
face set it checks if it is already in set container, if it is then
it'll keep increasing index by 1 until it is not in set container.

Modifying Operator `bpy.ops.mesh.paint_mask_slice()` is little complex,
it will not affect hidden geometry only when fill holes option is
unchecked, because currently filling hole code does not take hidden
geometry into account and because of this in some cases hidden part
of geometry can be trapped inside mesh.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119168
2024-05-23 19:24:12 +02:00
Harley Acheson
f5fdda776c UI: Outliner Ctrl-F To Start Filter
New operator OUTLINER_OT_start_filter bound to Ctrl-F to move keyboard
focus to the Outliner search filter box. And OUTLINER_OT_clear_filter
bound to Alt-F to clear the search box. Both similar to Properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/122126
2024-05-23 19:11:24 +02:00
Hans Goudey
b0eb48c4dc UI: Move Normal Edit and Weighted Normal modifiers to "Normals" menu
Though the whole modifier menu could use a reorganization, it probably doesn't
make sense to do that before we have a builtin library of node group assets.
We already have the "Normals" category though, so these two modifiers make
more sense there.

Pull Request: https://projects.blender.org/blender/blender/pulls/122168
2024-05-23 18:28:31 +02:00
Harley Acheson
5a643cfa74 UI: Edge Slide Comments
Comments explaining why some properties might be not set in some
circumstances.

Pull Request: https://projects.blender.org/blender/blender/pulls/122172
2024-05-23 17:51:16 +02:00
Brecht Van Lommel
b49165fc61 Fix: Asset shelf entries not properly ordered by library name
And add some comments for clarity
2024-05-23 17:49:46 +02:00
Brecht Van Lommel
28f60c725a Fix: Assert reusing asset datablocks 2024-05-23 17:49:40 +02:00
Philipp Oeser
f3c32a36bc Fix #103562: preserve custom normals in BM_mesh_triangulate
`BM_mesh_triangulate` is used in exporters (when the "Triangulate"
option is ON), the `Triangulate` modifier and currently also in the
`Triangulate` geometry node (even though there are plans to change this,
see !112264)

So in practice, exporters (Alembic/FBX/OBJ/Collada) were breaking
custom normals for game pipelines (unless everything was triangulated
beforehand).

This change builds upon 93c8955a72 (uses the use
`BM_custom_loop_normals_to_vector_layer` /
`BM_custom_loop_normals_from_vector_layer` pair of calls).

In the case of the `Triangulate` modifier, this had its own try at
preserving custom normals in 7d0fcaa69a  -- doing very similar
things but as an option -- this is now removed (so it is always done,
which fits into "interpolate custom data if it's there" design that we have
nowadays).

NOTE: the "Triangulate Faces" operator already did the same
Pull Request: https://projects.blender.org/blender/blender/pulls/121871
2024-05-23 17:33:40 +02:00
Clément Foucault
f968c99850 Fix: EEVEE: Shadow: Huge performance drop caused by local lights
Punctual shadow maps were never tagged as updated, constantly
refreshing themselves.
2024-05-23 17:17:42 +02:00
Clément Foucault
8b65908574 Fix: EEVEE-Next: Missing shadow near area light
This was caused by wrong assumption that `shadow_radius`
is also a radius for area light. To avoid the confusion,
use a new property for area light shadow scaling.
2024-05-23 17:17:42 +02:00
Falk David
7b3e529462 Cleanup: GPv3: Remove unused function 2024-05-23 16:23:02 +02:00
Clément Foucault
40b4447f0a Fix: EEVEE-Next: Broken Area light shadow
This removes the area light shadow clipping.
This had issues and we are now not using
any shifting behind the area light.

Fix 122108
2024-05-23 15:35:16 +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
Hans Goudey
c7c2a9c4c9 Fix #122154: Loose edges invisible, wireframe shading mode crashes
When there are no "extractors" the dependencies didn't work properly to
calculate the loose geometry. This is similar to 30ec31b550.
2024-05-23 08:30:16 -04:00
Iliya Katueshenock
7fac204909 Cleanup: unnecessary copy
This partially reverts 521cd53f29.

Pull Request: https://projects.blender.org/blender/blender/pulls/121783
2024-05-23 14:07:43 +02:00
Sietse Brouwer
180474aaee GPv3: Python API additions to layer, layers, layer_groups
This PR contains several additions to the GPv3 Python API for
`layer_groups`, `layers` and `layer[key]`.

**Layer groups**
`grease_pencil.layer_groups`
- `.new(name, parent_group=None)`
- `.remove(layer_group, keep_children=False)`
- `.move(layer_group, 'UP'/'DOWN')`
- `.move_top(layer_group)`
- `.move_bottom(layer_group)`
- `.move_to_layer_group(layer_group, parent_group)`

**Layers**
`grease_pencil.layers`
- `.new(name, set_active=True, layer_group=None)`
- `.remove(layer)`
- `.move(layer, 'UP'/'DOWN')`
- `.move_top(layer)`
- `.move_bottom(layer)`
- `.move_to_layer_group(layer, layer_group)`

**Layer**
`grease_pencil.layer[key]`
- `.select`
- `.lock`
- `.matrix_local`
- `.matrix_parent_inverse`
- `.parent_group`

Pull Request: https://projects.blender.org/blender/blender/pulls/121797
2024-05-23 13:51:13 +02:00
Jacques Lucke
0f32291d15 Nodes: make new frame node child of common parent of selected nodes
Previously, the new frame was always added as root frame and did not have a parent.
Now, the common root frame of all selected nodes is detected and the new frame is attached to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/121972
2024-05-23 13:24:35 +02:00
Julian Eisel
46f5079f11 Fix: Various crashes and issues with popups
Fixes #121902, #121865, #121905 and some other reports that were closed
as duplicates.

Reverts a change done as part of 7d80fde033.

Reverting this change breaks the yet-to-be-used asset shelf popup a bit,
in that refreshing it won't work propery anymore. Think that's fair
given that 1) the popup isn't in use yet, 2) its refreshing implementation
causes a bunch of high priority bugs, and 3) #122068 is in review with a
better solution to handle refreshing. Namely, it converts the popup to a
popover, which handles refreshing differently, and thus makes the change
being reverted here unnecessary anyway.
2024-05-23 13:22:39 +02:00
Falk David
02d5d573fb GPv3: UI: Rename buttons in layer group context menu
In a recent module meeting
https://devtalk.blender.org/t/2024-05-21-grease-pencil-module-meeting/34755
it was proposed to to make "Delete Group" delete everything
(the group with children) and use "Ungroup"
for just deleting the group while keeping the children.

This implements the suggested change that was agreed upon.
2024-05-23 12:49:34 +02:00
Lukas Tönne
1ebc4a2328 Fix #122039: GPv3: Fix inverted fill tool invocation
The operator has a modal keymap with a toggle for inverted mode. This
key was only bound to `PRESS` events, preventing actual toggling during
modal operation.

It also needs to be invoked in inverted mode with ctrl, so a new
operator property was added to initialize the setting.

Pull Request: https://projects.blender.org/blender/blender/pulls/122146
2024-05-23 12:08:37 +02:00
Jeroen Bakker
6fbd287493 EEVEE-Next: Fix use after free when syncing curves/point clouds.
In `SyncModule::sync_curves/sync_point_cloud` the material variable
can be used after it has been freed. The cause is that cryptomatte
can request a new material, which might trigger a relocation of the
references material.

This PR fixes this by doing the shadow sync before the cryptomatte
sync.

Pull Request: https://projects.blender.org/blender/blender/pulls/121909
2024-05-23 12:04:47 +02:00
Jeroen Bakker
cc8dccb83b EEVEE-Next: Fix incorrect shift in shadowing
Grid offset of a tile can be negative. Shifting of negative numbers
is implementation dependent. This PR changes it to a multiplication.

Pull Request: https://projects.blender.org/blender/blender/pulls/121910
2024-05-23 12:04:20 +02:00
Jeroen Bakker
93c69e6b64 Vulkan: Render graph - swapchain handling
This PR implements swapchain handling when using the render graph.

Pull Request: https://projects.blender.org/blender/blender/pulls/122144
2024-05-23 12:00:36 +02:00
Jeroen Bakker
d28474e404 Vulkan: Render graph - VKFramebuffer blitting
Implement framebuffer blitting using the render graph.

Pull Request: https://projects.blender.org/blender/blender/pulls/122143
2024-05-23 11:37:58 +02:00
Christoph Lendenfeld
345cd70404 Fix: Pose Library - Ctrl click not applying flipped
This has been mentioned as a bug in the recent A&R module meeting
https://devtalk.blender.org/t/2024-05-14-animation-rigging-module-meeting/34614#ux-quirks-in-the-pose-library-shelf-5
Pressing `Ctrl` only worked from within the modal operator, but not to start it.
The issue was that the entry for that was missing from the keymap.

This PR adds a keymap entry to apply and to blend a pose flipped,
by holding `Ctrl` first and then clicking the pose asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/121860
2024-05-23 11:35:44 +02:00
Jeroen Bakker
5ee46b0ef3 Vulkan: Use macros to reduce code replication
Use macros to reduce code replication.

- `VKRenderGraph::add_node`
- `VKRenderGraphNode::build_commands`
- `VKRenderGraphNode::free_data`

Pull Request: https://projects.blender.org/blender/blender/pulls/122141
2024-05-23 11:21:55 +02:00
Christoph Lendenfeld
7b0f49f183 Fix: Whole character keying set error on unresolved paths
The "Whole Character" keying set might fail to insert keys
when a property cannot be resolved.
This occurred on the Ellie rig from the Blender Studio.
The failing property was called "bone gizmo".
The fix is to check if `rna_property` exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/122038
2024-05-23 11:20:45 +02:00
Bastien Montagne
feb09cbe62 Cleanup: Update description of BKE_id_is_editable.
Getting the owner ID of an embedded liboverride is not that expansive
anymore.

Also explain difference between this function and the new similar
`ID_IS_EDITABLE` macro.
2024-05-23 10:31:41 +02:00