Commit Graph

112820 Commits

Author SHA1 Message Date
Jesse Yurkovich
b520ae6efe Cleanup: Small non-functional cleanup in usd_writer_mesh
Changes include:
- Simplify active_uvmap_name handling
- Remove unneeded defaultTime global variable

Pull Request: https://projects.blender.org/blender/blender/pulls/127268
2024-09-06 23:34:51 +02:00
Hans Goudey
27ce4b9fc4 Fix: Sculpt: Automask bake crash with dyntopo topology changing brush 2024-09-06 15:54:17 -04:00
Hans Goudey
1787fe7e6c Fix: Sculpt: Debug assert in raycast original data lookup
Raycast and "nearest to ray" use the local vertex indices from triangles
to index original data, which needs to be sized with all the vertices, not
just unique vertices. Add a new function to access that data.
2024-09-06 15:30:44 -04:00
Harley Acheson
0e690d3abb UI: Dialog Drag Cursors
Mouse cursor changes when hovering at the top of popup blocks to
indicate that these can be dragged. On Mac this looks like a hand,
while for other platforms it is a drag cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/118358
2024-09-06 20:22:24 +02:00
Harley Acheson
458c60269b UI: Hand Cursors
Add multiple "hand" mouse cursors. These are mostly needed for Mac,
which needs open, close, and pointing hand cursors. This also adds
similar for Windows, but just for completeness and testing.

Pull Request: https://projects.blender.org/blender/blender/pulls/127164
2024-09-06 19:05:59 +02:00
Miguel Pozo
eab640e044 Draw: Batch shader compilation for image render
Enable deferred parallel batch compilation for image renders.
This replaces the use of the `WM_job` system with a regular thread,
since `WM_job` requires access to the main context,
which is not accessible from the render thread.
It also simplifies the system so it creates a single thread at startup
and deletes it at exit.

Pull Request: https://projects.blender.org/blender/blender/pulls/125005
2024-09-06 18:13:43 +02:00
Hans Goudey
2952498724 Cleanup: Sculpt: Add debug timing for multires BVH build 2024-09-06 12:13:04 -04:00
Nathan Vegdahl
e991765a83 Fix: incorrect indentation in action editor with layered actions
The code that decides the indentation for channel groups and fcurve channels
already accounted for the difference between the Action Editor and Dopesheet/
Graph Editor, since the level of nesting is different in the Action Editor vs
the other two.  However, it didn't account for the difference between legacy and
layered actions, which have different nesting in the Action Editor.

Additionally, before layered actions were introduced it was impossible for
the Action Editor to display channels from e.g. materials, but those channels
can now be displayed in the Action Editor via the slot system.  However, the
indentation code was structured such that material (etc.) channels were *always*
indented as if they were in the Dopesheet/Graph Editor, where they're always
nested under the IDs that use them.

This commit fixes the issue by having a separate code path for indenting in the
Action Editor that only indents channel groups and fcurve channels, and which
properly handles the difference between layered and legacy actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/127202
2024-09-06 17:37:50 +02:00
Christoph Lendenfeld
7cb0e2cd1e Anim: Convert FCurve groups from legacy to layered
When converting a legacy Action to a layered Action,
also convert group memberships.

This is important for bones to retain their structure in
the Channel Box.

Pull Request: https://projects.blender.org/blender/blender/pulls/127188
2024-09-06 17:24:13 +02:00
Clément Foucault
dc89c935fa GPv3: Implement Wireframe batch
Fix #120604

Pull Request: https://projects.blender.org/blender/blender/pulls/127147
2024-09-06 16:50:21 +02:00
Laurynas Duburas
4948ade694 Overlay-Next: Edit-Mesh measurements
Overlay-Next version of mesh measurements.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127124
2024-09-06 16:45:40 +02:00
Hans Goudey
a434ead0d8 Cleanup: Sculpt: Rename BMesh data scatter/gather functions
Remove "vert" from the name since it's inferred by the argument type.
2024-09-06 10:36:53 -04:00
Hans Goudey
d87aae2b06 Cleanup: Sculpt: Reorder data gathering functions in header 2024-09-06 10:36:53 -04:00
Clément FOUCAULT
8551cbfa05 Overlay-Next: Prepass: Conservative raster
Allow selection of very thin meshes.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127244
2024-09-06 16:14:49 +02:00
Nathan Vegdahl
92a7229f67 Anim: implement channel grouping/moving ops for layered actions
This adds layered animation support to the following operators, allowing users to manage the grouping and arrangement of fcurves in the channel list:

- "Group Channels"
- "Ungroup Channels"
- "Move Channels"

Pull Request: https://projects.blender.org/blender/blender/pulls/127080
2024-09-06 16:12:05 +02:00
Nathan Vegdahl
bf373d94fe Fix: crash when deleting layered-action channel groups via the UI
The cause was simple: I missed this operator in the initial layered-action
channel group implementation, so deletion was using the legacy action code
even for layered actions.

This implements the needed code in the deletion operator to handle layered
actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/127242
2024-09-06 14:44:59 +02:00
Jeroen Bakker
2eb0803b43 Vulkan: Cannot use inside Renderdoc
Renderdoc only export extensions it supports.
`VK_EXT_dynamic_rendering_unused_attachments` is not supported by
renderdoc and therefor no devices could be found to start the vulkan
backend.

In GHOST we already work around this issue by not checking this specific
extension. We should do the same in VKBackend.

Pull Request: https://projects.blender.org/blender/blender/pulls/127236
2024-09-06 14:40:29 +02:00
Sybren A. Stüvel
e897b184e4 Anim: Add backward-compatible RNA API for Action.groups
The `Action.groups` RNA functions now work with layered Actions as well.
They just expose / operate on the groups of the channelbag that belongs
to the first slot of the Action.

Pull Request: https://projects.blender.org/blender/blender/pulls/127241
2024-09-06 14:33:58 +02:00
Sybren A. Stüvel
c7b7bc98ed Refactor: Anim, protect back compat API with #ifdef WITH_ANIM_BAKLAVA
Protect the backward-compatible API implementation with
`#ifdef WITH_ANIM_BAKLAVA` directives.

This also moves the `use_backward_compatible_api()` function further up
in the file, to the place where I'll need it when building the backward-
compatible API implementation for Action groups.

The backward-compatible API implementation makes the legacy Action API also
work on new layered Actions, exposing the data for the first slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/127241
2024-09-06 14:33:57 +02:00
Sybren A. Stüvel
ec5ebc8363 Anim: add group name support to back-compat Action.fcurves.new()
Add group name support to the backward-compatible implementation of
`Action.fcurves.new()`. This ensures that the legacy Action API creates
a new-style channel group in the appropriate channel bag.

Pull Request: https://projects.blender.org/blender/blender/pulls/127241
2024-09-06 14:33:57 +02:00
Sybren A. Stüvel
fe96a0c3f6 Anim: fix crash when writing empty action groups
It was just a missing 'else' clause around some should-have-been-
conditional code.

Pull Request: https://projects.blender.org/blender/blender/pulls/127241
2024-09-06 14:33:57 +02:00
Sybren A. Stüvel
158b7ae5da Cleanup: Anim, Document that channel_group_create() makes name unique
Document that `ChannelBag::channel_group_create(name)` ensures the group
name is unique within the channelbag.

No functional changes.
2024-09-06 14:33:57 +02:00
Jeroen Bakker
650413e1e6 Fix: Crash when Switching to Node Editor
The [sponza](https://projects.blender.org/blender/blender-benchmarks/src/branch/main/cycles/sponza)
benchmark scene crashes when switching to the compositor tab due to a
missing null pointer check.

Pull Request: https://projects.blender.org/blender/blender/pulls/127230
2024-09-06 14:08:48 +02:00
Clément FOUCAULT
a4cd59e369 Overlay-Next: Prepass: Grease Pencil
Allow selection of grease pencil objects.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127238
2024-09-06 13:29:53 +02:00
buildxyz-git
a0f653c002 PyAPI: enable draco when building blender as a python module
Allow GLTF IO using Draco compression.

Ref: !125556
2024-09-06 21:15:38 +10:00
Campbell Barton
11187aa9dc CMake: don't link sdlew when WITH_SDL=OFF
This caused a build error building Blender as a Python module
with !125556 applied.
2024-09-06 21:01:36 +10:00
Clément FOUCAULT
bd66008344 Overlay-Next: Prepass: Curves, Point Cloud and Particle
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127198
2024-09-06 12:40:51 +02:00
Dalai Felinto
60cc73afe6 Cleanup: UI: Icons: Sort the icons alphabetically between their categories
No functional changes.

The TOGGLES and INPUT were left untouched since they are order-dependent.

Ref: !127197

Pull Request: https://projects.blender.org/blender/blender/pulls/127197
2024-09-06 12:37:56 +02:00
Dalai Felinto
d563926d73 Cleanup: UI: Shuffle icons and group them in categories
No functional changes.

The comments in the file are used as categories by some of our ICON
reading tools.

This also groups the TOGGLES icons together, with comments about their
order. This only includes the icons actively used as toggles at the
moment.

Note that ICON_NONE has always to be the first one in this file since
some parts of the code (e.g., the code to turn RECORD_ON into colored,
and the code for the popover chevron) have no-icon hardcoded as 0.

Ref: !127197
2024-09-06 12:37:55 +02:00
Jeroen Bakker
2b43900ccc Vulkan: Reading subtexture
Subtexture reading is supported via GPUFramebuffer. The input
parameters was an rect, but is called an area which includes
width and height.

Due to inconsistent naming the area was assumed to be a region leading
to incorrect sub texture being downloaded or crashes due to out of
bound writes.

This fix crashes when selecting in edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/127229
2024-09-06 11:55:36 +02:00
Sybren A. Stüvel
fbfe407201 Cleanup: Anim, add comment to explain AnimData.action_slot_handle
Explain in a comment why the RNA property `AnimData.action_slot_handle` is
still necessary (TL;DR: library overrides), even though its use in Python
code is limited / should be avoided.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127185
2024-09-06 11:14:54 +02:00
Sybren A. Stüvel
b4e7a4fd88 Anim: remove RNA property Action.last_slot_handle
Remove `Action.last_slot_handle` from RNA. This is considered to be an
internal implementation detail, and Python code should not be using its
value for anything.

No actual functional changes, as this RNA property isn't used anywhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/127185
2024-09-06 11:13:14 +02:00
Philipp Oeser
e758c4c851 Fix #127208: Crashes using "Clipping Region..."
Typo in 508b39661d resulting in:
Error: Cannot find shader create info named
"overlay_armature_dof_clipped"

So now "overlay_armature_dof_lipped" >> "overlay_armature_dof_clipped"

Pull Request: https://projects.blender.org/blender/blender/pulls/127224
2024-09-06 11:00:35 +02:00
Campbell Barton
792c29e52f Fix uninitialized memory use rendering from the sequencer
SeqRenderData::is_playing & is_scrubbing used uninitialized stack
memory, seq_prefetch_start(..) read both values.

Resolve by setting defaults.
2024-09-06 16:32:09 +10:00
Jeroen Bakker
458faa6486 Preferences: GPU backend selection
This PR allows users to select a GPU backend.

In the system tab of the user preferences the GPU backend can be selected in the `Display Graphics` panel.
It will require a restart of Blender before the changes become effective.

During startup minimum requirements are checked. Blender will switch automatically
to OpenGL when no compatible Vulkan device could be detected. A dialog will be shown
to inform the user.

The setting of the in the `Display Graphics` panel are still overridden when blender is started
using the `--gpu-backend` option. When starting blender with `--debug-gpu` the backend
detection will print to the console.

See PR for detailed information and screenshots of the UI.

Implements #126504
Pull Request: https://projects.blender.org/blender/blender/pulls/126545
2024-09-06 08:28:41 +02:00
Pratik Borhade
df996ad837 Fix #126824: Allow instancing override child collection in outliner
In case of overridden collection, only root collection can be instanced
from outliner. Whereas, "Add collection instance" operation from viewport
works with child collections as well. To make outliner operation consistent,
set `is_liboverride_allowed` to true. This will let instancing of child collection that
are overridden.

Co-authored-by: Bastien Montagne <mont29@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/126881
2024-09-06 08:25:15 +02:00
Campbell Barton
016ab453dd Fix crash in sculpt poll function without an active object 2024-09-06 16:03:03 +10:00
Campbell Barton
43f7b50df3 Fix #127127: bpy.types sometimes reference their parent's "bl_rna"
Accessing `bl_rna` for type defined in `scripts/modules/bpy_types.py`
could return their parent-classes RNA when accessed via their parent
types __subclasses__() method.
2024-09-06 14:57:26 +10:00
Aaron Carlisle
55ac8c701c Docs: Add descriptions to some property sub types
- Clarify the difference between `COLOR` and `COLOR_GAMMA` Descriptions match `wm.py`

Fixes https://projects.blender.org/blender/blender-manual/issues/104767
2024-09-05 22:36:52 -04:00
Campbell Barton
9d917b73b9 Cleanup: remove duplicate depsgraph tagging
Operations on collections could tag the same collection multiple times.
Track the changed state instead. Also rename (ok/updated to "changed"),
for clarity & consistency.

Remove duplicate depsgraph tagging from ED_rigidbody_object_remove too.
2024-09-06 12:17:10 +10:00
Campbell Barton
2954323c2d Fix missing depsgraph tags after removing an object from a collection
Follow up to fix for #127213, resolving the bug in other contexts.
2024-09-06 12:05:33 +10:00
Campbell Barton
f5b16e474f Fix #127213: crash on undo after unlinking an object in the outliner 2024-09-06 11:45:13 +10:00
Campbell Barton
73ac0275c6 Fix missing check for "-c" to terminate argument parsing
Arguments to CLI commands could accidentally enable guarded allocator
when using "-c" instead of "--command".
2024-09-06 10:38:02 +10:00
Sean Kim
fbf95a05d5 Cleanup: Various changes for cavity automasking
* Use `float3` where possible
* Adjust names, introduce a utility `struct` to represent the accumulation
  happening in the method
* Remove dead code
* Use `std::queue` instead of custom hand-written queue working on a
  `Vector`
* Apply `const` where possible
* Use C++ math library

Pull Request: https://projects.blender.org/blender/blender/pulls/127212
2024-09-06 01:07:03 +02:00
Hans Goudey
07d7404390 Fix: Correct wireframe drawing after recent PBVH storage refactor
Somehow this untested implementation made it in, I thought I had
tested this. The mistake I made was imagining the VBOs were "indexed"
using the node vertex indices, but we use a flat duplicate-per-triangle
vertex VBO format.
2024-09-05 15:42:15 -04:00
Hans Goudey
e05d55f4c9 Cleanup: Remove unnecessary PBVH free function
Just call `reset()` directly instead.
2024-09-05 14:51:19 -04:00
Hans Goudey
c6e426fc8f Refactor: Sculpt: Pass object to sculpt session free function 2024-09-05 14:46:35 -04:00
Hans Goudey
b8d3de8598 Cleanup: Use accessor function for retrieving PBVH
Missed in previous commit
2024-09-05 14:46:35 -04:00
Jesse Yurkovich
832d243249 Fix #116615: Store Blender bone lengths on USD Skeletons
USD Skeletons (armatures) are joint-based rather than bone-based in
construction. This means that there's no native bone concept nor is
there any bone lengths. Currently, Blender's USD import uses an
estimation, roughly corresponding to the average distance between
joints in the entire Skeleton, to set the bone length in situations
where it's not obvious that 2 joints are directly connected. This is
imperfect but shouldn't affect actual functioning of the rig.

For armatures coming from external software this is probably the best we
can do. However, for armatures originating from Blender, we can use a
custom primvar to store the bone lengths directly. This allows Blender
armatures to be exported and re-imported in much better fidelity.

This is superior to prior techniques, like those employed by FBX, which
alter the actual Skeleton, inserting extra joints where unnecessary. Not
only is this detrimental when using these files in external software,
but it's still imperfect when importing back into Blender too.

Pull Request: https://projects.blender.org/blender/blender/pulls/126954
2024-09-05 20:37:22 +02:00
Hans Goudey
d33e708343 Refactor: Sculpt: Use function to access PBVH
Part of #118145.
In the future we want to move the ownership of the BVH tree to the
original mesh rather than `SculptSession`, in order to persist it
across some more general non-topology changing operations like
node tools. The first step of that change is replacing all places
that used `SculptSession::pbvh` for access with a function.
2024-09-05 14:16:40 -04:00