Commit Graph

118328 Commits

Author SHA1 Message Date
Sybren A. Stüvel
16d819caa9 Fix: Reorder versioning of legacy Grease Pencil and Actions
The versioning of legacy-to-modern Grease Pencil is using slotted
Actions (because that's the current animation API), and therefore
assumes that the Action & Slot assignments have been versioned as well.
The latter now actually happens before the former, so that assumption is
now actually valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/135466
2025-03-06 14:12:17 +01:00
Richard Antalik
68abed543b Refactor: Remove module prefix form symbols in sequnecer namespaces
Remove
SEQ_ prefix for blender::seq namespace and
ED_sequencer for blender::ed::vse namespace

Pull Request: https://projects.blender.org/blender/blender/pulls/135560
2025-03-06 13:04:39 +01:00
Richard Antalik
21bd7ec180 Fix windows build error and warnings
Pull Request: https://projects.blender.org/blender/blender/pulls/135567
2025-03-06 11:18:28 +01:00
Clément Foucault
bb2d123fbd Cleanup: DRW: Remove ObjectInfos legacy GLSL macros
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/135542
2025-03-06 11:06:26 +01:00
Jacques Lucke
6fc06388d4 Fix #135469: panels with same name are opened/closed together
The solution is to use a better identifier for the panel that's more unique.
2025-03-06 10:38:51 +01:00
Habib Gahbiche
02a5e6b9a0 UI: Always show cage 2D rotation handle if rotation is enabled
Followup to https://projects.blender.org/blender/blender/pulls/135065

Previously the rotation handle was drawn only when hovering over one of the corners or the rotation handle. Now it's always visible. This also restores the behavior of 2.8x.

Pull Request: https://projects.blender.org/blender/blender/pulls/135455
2025-03-06 10:32:52 +01:00
Jacques Lucke
58eaced72d Merge branch 'blender-v4.4-release' 2025-03-06 09:54:51 +01:00
Jacques Lucke
e726357962 Fix: Geometry Nodes: bad attribute propagation with multiple group outputs and warning node
The issue was that sometimes the group inputs of a node group were shuffled
around unexpectedly and thus inputs were passed to the wrong sockets.

The `or_socket_usages` function sorts the given span so that the key is more
likely to be reused, reducing the number of nodes inserted in the graph.  The
issue was that `build_warning_node` passes `group_output_used_sockets_` into the
function the order of which is important. It thus should not be reordered.

The fix is to just never reorder the span passed to `or_socket_usages` but to
make a local copy instead which can be sorted without problems. Often this copy
is done already anyway when the span is inserted into
`graph_params.socket_usages_combination_cache` as `Vector`.

This fix also makes an assumption about `Map.lookup_or_add_cb` which was not
documented before. Namely it assumes that the key is moved into the map only
after the callback has been called. This behavior is now documented and there is
a unit test for it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135528
2025-03-06 09:47:44 +01:00
Omar Emara
39d0cff1dc Refactor: Compositor: Remove initial reference count
This patch removes the initial reference count mechanism from the Result
class. That's because results are no longer cached across evaluations
ever since 97ada4f307, so it is no longer useful.

Pull Request: https://projects.blender.org/blender/blender/pulls/135526
2025-03-06 08:50:22 +01:00
Campbell Barton
7d8bccbbd4 Cleanup: suppress undefined function warning
SeqRenderData declared outside the blender::seq namespace
was treated as a different type, causing the function to be treated
as undeclared.
2025-03-06 16:50:21 +11:00
Campbell Barton
50fe0f0d6b Merge branch 'blender-v4.4-release' 2025-03-06 16:37:36 +11:00
Campbell Barton
093178342d Fix crashes running Pose Slide operators without a 3D view or area
Only some of the operator logic checked for a valid area
which was assumed to be a 3D viewport which isn't necessarily the case.
2025-03-06 16:33:29 +11:00
Richard Antalik
a08246a1a2 Refactor: Move VSE code to namespaces
This PR creates 2 namespaces for VSE code:
- `blender::seq` for sequencer core code
- `blender::ed::vse` for editor code

These names are chosen to not be in conflict with each other.
No namespace was used for RNA.

Finally, file `BKE_sequencer_offscreen.h` was moved from BKE to sequencer.

Pull Request: https://projects.blender.org/blender/blender/pulls/135500
2025-03-06 06:22:14 +01:00
Campbell Barton
f2ac9c9954 Merge branch 'blender-v4.4-release' 2025-03-06 15:54:08 +11:00
Campbell Barton
fa6975b440 Fix crash calling "Set Active Modifier" without an active object 2025-03-06 15:47:16 +11:00
Hans Goudey
d88d6331fd Cleanup: Modernize mesh variable naming in some cases
Simplify naming of vertex and corner indices, and replace "loop".
2025-03-05 23:16:09 -05:00
Campbell Barton
edd041e230 Fix freed stack memory use in Visual Geometry to Objects operator
The ternary operator that selecting between `const char *` and
`std::string`, assigning to a `StringRefNull` seems to cause freed
stack memory use (reported by ASAN).

The likely cause looks to be that the `const char *` is converted to a
`std::string` then to a `StringRefNull`.
With the intermediate `std::string` going out of scope before use.

Resolve by explicitly converting both sides of the ternary operator
to a StringRefNull before assignment.
2025-03-06 15:15:26 +11:00
Campbell Barton
c3cf8600e3 Merge branch 'blender-v4.4-release' 2025-03-06 15:13:23 +11:00
Campbell Barton
64ec0b3589 Fix assert in vertex weight smooth with mirror enabled
Vertex weight smooth was running on meshes without any vertex groups
the operation to apply the weights to mirrored vertices was asserting
in this case.

Resolve by only operating on meshes with vertex groups,
also add a warning when no objects were changed.
2025-03-06 13:37:38 +11:00
Campbell Barton
9259ebbc0f Merge branch 'blender-v4.4-release' 2025-03-06 12:50:04 +11:00
Campbell Barton
f6f53551ff Fix invalid tessellation after vertex smooth with mirror enabled
Smoothing vertices with symmetry wasn't recalculating normals
before re-tessellating, meaning the faces would use an incorrect
2D projection for tessellation.

The error was exposed by an assert.
2025-03-06 12:48:39 +11:00
Harley Acheson
3e8bc9f99d Merge branch 'blender-v4.4-release' 2025-03-05 16:40:01 -08:00
Harley Acheson
8d77e842e9 Fix #135097: BLF Control Characters in When Wrapping
With 4da5377e17 control characters are shown as space characters. But
word wrapping code will use the codepoint from the glyph if available,
which means a soft wrap on space instead of a hard wrap on line feed.
Just oversight, no need to use the glyph for that. In fact we always
want to deal with the character, not the visual representation of it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135541
2025-03-06 01:38:59 +01:00
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