Commit Graph

120055 Commits

Author SHA1 Message Date
Campbell Barton
3438acc3c3 CMake: add missing headers to source lists 2025-03-06 11:08:18 +11:00
Campbell Barton
2569308200 Cleanup: sort cmake file-lists, indentation 2025-03-06 10:55:26 +11:00
Campbell Barton
7e6f8936e3 Cleanup: missing format from last commit 2025-03-06 10:51:57 +11:00
Campbell Barton
d951428422 Cleanup: spelling in comments
Address warnings from check_spelling.py
2025-03-06 10:49:51 +11:00
Campbell Barton
5b856ba447 Merge branch 'blender-v4.4-release' 2025-03-06 10:35:59 +11:00
Campbell Barton
b85fc32cae Cleanup: spelling & repeated words in comments
Address warnings from check_spelling.py
2025-03-06 10:33:21 +11:00
Campbell Barton
9b9ed06467 Merge branch 'blender-v4.4-release' 2025-03-06 10:19:49 +11:00
Campbell Barton
2d705f90c2 PyAPI: disable assertion when building Blender as a Python module
When adding the assert I thought this wasn't happening on Linux
(since I'm unable to redo it locally).
However the builtbot hits this assert on Linux, causing tests to fail.

Resolves #135195
2025-03-06 10:17:37 +11:00
Miguel Pozo
998d84a84b Revert "Fix: EEVEE: Avoid double lock in ShaderModule::module_free"
This reverts commit f96b43cfd4.
2025-03-05 23:19:18 +01:00
Sean Kim
a9a98c9a60 Cleanup: Remove unused bmesh_log.hh functions
Pull Request: https://projects.blender.org/blender/blender/pulls/135474
2025-03-05 22:59:05 +01:00
Miguel Pozo
f96b43cfd4 Fix: EEVEE: Avoid double lock in ShaderModule::module_free 2025-03-05 22:40:59 +01:00
илья _
1e4af6719c Fix #135514: Corrupt Mix Shader Node names
Unlike all other nodes, the Mix node did not handle all cases of its
automatic label. This assumption was made in 02281dd26a and caused an
issue with reading uninitialized memory. In order to restrict the nodes
API interface later, this fix simply aligns the behavior of the mix node
with all others.

Pull Request: https://projects.blender.org/blender/blender/pulls/135535
2025-03-05 21:42:00 +01:00
Hans Goudey
0202307e54 Merge branch 'blender-v4.4-release' 2025-03-05 15:36:35 -05:00
Hans Goudey
312516d53e Fix #135517: Geometry nodes convex hull imprecision
The equivalent operation in edit mode reused existing vertices
rather than taking the new positions from the convex hull output.
This commit implements the same behavior for the geometry node.

Pull Request: https://projects.blender.org/blender/blender/pulls/135536
2025-03-05 21:18:45 +01:00
Jesse Yurkovich
1512adc536 Merge branch 'blender-v4.4-release' 2025-03-05 11:49:45 -08:00
Jesse Yurkovich
2d915869f7 Fix #135441: integer overflow with large displacement modifier image
The offset calculation would overflow inside `ibuf_get_color` given the
incoming arguments and image size.

Another similar problem, found from quick inspection, would occur inside
`ibuf_get_color_clip` as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135476
2025-03-05 20:48:47 +01:00
Hans Goudey
23a97dd965 Fix #135520: Mesh edit mode "Frame Selected" crash in some cases
Caused by 839108f623.
Now, when there is no mapping available between the evaluated
mesh and the original, the evaluated mesh won't have the edit mesh
pointer set. Since this code really just cares about the original BMesh,
just retrieve it with the original object. This function expects an
evaluated object since `BKE_object_get_editmesh_eval_cage`
asserts for that laer on.
2025-03-05 14:36:28 -05:00
Harley Acheson
7470c63836 Merge branch 'blender-v4.4-release' 2025-03-05 11:11:56 -08:00
Harley Acheson
de3b5e691e Fix #135119: Always Clear Previous Area Subtype After Change
Area's butspacetype_subtype always needs to be cleared after switching
space and subtype, whether the space supports subtypes or not.
Otherwise an operation that only changes type (so assumed subtype of
zero) will use the area's previous subtype if it has subtypes. This is
restoring prior undocumented behavior, now with a nice comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/135533
2025-03-05 20:11:00 +01:00
Bastien Montagne
514ed4113f Core: Test/demo usage of new MEM_mallocN<T> template functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/135531
2025-03-05 19:35:51 +01:00
Guillermo Venegas
82e2a57dcd Core: RNA: Use VectorSet for StructRNA properties lookup
Replace the  `Ghash` `prophash` properties map in RNA containers by a
`CustomIDVectorSet` `prop_lookup_set`.

This commit also allows for runtime-defined RNA Struct types to use
`CustomIDVectorSet` for properties lookup, instead of only relying on linear
search in the ListBase property list.

NOTE: This also simplifies a bit the code compared to using Ghash, since the
string key is contained whiting the property, and not stored separately as in the
GHash. It also means that the string key (the property identifier)  is 'automatically'
updated in the VectorSet when updated in the property itself. This avoids the
need to re-insert the property when its identifier string is duplicated into a new
memory address. However, modifying the property identifier would cause
undefined behavior if the property is not removed from the vector set first.

-----

While its an impractical example, the following custom PropertyGroup example shows the potential slowdowns just
of looking through the ListBase

``` py
import bpy

test_properties_script = "import bpy\nclass TestProperties(bpy.types.PropertyGroup):"

property_count=10000
for x in range(property_count):
    test_properties_script+="\n    prop_{0} : bpy.props.IntProperty(name=\"Prop {0}\")".format(x)

exec(test_properties_script)

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Test in the text editor side panel to test ui perfomance"""
    bl_label = "Test"
    bl_category = "Test"
    bl_idname = "TEXT_PT_test"
    bl_space_type = 'TEXT_EDITOR'
    bl_region_type = 'UI'

    def draw(self, context):
        layout = self.layout
        layout.use_property_split=True
        layout.use_property_decorate=False
        for x in range(property_count):
            row = layout.row()
            row.prop(bpy.data.scenes['Scene'].test_pointer, "prop_{}".format(x))

classes = [
    TestProperties,
    LayoutDemoPanel,
]

if hasattr(bpy.types.Scene,'test_pointer'):
    del bpy.types.Scene.test_pointer

class_register, class_unregister = bpy.utils.register_classes_factory(classes)

class_register()

bpy.types.Scene.test_pointer = bpy.props.PointerProperty(type=TestProperties)
```

<video src="attachments/95e36a02-b781-44b1-9a18-9e453f8a1432" title="2025-02-03 14-12-47.mp4" controls></video>

Pull Request: https://projects.blender.org/blender/blender/pulls/134000
2025-03-05 19:34:19 +01:00
Miguel Pozo
97055868a3 Merge branch 'blender-v4.4-release' 2025-03-05 16:44:06 +01:00
Miguel Pozo
6c697a48f4 Fix #135325: Overlay-Next: Replicate the old face x-ray behavior
Replicate the Overlay-Legacy behavior for selected face overlays in
X-Ray mode:

Use depth testing for `edit_mesh_faces_ps_` when X-Ray is fully opaque.

X-Ray is always considered fully opaque in Preview/Render mode since
X-Ray transparency is not supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/135524
2025-03-05 16:42:59 +01:00
Bastien Montagne
dd168a35c5 Refactor: Replace MEM_cnew with a type-aware template version of MEM_callocN.
The general idea is to keep the 'old', C-style MEM_callocN signature, and slowly
replace most of its usages with the new, C++-style type-safer template version.

* `MEM_cnew<T>` allocation version is renamed to `MEM_callocN<T>`.
* `MEM_cnew_array<T>` allocation version is renamed to `MEM_calloc_arrayN<T>`.
* `MEM_cnew<T>` duplicate version is renamed to `MEM_dupallocN<T>`.

Similar templates type-safe version of `MEM_mallocN` will be added soon
as well.

Following discussions in !134452.

NOTE: For now static type checking in `MEM_callocN` and related are slightly
different for Windows MSVC. This compiler seems to consider structs using the
`DNA_DEFINE_CXX_METHODS` macro as non-trivial (likely because their default
copy constructors are deleted). So using checks on trivially
constructible/destructible instead on this compiler/system.

Pull Request: https://projects.blender.org/blender/blender/pulls/134771
2025-03-05 16:35:09 +01:00
Clément Foucault
077115e936 Cleanup: DRW: Remove ViewMatrix legacy GLSL macros
Pull Request: https://projects.blender.org/blender/blender/pulls/135416
2025-03-05 15:31:36 +01:00
Clément Foucault
bacc58b142 Cleanup: DRW: Remove duplicated glsl library 2025-03-05 15:31:35 +01:00
Clément Foucault
9bddb57960 Cleanup: DRW: Relace drw_view macros by function calls 2025-03-05 15:31:35 +01:00
Clément Foucault
a92f6ebf13 Cleanup: DRW: Remove ModelMatrix legacy GLSL macros 2025-03-05 15:31:35 +01:00
Clément Foucault
5916c39fa4 Cleanup: DRW: Simplify resource id and custom id 2025-03-05 15:31:35 +01:00
Clément Foucault
580c02c053 Fix #135497: Auto-Depth Operation are affecterd by Retopology offset
Setting the offset to 0 for these cases fixes the issue.
We still want to draw the edit face in this case to a be able
to zoom on the retopo surface. We just don't want the offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/135511
2025-03-05 15:08:12 +01:00
Clément Foucault
edd3781584 Fix: DRW: Fix the fix
The `tmp_object.runtime` is getting overwritten by the shallow
copy.
Caused by b4b1d010fb
2025-03-05 14:57:59 +01:00
Clément Foucault
b4b1d010fb Fix: DRW: Asan crash because of use after free
Caused by 2038ba699d
2025-03-05 14:49:22 +01:00
Omar Emara
97ada4f307 Cleanup: Compositor: Remove operation stream cache
This patch removes the operation stream cache code from the compositor.
This code path has been disabled already since 4137fdf555, so this patch
just removes the dead code.

Pull Request: https://projects.blender.org/blender/blender/pulls/135513
2025-03-05 14:01:12 +01:00
Sybren A. Stüvel
d620f7605c Merge remote-tracking branch 'origin/blender-v4.4-release'
ch.cc
2025-03-05 13:28:16 +01:00
Jonas Holzman
32f8863b0c Fix #134260: Color Picker components partially resetting when pressing Backspace
Previously, when pressing the Backspace key inside an open color picker,
the HSV and Hex field components would not refresh. Only the RGB
components would.

Fixed by calling the attached button function callbacks which propagates
the color changes to the other color picker buttons from the RGB values.

Pull Request: https://projects.blender.org/blender/blender/pulls/135131
2025-03-05 12:41:32 +01:00
Campbell Barton
1efcf7d729 Cleanup: correct flag check in remesh operator
Inclusion of other flags would make this check fail.
2025-03-05 22:27:53 +11:00
Campbell Barton
f54eeaf2aa Fix #135490: Incorrect allocation size with MEM_new (naming collisions)
Resolve naming collisions for structs which could cause the wrong size
to be used allocating the `LaplacianSystem` when calculating mesh
weights from an armature.

Ref !135491
2025-03-05 22:26:55 +11:00
Falk David
a4ac52d0d0 Fix #135312: Grease Pencil: Crash when drawing while animation is playing
While we can avoid this crash by enforcing that the animation can't
play while drawing, this PR fixes the problem by remembering the
drawing that the operation was started on.

This seems like the right thing to do in general because there might be
other ways that the frame can be changed.

From my tests this seems to work even in cases where we use multi
frame editing.

Pull Request: https://projects.blender.org/blender/blender/pulls/135451
2025-03-05 12:21:28 +01:00
Sybren A. Stüvel
aada31c041 Anim: Fix issue where F-Curves were half-initialized when importing USD
Fix an issue where imported F-Curves were allocated but not zeroed out,
when importing skeletal animation from USD.

When growing the F-Curve array, `BKE_fcurve_bezt_resize()` will now zero
out new array elements, instead of leaving the initialisation to the
caller. There are many fields in `BezTriple`, and the caller is likely
to only set those that can be imported (like the keyframe coordinates &
handles).

This fixes an issue introduced in 857743db9d.

Pull Request: https://projects.blender.org/blender/blender/pulls/135448
2025-03-05 12:20:40 +01:00
Sybren A. Stüvel
a03077c22d UI: show '+ New' button in Action Slot selector when no slot is selected
In any Action Slot selector, when there is no slot selected yet, replace
the 'Duplicate' and 'Unassign' buttons with a large 'New' button. This
is consistent with the ID selector, which does the same thing.

Care is taken to ensure this is only applied to the use case of
selecting Action Slots, in order to minimize the UI changes in Blender
4.4.

The only other use case of `template_search()` that I could find, is the
View Layer selector in the top-right corner of the window. However, even
without the "_is this an Action Slot selector_" guard, it would not show
these changes, as Blender guarantees there is always a view layer
assigned. Add-ons may still use `template_search()` in other ways,
though, so it's still good to keep this guard in place.

Pull Request: https://projects.blender.org/blender/blender/pulls/135443
2025-03-05 12:20:11 +01:00
Clément Foucault
04fcf2f907 Merge branch 'blender-v4.4-release' 2025-03-05 12:06:00 +01:00
Clément Foucault
326ce59961 Fix #134509: GPU: Add workaround for Intel ARC nodelink driver bug
This disables the instancing optimization for this specific
hardware.

Pull Request: https://projects.blender.org/blender/blender/pulls/135458
2025-03-05 12:05:34 +01:00
Lukas Tönne
1b8185db79 Merge branch 'blender-v4.4-release' 2025-03-05 12:04:12 +01:00
Lukas Tönne
70473d7589 Fix: Grease Pencil forward declaration of RandomNumberGenerator.
This is a class, was forward-declared as struct.
2025-03-05 12:02:58 +01:00
Hans Goudey
b8d547ab1a Fix #134876: Wireframe overlay incorrectly skips some edit mode objects
The detection of when the wireframe is drawn by the edit mode overlays
instead was incorrect and didn't handle recent changes to avoid drawing
edit mode overlay data for invalid evaluated/original edit mesh mappings.
See code comments for more detail.

Pull Request: https://projects.blender.org/blender/blender/pulls/135402
2025-03-05 11:18:26 +01:00
илья _
02281dd26a Cleanup: BKE: Nodes: improve node label functions
Slight cleanup of function naming, return types and related things like early return.

Pull Request: https://projects.blender.org/blender/blender/pulls/135351
2025-03-05 11:17:50 +01:00
Pratik Borhade
c2a5fb28d7 Fix #135344: Extra space in node editor group panel
Remove extra padding from panel when it doesn't have toggle socket. It
was added in 2822777f13

Pull Request: https://projects.blender.org/blender/blender/pulls/135424
2025-03-05 11:16:56 +01:00
Omar Emara
117b47840a Refactor: Compositor: Remove use of auto_resource_location
This patch removes the use of auto_resource_location during shader
operation material compilation. Instead, we assign slot locations
explicitly. Output images are just assigned incremental indices, while
input samplers are also assigned incremental indices, but starting from
the number of textures in the material, because color bands might be
reserving slots already.

Pull Request: https://projects.blender.org/blender/blender/pulls/135453
2025-03-05 09:12:52 +01:00
Lukas Tönne
b66bfa345d Merge branch 'blender-v4.4-release' 2025-03-05 08:50:10 +01:00
Lukas Tönne
dc3a652d5b Fix #134606: Grease Pencil: Randomization of attributes in primitive tools
Primitive tools were not using the brush randomization options.

This moves the randomization functions into the editor utilities for Grease Pencil
and enables primitive curve generation to use them.

Pull Request: https://projects.blender.org/blender/blender/pulls/135454
2025-03-05 08:49:27 +01:00