BLF code is not threadsafe, yet font loading gets called over and over
by text strips when the font file is missing, including e.g. from
depsgraph evaluation code when duplicating the strip for evaluation.
WARNING: This is a quick fix for deblocking the Blender studio, proper
fix (and report) still needs to be worked on.
Makes it possible to swipe over panel header to batch open/collapse all
panels the mouse draged over. Normal panels and sub-panels support this
too.
Two changes were needed:
- Support "drag toggle" feature for `UI_BTYPE_BUT_TOGGLE` - all toggle
buttons should/can support this.
- Allow querying the pushed state from the button used for the
collapsing. Multiple ways to do this, in this case simply using the
pushed state query callback seemed simplest.
Pull Request: https://projects.blender.org/blender/blender/pulls/114560
No functional changes.
Improve the readability of the code by
* returning early where possible
* moving variables closer to where they are used
* renaming variables
Pull Request: https://projects.blender.org/blender/blender/pulls/114568
Looks like most of `ui_apply_but_XXX` or `ui_do_but_XXX` functions rely
on `uiHandleButtonData` (and not necessarily context).
Now the problem from a popover in `ui_but_list_row_text_activate` was
that the label button to be set in BUTTON_ACTIVATE_TEXT_EDITING for
renaming could not be found because it was using the "wrong" region from
context (`CTX_wm_region` - which still seem to point to the region the
popover was spawned from). The correct region is available in
`uiHandleButtonData` though, so now use this instead.
Not totally sure if `CTX_wm_region` should actually be correct in all
cases - which would hint at an underlying problem of not setting it
right - but since other functions rely on `uiHandleButtonData` as well,
this fix seems to make sense.
Fix should go into LTS I think.
Pull Request: https://projects.blender.org/blender/blender/pulls/114363
Use the same attribute conversion class for PBVH and regular
mesh attribute extraction. This makes the GPU formats we use
for each attribute type more explicit and centralizes the conversions
from the attribute types to the GPU types. It's also a bit more aligned
to how we could use implicit sharing for GPU vertex buffer data.
Unfortunately it isn't possible to use this same code for curves
and point clouds because they use textures for their evaluated data,
and 3-wide vectors (e.g. `float3`) aren't supported on GPUs with our
current texture abstraction. For generic attributes, the long term
approach will probably be to use an SSBO instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/114340
Ensure that on closing of the application, all pending
SafeFreeLists are released. A new change to ensure
release of SafeFreeLists was always deferred until
full completion of GPU buffers meant that a pending
MTLSafeFreeList container may not be released on
shutdown.
This change ensures that the container is fully
destructed on final shutdown.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/114532
In `shuffle_seq_time_offset_get()` code tried to check whether
`strips_to_shuffle` would overlap with each other, but this was done
incorrectly. This check relied on result of `shuffle_seq_test_overlap()`
but that function assumes, that only 1 strip of its input is transformed
by `offset`. This means, that if 2 strips are moved by same offset and
overlap is checked against each other it could result in true return
value. However this is checked in the code already by
`strips_to_shuffle.contains(seq_other)`, in which case loop continues.
This resulted in emmision of warning which was incorrect.
The issue is fixed by continuing loop if `strips_to_shuffle` contains
`seq_other` as first precondition to signify, that this is expected and
in fact inevitable case. `shuffle_seq_test_overlap()` does not check
whether 2 passed strips are equal, rather `BLI_assert` is used to
signify, that this is not valid use-case.
Since the warning can not happen, the logging was removed.
Makes it possible to swipe over the checkboxes used to enable or disable
catalogs in the asset catalog selector popup, to batch enable or disable
the ones dragged over.
Might also enable this feature for other cases where checkboxes are
displayed.
Fix an issue in `find_first_valid` where Nvidia would incorrectly
increment `src` after return.
This should fix the issue where some tiles would stay corrupted
until resetting EEVEE.
Initialize tiles_data in `TestAlloc` so it doesn't fail in debug builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/114550
Fixes a harsh transistion between diffuse and subsurface scattering
materials in the Principled BSDF as a user increases the Subsurface
Scattering Weight from 0 to 1.
Pull Request: https://projects.blender.org/blender/blender/pulls/114500
Non-editable prop collection items would always fall back to the slower
loop in `rna_raw_access`.
This patch changes `RNA_property_collection_raw_array` to only fail with
non-editable items when intending to set values, allowing for the faster
raw array access to occur when reading values in `rna_raw_access`.
This brings the Python API `bpy_prop_collection.foreach_get` performance
of `Mesh.vertex_normals`/`polygon_normals`/`corner_normals` up to the same
speed as generic `FLOAT_VECTOR` attributes with the same domains.
Given a mesh with 393216 corners:
Using `foreach_get` with the "vector" prop and a compatible buffer object:
- Corner vector attribute: ~0.9ms
- Corner normals (before): ~7.9ms
- Corner normals (after): ~0.9ms
Using `foreach_get` with the "vector" prop and a Python list:
- Corner vector attribute: ~11.0ms
- Corner normals (before): ~18.0ms
- Corner normals (after): ~11.0ms
Pull Request: https://projects.blender.org/blender/blender/pulls/114063
Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility`
and `Material > Transparent Shadows` instead.
The versioning system auto-updates objects/materials in EEVEE
scenes so their behavior is as close as possible to the previous one.
Update Cycles to use the native `use_transparent_shadow` property.
Note:
Material changes don't set any `recalc` flag on the objects that use
them, so the EEVEE Next shadow maps don't update when changing
settings/nodes.
Fixing this issue is required for 4.1, but it's out of the scope of this PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/113980
The compositor sometimes produces straight alpha even though
premultiplied alpha is expected. Moreover, there is an inconsistency
between the CPU and GPU compositors.
For the GPU compositor, this is because GPU textures sometimes store
straight alpha, while the compositor always expects premultiplied alpha,
so we need to premultiply the alpha in those cases.
For the CPU compositor, this is because the image operation didn't
premultiply the alpha of byte textures, so we need to ensure
premultiplied alpha in those cases.
There is a data loss issue in case of byte images, since the IMB module
unpremultiplies premultiplied images then the compositor premultiplies
it again. But this will be handled in a different patch since it require
some design and refactoring first.
Pull Request: https://projects.blender.org/blender/blender/pulls/114305
When enabling multi-frame editing, also include the current frame
as editable. Not just the selected frames in the dopesheet.
This was a regression introduced in #114283.
When click-dragging on the 'up-arrow' of the asset-shelf to show it the
first time, some resizing operation could get called before the shelf
region was initialized, leading to crash on null pointer access.
The null byte wasn't taken into account when allocating memory
to strcpy into.
The calculation to check if allocation was needed was also wrong,
causing allocation for every string.
In practice it's not so likely users would ever hit this since
the function tended to over allocate, even in the case an off by one
error occurred, in all likelihood the room would already be available.
Ref !114512
If the draw_color method is not defined, try to use draw_color_simple as
a fallback. If not defined either, fallback to a magenta color.
The patch also updates the description of the method to clarify its use.
Pull Request: https://projects.blender.org/blender/blender/pulls/114527
Selected active strip highlights effect inputs and input channels for
multicam strips. This was done as 3rd pass in `draw_seq_strips()`.
4th pass was highlighting strip when doing solo preview.
Now this is added to a column of functions in `draw_seq_strip()`.
Highlighting effect input and solo preview is done when drawing actual
highlighted strip, but this is still done via alpha blending.
Highlighting multicam has to be done as alpha blending since this is
done by drawing rectangle over whole channel.
Originally code iterated twice over whole listbase with a lot of
preconditions to draw unselected, then selected strips.
Use `sequencer_visible_strips_get()` to get vector of visible strips,
split iteration in 2 separate loops.
Also move `special_seq_update` case to own function.
Use `VectorSet`, `Vector` or `Span` instead of `SeqCollection` struct.
It is now possible to use native `for` loops and `SEQ_ITERATOR_FOREACH`
macro can be removed.
Another feature is, sets of strips no longer needs to be freed. However,
this poses a limitation, that query functions can not be used in case,
where these sets need to be available outside of scope where they are
created.
Pull Request: https://projects.blender.org/blender/blender/pulls/111909