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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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