Commit Graph

144096 Commits

Author SHA1 Message Date
Harley Acheson
bc430c4e67 Fix #131017: Improve Subframe Tooltip
Change Timeline "Show Subframes" property description from "Show
current scene subframe and allow set it using interface tools" to
"Display and allow setting fractional frame values for the current
frame".

Pull Request: https://projects.blender.org/blender/blender/pulls/131115
2024-12-02 19:18:28 +01:00
Hans Goudey
d04ac76ed8 Fix #131214: Geometry Nodes: Crash due to Free curve normals 2024-12-02 13:11:52 -05:00
Julian Eisel
6e44380e8d Fix #131185: Active object asset preview operator broken for node groups
03ae57dd8b extended poll functions to check if a given ID would result
in a non-empty preview using the automatic preview, but covered too many
operators. This check does not make sense for the Load Custom Preview,
or the Render Active Object operators. The former was fixed in
de487a6712, but turns out the same fix needs to be applied for the
latter too.
2024-12-02 18:51:56 +01:00
Hans Goudey
b5a2858fab Fix #131194: Crash with animated geometry nodes math node operation
The animation system can't properly update the node tree to regenerate
all the necessary information when changing the operation. The operation
changing with animation also invalidates some assumptions we make to
improve performance, and the complexity of supporting it isn't worth
the questionable utility.

Similar to 7797fcc3c9 and dc9249c97f.

Pull Request: https://projects.blender.org/blender/blender/pulls/131252
2024-12-02 18:42:52 +01:00
Philipp Oeser
914e824900 Cleanup: typo in Sculpt function name
Unnoticed since 4a373afa5f

Pull Request: https://projects.blender.org/blender/blender/pulls/131160
2024-12-02 18:27:20 +01:00
Jesse Yurkovich
3bb6e8f1b8 Cleanup: Remove old embedded preview_grease_pencil_legacy.blend
Looks like a simple leftover. The linkers are smart enough to completely
exclude this from the final binary so this is only targeting `main` as a
general cleanup.

Part of #130518.

Pull Request: https://projects.blender.org/blender/blender/pulls/129271
2024-12-02 18:07:57 +01:00
Nathan Vegdahl
089c3cd85c Refactor: rename ChannelBag and channel_bag
We've had a bunch of inconsistency between `channel_bag` and `channelbag` in the
code base.  After discussion with @dr.sybren, we decided to standardize on
`channelbag` and also rename the camelcase `ChannelBag` to `Channelbag` to be
consistent with that.

This PR implements those changes.

Note that the reason we standardized on `channelbag` rather than `channel_bag`
is because it makes things clearer when stringing multiple terms together in
type and function names.  For example, in `channelbag_fcurves_move()` it makes
it clear that `channelbag` describes one thing, rather than `channel` and `bag`
being two separate things.

No functional changes intended.

Pull Request: https://projects.blender.org/blender/blender/pulls/130988
2024-12-02 17:55:59 +01:00
Bastien Montagne
0a45cb3867 I18N: Update UI translations from git/weblate repository (f3f7d5a3593c1e). 2024-12-02 17:55:13 +01:00
Omar Emara
6879d924eb Fix: Compositor: Unlinked group inputs are ignored
The new CPU compositor ignores group inputs that are unlinked. This
patch fixes that by considering all origin sockets in multi-function
procedures, be it an input or an output.
2024-12-02 18:52:44 +02:00
Omar Emara
c2b1b84094 Cleanup: Remove unused variable 2024-12-02 18:51:41 +02:00
Clément Foucault
4bfaecc340 Fix #131212: Metal: Non-aligned circular buffer allocation logic
The new buffer size could have been non aligned when using the
fractional growing heuristic. This non aligned allocation
would then trigger an assert at the SSBO constructor.

Aligning the alocation size fixes the issue.
2024-12-02 17:34:35 +01:00
Jonas Holzman
62b2bb48e8 macOS: CMake: Fix last CMP0177 policy warnings
This commit fixes the last few CMake CMP0177 policy warnings on macOS.

Follow-up to: #130602 and 536937b4d4

Pull Request: https://projects.blender.org/blender/blender/pulls/131219
2024-12-02 17:15:58 +01:00
Omar Emara
eaa0ae23a9 Fix: Lighten blend mode is wrong for factors less than 1
The Lighten blend mode is wrong for factors less than 1, as it is
computed as a weighted maximum using the factor as the weight, while it
should be a simple component-wise maximum.

This is correctly implemented for Compositor, EEVEE, and Cycles. But the
render/material implementation is wrong. So we adjust the implementation
to match the correct one.

The Darken counterpart was already fixed in 1dcf956849. While the
lighten was fixed in 8b7b165ad9 among other patches. This just completes
the fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/131242
2024-12-02 17:12:08 +01:00
Nathan Vegdahl
aa83738d44 Anim: change parameters of slots.new() RNA function
`Action.slots.new()` in the Python API previously took either an ID or nothing
as a parameter. In the former case it would create a slot with the appropriate
`id_root` and name for that ID. In the latter case it would create a default
slot with an unspecified `id_root` and default name.

This had several issues:

1. You couldn't create a slot with a specific `id_root` without already having
   an ID of that type. In theory this isn't a problem, but in practice in larger
   scripts/addons you don't necessarily have such an ID on hand at the call
   site.
2. You couldn't directly create a slot with a desired name without an existing
   ID with that name. This isn't so important, since you can always just set the
   name afterwards. But it's a bit annoying.
3. Most other `new()` APIs in Blender *require* you to specify the name of the
   item being created. So calling this with no parameters was violating that
   norm.
4. Ideally, we want to eliminate unspecified `id_root`s, since they cause other
   weirdness in the API such as slot identifiers changing upon slot assignment.

To resolve these issues, and just generally to make the API more
straightforward, this PR changes `slots.new()` to take two required parameters:
an ID type and a name. For example:

`slots.new(id_type='CAMERA', name="My Camera Data Slot")`.

This fully specifies everything needed for the slot identifier upon creation,
and doesn't require any outside data items to create a slot with the desired
type and name.

In the future if we decide we still want a `for_id`-style slot creation API, we
can reintroduce it as a separate function.

Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130970
2024-12-02 17:04:37 +01:00
Omar Emara
7ec9fa680e Compositor: Implement Scale node or new CPU compositor
Reference #125968.
2024-12-02 18:02:38 +02:00
YimingWu
38fa0e71ee Tests: Add object conversion tests
Adding object conversion tests to verify the refactored object type
conversion code works as intended.

The object conversion operator `exec()` function is restructured by
PR #130668 to clean up code path for better readability, since it's a
relatively big change, this test is put up to verify that:

- For supported object type pairs, converted objects would have the
  expected target object type.
- For unsupported/unimplemented type pairs, the test expect the
  converted object to have the same type as the source object.
- Verify that the code behaviour stays exactly the same as prior
  to the change in #130668, including code logic that are later subject
  to change and redesign, in which case this test file/script would need
  to be updated accrodingly.

This test added such files:

- `tests/data/modelling/object_conversion.blend`: Sets up differnt types
  of input objects and their expected converted object combinations.
- `tests/python/object_conversion.py`: Does mesh equal checks for
  objects that are converted to mesh against expected objects in the
  blend file, and does object type checks for other target types.

Note:

This test currently does not do topology-level equal check except for
when target object type is `MESH`. Equal check hasn't been implemented
for other object types yet, but ideally in the future we should use
topology check on top of type check for other object types as well.

See https://projects.blender.org/blender/blender/pulls/130668

Pull Request: https://projects.blender.org/blender/blender/pulls/130738
2024-12-02 16:30:41 +01:00
Jeroen Bakker
53eadcc533 ImageEngine: Migrate to new draw manager
Converts the image engine to the new draw manager.
This is an as is migration without just a few tweaks to improve the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/131142
2024-12-02 16:10:02 +01:00
Iliya Katueshenock
26b13504d4 Cleanup: BKE: unnecessary namespace usage
Since 75d17b1db5 everything in the file are already in such a namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/131205
2024-12-02 15:38:28 +01:00
Guillermo Venegas
4a23553b83 BLI: avoid initializing StringRefNull with explicit nullptr
`StringRefNull ` expects a null terminated string and `StringRefNull (const char *)` initializer
already realizes a runtime assert to avoid `nullptr` c strings, however this stills allows
initializing `StringRefNull ` with a explicit `nullptr`.

Deleting  `StringRefNull(std::nullptr_t)` gives a error if `StringRefNull` is initialized with a implicit `nullptr`.

This follows the same deleted `std::string(std::nullptr_t)` initializer in c++23.

Pull Request: https://projects.blender.org/blender/blender/pulls/130935
2024-12-02 15:30:27 +01:00
Omar Emara
819ff69ea3 Fix: Crash in compositor transform node
Transform node in the new CPU compositor crash in background mode
because of a call to GPU_max_texture_size where the GPU module is not
initialized. To fix this, restrict this call to GPU device and use 2^16
as an upper limit for CPU.
2024-12-02 16:29:35 +02:00
Jacques Lucke
cdbd3f8bee Fix: Nodes: improve spacing from last socket to end of node
This was reported in https://projects.blender.org/blender/blender/pulls/124042#issuecomment-1355483
2024-12-02 15:28:32 +01:00
Jeroen Bakker
e0252ae6de Overlay: View not set for overlay_clipbound shader
overlay_clipbound wasn't working in the Vulkan backend as the draw_view
was never uploaded. In vulkan this lead to a crash as it is more strict.

Detected when researching #131111

Pull Request: https://projects.blender.org/blender/blender/pulls/131247
2024-12-02 15:22:35 +01:00
Jeroen Bakker
108a0f2ec0 Vulkan: Share driver check between GPU and GHOST
GPU and GHOST require to have identical checks to remove faulty drivers.
When not done GHOST can still select a device that isn't supported and
lead to freezing interfaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/131241
2024-12-02 14:50:32 +01:00
Jeroen Bakker
cd57a17698 Overlay: Incorrect framebuffer bound in image editor
When the overlays of the image editor is drawn an incorrect framebuffer
is bound. The faulty framebuffer contains a depth texture which is also bound
as an attachment.

Pull Request: https://projects.blender.org/blender/blender/pulls/131244
2024-12-02 14:35:58 +01:00
Clément Foucault
9ebce2ce95 Fix #131235: Grease pencil: Final rendering not working
The `draw::Manager` needs to be manually synced in render.
2024-12-02 13:43:51 +01:00
Clément Foucault
eb6de2d4fc Fix #131239: Grease Pencil: Last stroke in drawing uses wrong layer opacity
Flush was being done on the wrong pass. It was also creating errors.
2024-12-02 13:21:12 +01:00
Clément Foucault
e3625410e3 Fix: Grease Pencil: Error caused by non-matching texture type with sampler
Depth sample are special on Metal and need correct input.
2024-12-02 13:21:12 +01:00
Clément Foucault
a15a4c9c9a GPU: GLSL compilation as C++ for grease pencil shaders
Rel #127983
2024-12-02 13:21:12 +01:00
Julien Duroure
faaa12a101 glTF: Install Draco lib in the same directory as the glTF2 addon
This changes the location of the Draco library installation path.
The new location is at the root of addons_core/io_scene_gltf2 addon, as the library is created for this addon only.

This will solve issues where the gltf addon couldn't find the library in case of global python installation or custom script/lib paths

Pull Request: https://projects.blender.org/blender/blender/pulls/131080
2024-12-02 12:50:15 +01:00
Omar Emara
377d272f72 Fix: Zero division in Tone Map Photoreceptor node 2024-12-02 13:45:35 +02:00
Falk David
e5bdfd533b Grease Pencil: Save Layer Group expanded state
Grease Pencil layer groups are drawn in the layer tree using
`AbstractTreeViewItem`. The problem is that the items can't
store their expand/collapse state. This meant that switching
e.g. the tabs in the properties editor would reset the collapsed
state of layer group items.

This PR uses the `GP_LAYER_TREE_NODE_EXPANDED` flag to store
the expand/collapse state. The tree view then reads from the flag to
expand/collapse the items.

This also adds an RNA property to layer groups `is_expanded`.
Allows to check from python if a group is expanded in the UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/131159
2024-12-02 11:48:42 +01:00
Jeroen Bakker
796959c205 Cleanup: ImageEngine: Code-style (enum casing) 2024-12-02 11:25:32 +01:00
Jeroen Bakker
e0a0bdcf01 Cleanup: Make format 2024-12-02 11:18:52 +01:00
Jeroen Bakker
3351a6e94e Cleanup: Image engine: Use ShaderModule
Replace old C-Style API with a ShaderModule class for managing shader lifetimes

Pull Request: https://projects.blender.org/blender/blender/pulls/131229
2024-12-02 11:04:32 +01:00
Jeroen Bakker
e93ea62d2b Cleanup: ImageEngine: Shader interface naming
Pull Request: https://projects.blender.org/blender/blender/pulls/131228
2024-12-02 11:03:04 +01:00
Thomas Barlow
8ed98d592e Fix #127765: FBX Export: Incorrect materials with Geometry Nodes
Geometry Nodes can change the materials of the Object, for Mesh Objects,
the new materials are present in the evaluated Object, but for non-Mesh
Objects, the new materials may not be present until the evaluated Object
has been converted to a Mesh.

This patch fixes the materials in FBX export, with Apply Modifiers
enabled, of non-Mesh types with Geometry Nodes that change materials.
Rather than getting the materials from the evaluated Object, the
materials are now retrieved from the Mesh created from the evaluated
Object.

To support object-linked material slots, the materials on the new Mesh
are replaced at the same indices as the object-linked material slots.

Pull Request: https://projects.blender.org/blender/blender/pulls/130485
2024-12-02 10:44:00 +01:00
Thomas Barlow
d0d4fc45b3 Fix #123088: Workaround for Unity FBX import per-vertex normals issue
The FBX SDK specifies that normals should use the IndexToDirect FBX
reference mode. This mode allows data written to FBX to be deduplicated
by writing a separate array of indices into the deduplicated array of
data that can be used to reconstruct the full array of data.

When Unity imports per-vertex normals with the IndexToDirect reference
mode, it erroneously considers the imported mesh's normals invalid if
any of its normals were deduplicated. This issue is not present in other
external software that I have tested.

This patch modifies the export of per-vertex normals to not perform any
deduplication, avoiding the issue in Unity's FBX importer while
maintaining use of the IndexToDirect reference mode.

The add-on's patch version has been increased.

Pull Request: https://projects.blender.org/blender/blender/pulls/123186
2024-12-02 10:40:21 +01:00
Richard Antalik
f1775361e1 VSE: Update test after fix in 618b7f4a9b
Render behavior was incorrect after 5ecb70964e. For more info see commit
message in 618b7f4a9b.
2024-12-02 10:22:19 +01:00
Richard Antalik
618b7f4a9b Fix #130742 Scene render from VSE is taking twice as long
Regression caused by 5ecb70964e. This is, because renders of individual
strips could no longer be reused when cache is completely disabled
during rendering.

Instead of disabling cache completely, flag cache entries as temporary.
When reading entries also skip disk cache, since in 5ecb70964e goal was
to avoid reading from disk cache.

5ecb70964e also affected visual output of rendered image. This is
reported in #131106. Because of this 1 test must be updated.

Root cause for #131106 is, that byte image was automatically converted
to float, due to processing with other float image. Then the same byte
image was used for processing with another byte image. Before
5ecb70964e this byte converted to float image would be cached, which
caused float code paths to be used. This is correct behavior.
After 5ecb70964e, no image is cached, so float data were not saved, so
byte code path was executed in second processing step.

Pull Request: https://projects.blender.org/blender/blender/pulls/130781
2024-12-02 10:07:08 +01:00
Jeroen Bakker
33fd027dc5 Cleanup: Remove unused attribute 2024-12-02 08:29:46 +01:00
YimingWu
5370ab3248 Fix: Attribute lookup cleanup in properties_constraint.py
The match/case clean up in 2c0d2a88ca was
applied on the wrong function. This fix includes the cleanup for the
intended function.

Pull Request: https://projects.blender.org/blender/blender/pulls/131202
2024-12-02 07:44:37 +01:00
Germano Cavalcante
99e54df9f5 Fix #131215: Snap to Grid not working in x-ray
Caused by commit b4154c6a0e, which incorrectly removed the
`(snap_to_flag & SCE_SNAP_TO_GRID)` condition.
2024-12-01 23:22:03 -03:00
Campbell Barton
056f748e04 Cleanup: replace redundant functions with os.path.lexists 2024-12-02 12:52:21 +11:00
Campbell Barton
d63dc070ef Fix error enabling extensions with an empty wheel list
Regression in [0] caused extensions with an empty wheel list
to raise an unhandled exception when extracting the Python
version from the wheel list.

Besides resolving this error, account for errors using the wheel
list since it isn't type checked in this code-path.

[0]: cfc10b0232565642afbfdc5a867f027640ce8274
2024-12-02 12:34:31 +11:00
Campbell Barton
bc66905a15 Cleanup: remove/comment unused functions 2024-12-02 11:23:47 +11:00
Pratik Borhade
74f212fae2 Fix #130922: GN: Hide empty panel in modifier UI
`interace_panel_has_socket` should return true when panel has
at least a socket of type input or hidden in modifier. That way, panel
drawing code won't be executed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130958
2024-12-01 07:37:06 +01:00
Pratik Borhade
6678b0acfb Fix #130813: Grease Pencil: Skip stabilize stroke line drawing when cursor is hidden
When cursor is disabled, exit early from the cursor draw function of
stabilize stroke to skip drawing of "smooth line".

Pull Request: https://projects.blender.org/blender/blender/pulls/130884
2024-12-01 07:34:23 +01:00
Clément Foucault
b0c0c2708d Refactor: Grease Pencil: Port rendering to new draw manager
Pull Request: https://projects.blender.org/blender/blender/pulls/130337
2024-11-30 22:42:43 +01:00
Clément Foucault
e44ae763bc GPU: GLSL C++ Stubs: Add minor missing features 2024-11-30 10:20:37 +01:00
Jesse Yurkovich
1868ae9366 Fix: IO: wrong ObjectIdentifier used when trying to determine parent status
The wrong ObjectIdentifier was used when trying to see if the object is
a parent to something else in the export graph. This lead to accessing
an invalid iterator which will assert with MSVC in Debug configurations.

Accidentally regressed during the review of 428ab699dc.

Pull Request: https://projects.blender.org/blender/blender/pulls/131174
2024-11-30 04:14:19 +01:00