Commit Graph

150077 Commits

Author SHA1 Message Date
Clément Foucault
dafa3fb88f Fix #129019: Crash when switching from EEVEE to Cycles while rendering animation
When changing render engine, we discard the persistent data
that could be saved for all the current render instance that
exists. This is to save memory for the new renderer.

When doing so while rendering for F12, `engine_depsgraph_free`
is called after waiting for the render to finish. But this
can be called before the renderer destruction and on the main
thread.

Doing so on the main thread means that the `gpu_context` used
by the renderer cannot be bound for the sake of just receiving
the orphan buffers that the depsgraph holds. This is because
only the worker thread can make the gpu context active.

Binding the draw gpu context in this situation avoid all
possible conflict.

This is basically doing exactly what the
`DRW_render_context_enable/disable` function is doing internally
if the render engine gpu context is null.

Pull Request: https://projects.blender.org/blender/blender/pulls/129982
2024-11-11 11:29:54 +01:00
Falk David
2a129f8762 Merge branch 'blender-v4.3-release' 2024-11-11 11:02:35 +01:00
Falk David
01db47b82c Fix #129766: GPv3: Fallback to "frames" mode in build modifier for natural drawing speed
The issue was that if the `delta_time` attribute didn't exist, the drawing
would appear immediatley.
In case we don't have any drawing speed information, the fix
makes it so that we fallback to use the number of frames
to build the strokes.

Pull Request: https://projects.blender.org/blender/blender/pulls/130035
2024-11-11 10:39:23 +01:00
Omar Emara
4ab01178e2 Compositor: Implement Anti-Alias node for new CPU compositor
Reference #125968.
2024-11-11 09:25:27 +02:00
Omar Emara
22b3aff9c8 Compositor: Implement SMAA for new CPU compositor
Reference #125968.
2024-11-11 09:24:51 +02:00
Omar Emara
a40046eae5 Compositor: Support bilinear sampling for new CPU compositor
Reference #125968.
2024-11-11 09:08:56 +02:00
Omar Emara
547723debf BLI: Add alias for uchar2 vector type 2024-11-11 09:05:59 +02:00
Clément Foucault
63a91c8d82 Fix: DRW: Tests: GPU backend error because of missing resources 2024-11-10 23:47:21 +01:00
Bastien Montagne
c18ec7e2ad Fix wrong link in Py API docs after recent refactor. 2024-11-10 18:48:56 +01:00
Bastien Montagne
d5c50fc366 API docs: Split 'Gotchas' page, add some info about python instances and subclasses.
This PR:
* Splits the `Gotchas` page into several sub-sections. This was getting too big and hard to navigate.
* Adds some information regarding Python instances life-time of objects wrapping Blender internal data.
* Adds some information about usage of constructors and destructors for sub-classes of Blender-defined types.

Pull Request: https://projects.blender.org/blender/blender/pulls/129814
2024-11-10 18:40:14 +01:00
Bastien Montagne
2910f6dce9 Cleanup: API docs generator: Remove references to removed GP(v2) types. 2024-11-10 18:27:10 +01:00
Bastien Montagne
246b43e136 Merge branch 'blender-v4.3-release' 2024-11-10 18:24:49 +01:00
Clément Foucault
e9252f206b GPU: Comment out test not compatible with metal backend
These test are either not compatible because of the
spec or are just broken in the current state of the backend.

These should be dealt with soon.
2024-11-10 15:16:34 +01:00
Clément Foucault
e79f12cf43 Fix: GPU: Broken static shader tests
Caused by 5d162719ba
2024-11-10 15:16:34 +01:00
Clément Foucault
8260e3aa81 GPU: Simplify framebuffer tests 2024-11-10 15:16:34 +01:00
nutti
1c8669f8c9 Fix: sphinx_doc_gen.py syntax error while generating PyDoc
Ref !130085
2024-11-10 23:35:45 +11:00
quackarooni
ab051e1f17 Fix: GPv3: "Lineart" and "Opacity" modifier don't follow alphabetical order
The `Lineart` and `Opacity` modifier appear at the bottom of their respective
menus instead of following alphabetical order. There doesn't seem to be any
conceivable reason to do this, and it is inconsistent with how the modifiers
were laid out in older Blender versions. Fixes the order of the modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/130080
2024-11-10 12:20:31 +01:00
Pratik Borhade
079ccd87c5 Cleanup: GPv3: Remove unnecessary check
Not required after 5f5b1b83d0

Pull Request: https://projects.blender.org/blender/blender/pulls/128693
2024-11-10 07:48:23 +01:00
Campbell Barton
86c5c4af6e Merge branch 'blender-v4.3-release' 2024-11-10 14:50:02 +11:00
Lukasz Czyz
9b3108462f Fix #129925: SLIM UV unwrap with holes
Assignments to UnwrapOptions overwrote the values set by
unwrap_options_get().

Ref: !130041
2024-11-10 14:45:18 +11:00
Clément Foucault
f67ea33993 Cleanup: Metal: Fix clang-tidy warnings
Replace != "" by more semanticaly friendly `is_empty`.
2024-11-10 00:29:03 +01:00
Jesse Yurkovich
33482bdd3a Merge branch 'blender-v4.3-release' 2024-11-09 13:19:29 -08:00
Jesse Yurkovich
f0e2d7e5ca Fix #107696: Use correct API when importing USD mesh vertex normals
This seems like a long-standing misuse of the custom vert normal APIs.
It broke, obviously so, in 3.1 but 3.0 was also rather fragile as was
noted in the original bug report.

The `BKE_mesh_set_custom_normals_from_verts` should be the correct API
to use when loading in vert normals from external files. The current
code would yield faceted mesh shading, as-if there were no custom
normals at all.

Pull Request: https://projects.blender.org/blender/blender/pulls/130069
2024-11-09 22:18:31 +01:00
Clément Foucault
85f6350c0f Fix: GPU: Missing include breaking shader tests 2024-11-09 21:50:37 +01:00
Clément Foucault
6f4b106da3 Metal: Refactor format conversion logic
Simplify the logic and handle all cases.
2024-11-09 21:50:37 +01:00
Clément Foucault
5d162719ba Cleanup: Metal: Fix clang-tidy warning
Replace size > 0 by more semanticaly friendly `is_empty`.
2024-11-09 21:50:37 +01:00
Clément Foucault
9b91a42240 GPU: Improve fetch mode tests to cover GPU_FETCH_INT_TO_FLOAT_UNIT 2024-11-09 21:50:37 +01:00
Clément Foucault
2738e33a58 GPU: Silence invalid fetch mode tests on Metal
These vertex buffer setup are invalid on metal.
For now simply disable them on Apple hardware.
2024-11-09 21:50:37 +01:00
Clément Foucault
ef8ea88f5f Fix: GPU: Tests not passing on Metal with ASAN on
Fixes a few stack overflow error, reduce framebuffer size
to avoid errors flooding the output.
2024-11-09 21:50:37 +01:00
Habib Gahbiche
81ea699ebf Cleanup: WITH_COMPOSITOR_CPU now refers to Full-Frame compositor, not tiled.
Pull Request: https://projects.blender.org/blender/blender/pulls/129554
2024-11-09 14:15:27 +01:00
Campbell Barton
db62ddd57c Merge branch 'blender-v4.3-release' 2024-11-09 13:20:40 +11:00
Campbell Barton
a3773c827d Merge branch 'blender-v4.3-release' 2024-11-09 13:20:38 +11:00
Campbell Barton
f026c3a80f Merge branch 'blender-v4.3-release' 2024-11-09 13:20:36 +11:00
Campbell Barton
325c8c0190 PyDoc: add doc-string for addon_utils.extensions_refresh 2024-11-09 13:19:27 +11:00
Campbell Barton
63c56a5d67 PyDoc: show keyword-only signifier for all RNA functions 2024-11-09 13:19:26 +11:00
Campbell Barton
56cea4a36b Fix PyDoc: Invalid signature for functions without arguments
Ref: !130031
2024-11-09 13:17:43 +11:00
Campbell Barton
9ee8e00fbc Merge branch 'blender-v4.3-release' 2024-11-09 11:46:44 +11:00
Campbell Barton
cd07e729a2 Fix #130024: addon_utils.enable(..) doesn't setup extensions wheels
addon_utils.enable/disable now handle wheels so that the functions can
be used with extension add-ons.

A new argument `refresh_handled` supports scripts handing refresh
themselves which is needed to avoid refreshing many times in cases
when there are multiple calls to enable/disable.

This is mostly useful for internal operations.
2024-11-09 11:44:34 +11:00
Jonas Holzman
263212c4fa Merge branch 'blender-v4.3-release' 2024-11-09 01:35:36 +01:00
Jonas Holzman
574e08272c Cleanup: make format 2024-11-09 01:33:16 +01:00
Jonas Holzman
13c31f3912 Fix #129424: macOS Image Editor Copy/Paste upside down
This commits fixes a bug where the new macOS Image Editor image copy
paste feature was correctly pasting images from macOS to Blender, but
wrongly copying image from Blender to other software upside-down.
This was fixed by porting the row inversion logic present in
GHOST_SystemCocoa::getClipboardImage to the putClipboardImage function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129938
2024-11-09 01:30:03 +01:00
Campbell Barton
eb390425f3 Fix missing extensions refresh after the repository config changed
Enabling/disabling a repository was not refreshing its wheels or
compatibility data.
2024-11-09 11:10:26 +11:00
Jonas Holzman
5b30f82d2c Fix #129424: macOS Image Editor Copy/Paste upside down
This commits fixes a bug where the new macOS Image Editor image copy
paste feature was correctly pasting images from macOS to Blender, but
wrongly copying image from Blender to other software upside-down.
This was fixed by porting the row inversion logic present in
GHOST_SystemCocoa::getClipboardImage to the putClipboardImage function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129938
2024-11-08 23:28:53 +01:00
Germano Cavalcante
7ce080cf72 Refactor: prevent storing dangling pointers
The `_EXCEPTION_POINTERS` structure is valid only within the context of
the `UnhandledExceptionFilter` function.

After the function exits, the memory referenced by the pointer might no
longer be valid or the exception information.

The solution for this was to create `BLI_system_backtrace_with_os_info`
and passing a system-specific data as the second argument.
`BLI_system_backtrace` calls `BLI_system_backtrace_with_os_info` with a
null second argument internally.

Pull Request: https://projects.blender.org/blender/blender/pulls/129999
2024-11-08 23:17:36 +01:00
John Kiril Swenson
65018a1557 Merge branch 'blender-v4.3-release' 2024-11-08 14:31:49 -06:00
John Kiril Swenson
8bbe0bc838 Fix #129947: VSE: B to box-select on strips
d2a802d3c6 got overzealous by removing the "tweak" property which was
actually necessary to differentiate box select on click-drag vs. box
select on B. Fix by restoring the tweak property for everything but
preview keymap items (where it doesn't actually do anything).

Main reason this happened is because the original description was a bit
too cryptic, so update it to be clearer.

Pull Request: https://projects.blender.org/blender/blender/pulls/130015
2024-11-08 21:29:53 +01:00
Clément Foucault
654cc9ed36 GPU: Fix printf force injection logic and limit it to material shader
This fixes backend error caused by missing resource.
2024-11-08 20:20:07 +01:00
Clément Foucault
93a10cbf7e GPU: Enable printf only between render boundaries and use a stack
Printf buffer read needs to be inside render boundaries
to work. Since render boundaries can be nested, use a stack.

Fixes assert when quitting blender.
2024-11-08 20:01:08 +01:00
Clément Foucault
9dbfa1f81c Merge branch 'blender-v4.3-release' 2024-11-08 18:49:52 +01:00
Clément Foucault
03d31a3717 Fix #128712: Workbench: Crash dragging window to another screen
The crash was caused by the texture wrapper being out of date.
This happened after workbench finished rendering AntiAliasing and
going into blit-result-only mode. Doing so was causing a use after
free caught by ASAN.

But this only partially fix the bug as workbench render then becomes
uninitialized (black most likely) after dragging the window to the
second monitor. This is because the TAA texture gets recreated since
the new viewport resolution doesn't match the old one. But this
recreation does not tag as a viewport update so the TAA stays in
blit-result-only mode.

Detecting the viewport resolution change at the engine init level
seems the safest option for now, and it fixes the remaining issue.

To be backported to 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/130043
2024-11-08 18:47:20 +01:00