Commit Graph

144304 Commits

Author SHA1 Message Date
Bastien Montagne
2e93789ff1 Cleanup: Fix typo in documentation for background CLI option. 2024-12-06 17:50:31 +01:00
Philipp Oeser
566a38ffee Fix: Crash rendering of rigid body setup without baking dynamics first
When rendering animation without baking dynamics first, rigid body
objects/shapes might be set up for the fist time (see
`rigidbody_update_simulation`).

Here is my take on what happens when we run into the reported crash:

In `rigidbody_validate_sim_object`, `rigidbody_validate_sim_shape` can
be called (which -- amongst other things -- can call `RB_shape_delete`).
It does not set `RBO_FLAG_NEEDS_RESHAPE` nor calls
`RB_body_set_collision_shape`. It only sets `rbo->shared->physics_shape`
(which only seems to to update the "blender side of things", but not the
"bullet side of things").

Then later (still in `rigidbody_validate_sim_object`),
`RB_dworld_add_body`/ `btDiscreteDynamicsWorld::addRigidBody`>
`btCollisionWorld::addCollisionObject` > collisionObject->getCollisionShape()
 is called, but confused because we called `RB_shape_delete` before.

Also see the TODO(Sybren) comment from 98a0bcd425 (which might even be
removed with this PR, but not I havent verified "collision shape being
created twice" is now not happening anymore).

One might think that flagging `RBO_FLAG_NEEDS_RESHAPE` might be enough,
but reacting on that only happens later in `rigidbody_update_simulation`
(so not early enough to not run into the issues of `RB_dworld_add_body`
above).

So to resolve, call `RB_body_set_collision_shape` in
`rigidbody_validate_sim_shape` if we actually made a new one.

Fixes #130991

Pull Request: https://projects.blender.org/blender/blender/pulls/131039
2024-12-06 17:14:49 +01:00
Jonas Holzman
720fc44ca3 GHOST: Fix X11 clipboard selection requests
This commit fixes a pretty long-standing bug in the X11 clipboard code
which caused selection target requests (and thus pasting) to sometimes
fail on certain softwares like Firefox.

The problem lied in the fact that the property format used when setting
the supported target list was dependent on the original request, when
it should always be XA_ATOM (a list of Atom), this can be seen in other
implementations, like GLFW.

This commit also cleans up the surrounding code, by using m_atom to
access atoms instead of redeclaring them in the function, which also
clears up a few instance where the difference between `xse->target`
(the request target) and `target` (the TARGETS Atom) was really unclear.

Pull Request: https://projects.blender.org/blender/blender/pulls/131507
2024-12-06 17:10:50 +01:00
Sybren A. Stüvel
ff0a2d6dbf Anim: set default 'last slot handle' when versioning legacy Actions
Initialise the Action's `last_slot_handle` field to its default value.
The DNA 'defaults' system doesn't do this automatically when versioning
legacy Actions, so now it's done explicitly in the versioning code.

It's fine to only apply this to the existing versioning code, and not as
a new versioning rule. Existing slotted Actions should just keep that
field to whatever it is now.

The default value was introduced in be921b8ddb

Pull Request: https://projects.blender.org/blender/blender/pulls/131498
2024-12-06 17:03:37 +01:00
Alaska
afcad646bf Bug reporting: Install the Cycles debug script
cf8d31d41c added a debug script for
Cycles on Windows but didn't actually install it into the
Blender folder.

This commit fixes that by installing the script into the
Blender folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/131348
2024-12-06 16:55:36 +01:00
Weizhen Huang
bb3b8d78c2 Refactor: Cycles: split volume integration into smaller functions
Pull Request: https://projects.blender.org/blender/blender/pulls/131414
2024-12-06 16:23:04 +01:00
Weizhen Huang
59ad6d2b9c Refactor: Cycles: Extract code block to check homogeneous volume into a function 2024-12-06 16:23:00 +01:00
Weizhen Huang
13fb28581b Refactor: Cycles: Share function between volume scattering and shadowing 2024-12-06 16:23:00 +01:00
Weizhen Huang
910c2e2ba6 Refactor: Cycles: Add helper struct for stepping through the volume 2024-12-06 16:23:00 +01:00
Weizhen Huang
b16cfd2a87 Cleanup: Cycles: remove unused parameter absorption_only
`!vstate.absorption_only` is always false
2024-12-06 16:23:00 +01:00
Hans Goudey
4de00c1544 Cleanup: Move more ARegion runtime data out of DNA 2024-12-06 09:44:31 -05:00
Jeroen Bakker
09fe07b572 Vulkan: Pre-phase for initial uploading resources
Reduces the number of times a graphic context needs to be paused/resumed.
The scheduler reorders the nodes to put these initial data transfer nodes
to the start of the nodes that are about to be submitted.

Pull Request: https://projects.blender.org/blender/blender/pulls/131502
2024-12-06 15:34:03 +01:00
Hans Goudey
d9c7c90e45 Fix #131494: Editor merging can crash Blender
Missing copied runtime data in 129a2aa0f4.
2024-12-06 09:23:35 -05:00
Jeroen Bakker
d49218440f Fix #131474: Incorrect framebuffer configuration image engine overlays
When the overlay engine is used to draw over the image engine it uses
incorrect framebuffer configurations. It can attach and sample both the
depth buffer at the same time.

This PR fixes this by separating the output framebuffer into two. One
with and one without a depth buffer. And bind the correct one when
needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/131489
2024-12-06 15:00:53 +01:00
Campbell Barton
38a76db083 UI: remove redundant undo pushes for menu operators
Operators that trigger menus should not enable UNDO.

Resolves #95906

Ref !131467
2024-12-07 00:41:36 +11:00
Hans Goudey
4d3664fc43 Cleanup: Remove accidentally included debug print 2024-12-06 08:16:14 -05:00
Hans Goudey
21aef81714 Cleanup: Use StringRef and std::optional for UI string arguments
- Gives O(1) access to string length in more cases
- Convenient string manipulation functions
- Clarify difference between "no string" and "empty string"
- Avoid the need for raw pointers in the API
- Shows which API string arguments are optional

Pull Request: https://projects.blender.org/blender/blender/pulls/131473
2024-12-06 14:08:10 +01:00
Jeroen Bakker
28ea56b680 ImageEngine: Incorrect state when no image selected
When no image is selected the tile drawing state would be used of the
last known image. This can lead to drawing the checked background
everywhere.

Detected when researching #131474

Pull Request: https://projects.blender.org/blender/blender/pulls/131487
2024-12-06 12:40:45 +01:00
Pratik Borhade
210cef1c6c Fix #131367: Grease Pencil: Multiframe does not turn off in object mode
Add extra condition of object mode in boolean `do_multi_frame`, so
`hide_onion/skip_strokes` will be true in object mode, this will exclude
other curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/131416
2024-12-06 11:22:07 +01:00
YimingWu
db1613d5a9 Fix #131429: Grease Pencil: Allow moving strokes into hidden layers
Grease Pencil strokes should be able to move into hidden but not locked
layers. Use `get_drawings_at` instead of only `editable` one to achieve
this.

Pull Request: https://projects.blender.org/blender/blender/pulls/131435
2024-12-06 10:44:17 +01:00
Falk David
c1a021b0e8 Fix #130651: Tint tool does not show correct color in header
The issue was that the UI code still used the unified paint settings.
It was decided that in `PAINT_GREASE_PENCIL` mode we don't use
the unified paint settings and always use the settings on the brush.

The fix uses the `brush` as the owner of the `color` property instead
of the unified paint settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/131452
2024-12-06 10:38:57 +01:00
Aras Pranckevicius
ba0f9906ef Tests: Add more VSE modifiers render tests 2024-12-06 11:32:37 +02:00
Omar Emara
1732467bc6 Refactor: Move Blur Gamma Correction to its own algorithm
Move the Gamma Correction pass of blur nodes into its own algorithm to
avoid code duplication and optimize pixel access, since gamma is now
applied for each pixel in the filter window. Gives a 15% improvement.

Pull Request: https://projects.blender.org/blender/blender/pulls/131480
2024-12-06 08:14:26 +01:00
YimingWu
393c75cc39 Fix #131415: Grease Pencil: Bone transform when setting layer parent
When setting layer parent, if the parent is an armature object, then the
child bone matrix needs to be taken into account for doing inverse
transformations. This fix allows grease pencil layer to be parented to
a bone correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/131432
2024-12-06 07:28:52 +01:00
YimingWu
e7c2c079c4 Refactor: Restructure object type conversion code
This patch restructures `object_convert_exec`, separated conversion
calls for different source/target object type combination for better
readability, keeping each route relatively simple and easy to navigate.

Resolves #130653.

-----------

NOTE:

- Grease Pencil part is still WIP, the Grease Pencil -> Curves -> Mesh two stage conversion is not included in this new code yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/130668
2024-12-06 07:21:09 +01:00
Hans Goudey
efb808bffd Cleanup: Remove unused function
Missing change from f7089519e0.
2024-12-05 21:47:28 -05:00
Hans Goudey
cec874fed2 Fix: Add missing translation for UI text 2024-12-05 21:31:26 -05:00
Hans Goudey
f7089519e0 Cleanup: Remove unused UI function declaration 2024-12-05 21:31:25 -05:00
Harley Acheson
7c3db55b29 Refactor: Simplify Block Re-centering
PR #129125 allowed the movement of centered dialogs, like About and
Splash, without them snapping back to their original positions. But
that change was more complex than necessary. This returns
interface_region_popup.cc to exactly as it was before any of this, and
interface.cc gets simpler too. In a nutshell recentering these dialogs
is a lot easier that seemed at first.

Pull Request: https://projects.blender.org/blender/blender/pulls/131464
2024-12-06 00:57:32 +01:00
Sean Kim
9b9da3e5af Fix: Mesh Filter undo panel not undoing previous change
The `exec` callback was missing a call to `undo::push_end`, meaning that
using the undo panel would not undo the prior step, causing an
accumulative effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/131466
2024-12-06 00:45:21 +01:00
Clément Foucault
52463a5f0b GPU: Remove unused GPUDrawList API
This was only used by the legacy draw manager.
This one has already been removed.
2024-12-05 23:26:29 +01:00
Clément Foucault
3e9a2fbf23 Cleanup: Formating 2024-12-05 23:17:44 +01:00
Clément Foucault
994c43413a Metal: Remove SSBO Vertex Fetch
This API was used as a workaround to the lack of
geometry shader. It has been rendered redundant
since the introduction of #125782.
2024-12-05 22:58:52 +01:00
Sean Kim
8d9bf47ba6 Sculpt: Prevent entering mode when object is invisible
This is already prevented in the UI in both the top left mode selector
and the pie menu, this commit adds an actual check to avoid being put
into an invalid state by another operator or script.

Pull Request: https://projects.blender.org/blender/blender/pulls/130769
2024-12-05 22:48:20 +01:00
Clément Foucault
35c393acd6 Cleanup: DRW: Remove legacy resource handle
Pull Request: https://projects.blender.org/blender/blender/pulls/131456
2024-12-05 22:28:33 +01:00
Clément Foucault
db12edd825 Cleanu: DRW: Remove unused types 2024-12-05 22:27:38 +01:00
Clément Foucault
e2fb51b2e8 DRW: Remove legacy object data 2024-12-05 22:27:38 +01:00
Clément Foucault
897d24d193 DRW: Remove legacy view layer attribute support 2024-12-05 22:27:38 +01:00
Clément Foucault
35beef96fd DRW: Remove legacy DRWPass structures and storage 2024-12-05 22:27:38 +01:00
Clément Foucault
459c65f993 Cleanup: DRW: Remove legacy object attributes 2024-12-05 22:27:38 +01:00
Clément Foucault
04282ef91e DRW: Remove draw lists 2024-12-05 22:27:38 +01:00
Jacques Lucke
7bd120955b Nodes: use topology cache directly for is_linked property in Python
Not sure if this makes a practical difference currently. However, it's good
to avoid depending on `SOCK_IS_LINKED` which is phased out more and more.

The topology cache should always be more up to date.
2024-12-05 20:49:55 +01:00
Hans Goudey
2a8f671070 Cleanup: Formatting 2024-12-05 14:47:59 -05:00
Jacques Lucke
680dbe70ae Fix: Nodes: use name as fallback for socket identifiers
This was probably accidentally broken in 7348e670b3.
2024-12-05 20:28:27 +01:00
Jacques Lucke
36b7cda4db Fix #89109: missing node tree update when NodeSocket.enabled is changed 2024-12-05 20:17:31 +01:00
Clément Foucault
568d45a90d Cleanup: Overlay: Remove global DST access through DRW_text_cache_ensure 2024-12-05 20:03:10 +01:00
Clément Foucault
9c7e18f515 DRW: Remove legacy state tracking
Fixes assert caused by uninitialized memory.
2024-12-05 20:03:10 +01:00
Clément Foucault
f9107c4f25 DRW: Remove legacy instance buffers
No functional change expected.
2024-12-05 20:03:10 +01:00
Clément Foucault
7271a6d7f9 DRW: Remove draw_manager_exec.cc
This moves the state reset to be done by
the `StateSet` command.
2024-12-05 20:03:10 +01:00
Clément Foucault
bcf297d971 Cleanup: DRW: Remove unused code 2024-12-05 20:03:10 +01:00