Commit Graph

147884 Commits

Author SHA1 Message Date
Michael Jones
1a93dfe4fc Cycles: Apple Silicon tidy: Remove non-UMA codepaths
This PR removes a bunch of dead code following #123551 (removal of AMD and Intel GPU support). It is safe to assume that UMA will be available, so a lot of codepaths that dealt with copying between CPU and GPU are now just clutter.

Pull Request: https://projects.blender.org/blender/blender/pulls/136117
2025-03-18 19:09:25 +01:00
Bastien Montagne
7bf17d83ab Cleanup: blenfont & blentranslation: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136126
2025-03-18 18:25:50 +01:00
Harley Acheson
4894c888ee BLF: Configurable Line Breaking Behavior
The PR allows specifying the method of line breaking. Current functions
gain an optional argument that defaults to "Minimal" which breaks as it
does now, only on space and line feed. "Typographical" breaks on
different types of spaces, backslashes, underscore, forward slash if
not following a number, dashes if not following a space, Chinese,
Japanese, and Korean Ideograms, and Tibetan intersyllabic marks. "Path"
breaks on space, underscore, and per-platform path separators. There is
also a "HardLimit" flag that forces breaking at character boundary at
the wrapping limit.

Pull Request: https://projects.blender.org/blender/blender/pulls/135203
2025-03-18 18:02:36 +01:00
Julian Eisel
7a6beb65f4 Asset Browser: Add import settings popover, move import method into it
Part of #134755 / #134766.

Replaces the current import method menu in the middle of the Asset
Browser header with a "Import Settings" popover. The import method is
located there now, because it doesn't need to be as prominent as it used
to be, especially with #104686.

Plan is to add further settings to this popover, e.g. see #135996 or
 #134943.
2025-03-18 17:49:44 +01:00
Clément Foucault
2892b494bd Cleanup: DRW: Remove some global access to DRWContext
Rel #136090
2025-03-18 17:48:54 +01:00
Clément Foucault
8c7cb9d3c7 Cleanup: DRW: Flatten global access to DRWContext
Rel #136090
2025-03-18 17:28:00 +01:00
Harley Acheson
745509a0ab Fix #136119: Remove Warning Message With Save As
Regular "Save As" does not set "incremental" property, either true or
false, which results in a warning message. This PR just handles the
reading of this optional property properly by checking existence first.

Pull Request: https://projects.blender.org/blender/blender/pulls/136127
2025-03-18 17:23:35 +01:00
Bastien Montagne
9fcec54c93 Cleanup: blenloader: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136121
2025-03-18 16:14:26 +01:00
Omar Emara
781dea8442 Cleanup: Compositor: Use default case for blur types
Use a default case for blur type switch case, that's because adding all
types is not necessary, and I am trying to differentiate between switch
cases that need full type enumeration and those that do not.
2025-03-18 16:15:27 +02:00
Pratik Borhade
ba2e567efb Grease Pencil: Drawing API functions to assign/remove vertex group data
Currently there is no python api function to assign/remove vertices to specific
vertex group. Traditional `object.vertex_groups[0].add/rna_VertexGroup_vertex_add`
didn't work, because Grease Pencil stores deform verts and vertex group
on individual drawings. Now intorduced a new function
`vertex_group_assign` and `vertex_group_remove` on `Drawing`.

Resolves #135281.
Resolves #134678.

Example (just add GP Suzanne):
```
import bpy

C = bpy.context

drawing = C.active_object.data.layers['Lines'].current_frame().drawing
drawing.vertex_group_assign(vgroup_name="Group", indices_ptr=[2, 6, 10, 18, 19, 20], weight = 0.9)
drawing.vertex_group_remove(vgroup_name="Group", indices_ptr=[2, 6, 10])
```

Pull Request: https://projects.blender.org/blender/blender/pulls/135283
2025-03-18 15:11:09 +01:00
Omar Emara
0a57002469 Cleanup: Compositor: Remove redundant SMAA types
This patch removes code that handles types other than Float and Color,
that's because SMAA is practically only used for those types only.
2025-03-18 15:51:51 +02:00
Omar Emara
383a6ce654 Refactor: Compositor: Formalize single value data update
This patch formalizes the process of data updates of single values.
Previously, this was done internally in the set_single_value method, but
there was a hack in multi-function procedure code to do the same. This
patch adds a new method for single value data updates and uses it
internally in set_single_value.
2025-03-18 15:03:55 +02:00
Bastien Montagne
24e3010e50 Cleanup: freestyle: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136118
2025-03-18 13:57:00 +01:00
Germano Cavalcante
015b7483e7 Fix #136061: Shear and Edge Slide not displaying custom keys in statusbar
Since 40eadc75be, `ED_workspace_status_text` is now called at the
beginning of the modal function.

This clears any custom keymap and redraws the status bar.

The `Edge Slide` and `Shear` operations only update the status bar if a
modal key is pressed (not on mouse move).

The solution to avoid losing custom modal keys, and not having to
update the status bar more often is: call `ED_workspace_status_text`
only when an operation that requires redraw is performed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136101
2025-03-18 12:46:56 +01:00
Germano Cavalcante
94a8b5f607 Revert "Fix #136061: Modeling: Always update status bar on shear/edge slide."
This reverts commit b02c83386b.

The problem has not been fully resolved (there is a glitch in the
status bar when changing operations).

A newer, even more efficient solution is on the way.
2025-03-18 08:42:10 -03:00
Campbell Barton
3f9c08d960 Docs: add a doc-string for rotation_mode
Based on the report #135332, it's not obvious that rotation modes that
aren't selected aren't used, note this in the doc-string.

Ref !136103
2025-03-18 22:39:30 +11:00
Campbell Barton
5fc3303a35 Fix assert drawing the knife tool points with the Vulkan backend
Using the knife tool with Vulkan failed because using
GPU_PRIM_POINTS isn't supported with the GPU_SHADER_3D_UNIFORM_COLOR
shader.

Resolve using a shader intended for drawing points.

Ref !136109
2025-03-18 22:36:13 +11:00
Campbell Barton
c3320a1082 Fix crash starting with only the Vulkan backend enabled
When built with only the Vulkan back-end this wasn't being checked for
causing Blender to start with no GPU backend which crashed.

Ref !136110
2025-03-18 22:23:15 +11:00
Bastien Montagne
015f8150a2 Cleanup: geometry: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136116
2025-03-18 11:58:05 +01:00
Jeroen Bakker
4429cc7e84 Fix: Vulkan: Incorrect framebuffer selection
When swap chain is updated the logic could select an incorrect
framebuffer. This isn't actually the case during normal usage, but has
been detected during the development of OpenXR support. Here it did
matter.

Pull Request: https://projects.blender.org/blender/blender/pulls/136115
2025-03-18 11:49:52 +01:00
Omar Emara
ebaa12af6c Refactor: Compositor: Use data sharing for SMAA
Use data sharing instead of copying in the SMAA algorithm. This reduces
redundant copies and code duplication.
2025-03-18 12:38:48 +02:00
Bastien Montagne
9139005e82 Fix building on Clang19 on Linux.
Commit e9a21cf14c seems to have removed a bit too many includes, this
reverts one change, which seems to be enough to get it working again.

Will let @deadpin decide whether we keep this 'include all' header
include here, or go more refined in our includes.
2025-03-18 11:23:39 +01:00
Campbell Barton
b77d77af40 Refactor: add utility object & pchan setters, respecting protected flags
Add "set" functions for location, scale & rotation that leave
protected channels untouched.

Ref !136104
2025-03-18 20:36:57 +11:00
Omar Emara
a345c4597e Refactor: Compositor: Use GPU setter nodes for unlinked sockets
This patch refactors how values of unlinked sockets are provided to
nodes. Previously, the GPU node stack values were initialized at
construction time and linked by the node's compile methods. This meant
that we needed to handle implicit conversion if the socket is linked to
an unlinked node group input.

Alternatively, we now insert a GPU setter node for each unlinked socket
that carries the value and type of the origin socket, and let the GPU
code generator do implicit conversion at the shader level. This has
three advantages:

- It makes it easier to add new types since we no longer have to handle
  those types in shader node code and it reduces code duplication.
- It makes the code more inline with how we implement multi-function
  procedures. So refactoring is easier.
- It opens the door to implement things like implicit inputs, which will
  be needed later for things like texture nodes.
2025-03-18 11:23:43 +02:00
Bastien Montagne
1ff24efa02 Cleanup: ikplugin: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/136095
2025-03-18 10:14:53 +01:00
Bastien Montagne
b87b58b07e OBJ Export: Update 'bitflag smoothgroup' to also consider boundary vertices.
Previous code would consider two different face groups sharing no common
edges as fully isolated from each other, and could assign them the same
bitflag facegroup value.

Following FBX recent option to export these bitflags smoothgroups (!135646),
also consider that two different face groups are connected if they only share
common vertices, and assign them different bitflags values.

NOTE: This seems to be the expected behavior in major DCCs actually
using smoothgroups, only considering boundary edges create groups that
generate broken shading when imported by these tools.

NOTE: The 'unique integer identifers' option is kept for OBJ exporter,
as such OBJ files are also found on internet, depending on which app
generated them.

Pull Request: https://projects.blender.org/blender/blender/pulls/135998
2025-03-18 10:04:38 +01:00
Philipp Oeser
d6da557358 Fix #135955: OSL Window texture coordinate wrong for panoramic cameras
There is code that properly handles panoramic cameras in
`camera_world_to_ndc`, the transform matrices (e.g.
`OSLRenderServices::get_inverse_matrix`) in the `transform("NDC", P)`
call dont do the "full work" here (maybe they should though?).

But we can get to `camera_world_to_ndc` by just getting the "NDC"
attribute, so use that for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/136097
2025-03-18 09:11:45 +01:00
Martin-Vignali
985f6f82b6 UI: Output > FFmpeg Video hide useless parameters for some codecs
Before this patch, Video Output using FFmpeg video
display lot of parameters.

But some of theses have a meaning only for some codec
(mainly lossy gop codecs : H264, H265, AV1...)

Hide not useful parameters for codec :
'DNXHD', 'FFV1', 'HUFFYUV', 'PNG', 'QTRLE'

- DNXHD : intra frame codec, encoding setting depends of a profile
- FFV1/QTRLE : Intra or P frames only. Lossless codec
- HUFFYUV/PNG : Intra lossless codec

Co-authored-by: mvji <33432858+mvji@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/135827
2025-03-18 09:11:14 +01:00
Jesse Yurkovich
e9a21cf14c Cleanup: USD: various non-functional changes
- Use const in more places
- Use more appropriate headers and forward decls elsewhere
- Remove one instance of variable shadowing
- Rename an internal rna enum list and the USD operator property object
  to follow surrounding code and naming guidelines

Pull Request: https://projects.blender.org/blender/blender/pulls/136112
2025-03-18 07:18:19 +01:00
Richard Antalik
d267ec3ec1 Fix #135968: Sound strip offset limit is hardcoded to 0
This seems to be remains of code from time when sound offsets were
clamped to non negative values and start/endstill offsets were used to
offset strip handles from sound content.

Since start/endstill offsets were merged with start/endofs, this limit
should have been removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136015
2025-03-18 07:12:50 +01:00
Alaska
7e7594c7ff Tests: Add Cycles test for transparent spatial splitting artifacts
With the HIPRT backend for Cycles, rays can end up hitting the same
triangle multiple times due to a issue in the spatial splitting
algorithm.

Most of the time this issue isn't visible, but it is quite obvious in
semi-transparent shadows of meshes.

So this commit adds a file that contains a object made up of many
semi-transparent rectangular prisms casting a shadow onto the a plane.

Ref: blender/blender#117527
Ref: blender/blender-test-data!76
2025-03-18 02:01:41 +01:00
Aras Pranckevicius
b20042172c Tests: add more FBX import tests
Add some more import test cases:
- Material animation,
- Automatic bone orientation setting,
- Force connect armature children setting

Pull Request: https://projects.blender.org/blender/blender/pulls/136096
2025-03-17 20:01:19 +01:00
Philipp Oeser
e22ff684f3 Cleanup: Anim: convert cstyle-casts
Using clang-tidy "cppcoreguidelines-pro-type-cstyle-cast" to find them.

This PR touches `bf_animrig` & `bf_editor_animation` & `bf_editor_armature`

NOTE: Also some case where untouched (not straightforward) same as
expanded macros (e.g. `LISTBASE` or `GS`)
NOTE: a couple of cases of "inconsistent-declaration-parameter" as well

Pull Request: https://projects.blender.org/blender/blender/pulls/136044
2025-03-17 19:49:45 +01:00
Jesse Yurkovich
e93c6e5f74 USD: Eliminate some unintentional VtArray copies
The `pxr::VtArray<T>` type is based on a copy-on-write scheme that is
very easy to trigger unnecessarily because of how the C++ type system
works[1].

Here we bypass unneeded copies by ensuring we always call the `const`
version of various accessor functions. The offending call-sites were
found by using the `VT_LOG_STACK_ON_ARRAY_DETACH_COPY` env variable.

This yields a very small 2-3% performance benefit when loading in a
typical, mixed-use, asset like e.g. the "4004 Moore Lane" scene.

[1] https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/vt/array.h#L139

Pull Request: https://projects.blender.org/blender/blender/pulls/136014
2025-03-17 17:59:17 +01:00
Aras Pranckevicius
c34c1e2812 Tests: more consistently in import test output
- Print negative/positive zeroes the same in more places,
- Sort emitted fcurves, armature bones by name
- More FBX test files from various bug reports

Pull Request: https://projects.blender.org/blender/blender/pulls/136089
2025-03-17 17:30:33 +01:00
Falk David
5d5782571e Fix #136036: Grease Pencil: SVG export not working for non-poly types
To fix this in the most non-intrusive way, we essentially do what
the modifiers do which is to convert everything to poly curves.
This is also what GPv2 used to do.

Ideally, we would export non-poly curves as bézier curves in the
supported SVG format.

Pull Request: https://projects.blender.org/blender/blender/pulls/136088
2025-03-17 17:29:52 +01:00
Bastien Montagne
5caf8dd4ce Merge branch 'blender-v4.4-release' 2025-03-17 17:26:14 +01:00
Bastien Montagne
1a0dc71cdb I18N: Updated UI translations from git/weblate repository (70a16f8e36ecc). 2025-03-17 17:25:00 +01:00
Clément Foucault
0105b33a5f Refactor: DRW: Move some functions to DRWContext
This reduces the API and make it more clear where there
is the global access.

This also removes some of these global access by merging
the `DRW_context_get()` calls.
2025-03-17 17:19:13 +01:00
Clément Foucault
686c571c09 Cleanup: Overlay: Remove DRWContext C-API calls 2025-03-17 16:24:23 +01:00
Clément Foucault
8d8b20f31f Cleanup: EEVEE: Remove workaround for state functions
Now the states are set accordingly inside the init function.
2025-03-17 16:24:23 +01:00
Brecht Van Lommel
9984adc7de Merge branch 'blender-v4.4-release' 2025-03-17 16:19:46 +01:00
Sergey Sharybin
51169485ab Merge branch 'blender-v4.4-release' 2025-03-17 16:18:36 +01:00
Brecht Van Lommel
f896f7ffc3 Fix #136047: Cycles OSL gettextureinfo crash with missing image
Missing null pointer check.

Pull Request: https://projects.blender.org/blender/blender/pulls/136075
2025-03-17 16:18:31 +01:00
Sergey Sharybin
44c01ff893 Fix: Incorrect platform tag used for WoA bpy
The platform tag came from virtualized CPU on which Python 3.9 is
running on the buildbot.

Use the same trick to detect the host CPU as for the message on the
splash screen.

Pull Request: https://projects.blender.org/blender/blender/pulls/136085
2025-03-17 16:18:19 +01:00
Clément Foucault
894c7fa4e2 EEVEE: Remove EEVEE Next mention inside the code
This only changes file and function names.
The EEVEE identifier is still `BLENDER_EEVEE_NEXT`.

No functional changes.
2025-03-17 15:37:04 +01:00
Jeroen Bakker
5a3fd4522c Fix #135929: Vulkan: Add support for line loops in immediate rendering
Currently only implemented for immediate mode. When used it copies the
first vertex to the last vertex to complete the loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/136083
2025-03-17 15:32:49 +01:00
Clément Foucault
e08c64d68e Cleanup: DRW: Remove DrawData
These have been replaced by better alternatives overtime.

Pull Request: https://projects.blender.org/blender/blender/pulls/136073
2025-03-17 15:16:07 +01:00
YimingWu
b02c83386b Fix #136061: Modeling: Always update status bar on shear/edge slide.
When a input event is handled but `status.opmodal` is not explicitly
requested, `WM_window_modal_keymap_status_draw` will override the status
bar message, then the tool hint would be incorrect. This applies to
shear and edge slide operators. Seemingly introduced by 6d5d3ce. The
fix is to not ignore mouse move event when updating status bar as they
also causes viewport redraw.

Pull Request: https://projects.blender.org/blender/blender/pulls/136063
2025-03-17 14:29:28 +01:00
Clément Foucault
959d82f2ab Merge branch 'blender-v4.4-release' 2025-03-17 14:25:43 +01:00