Even though this is generally avoided, drivers don't prevent
invalid values being set. Further files from branches or files
written in the future may contain enum values not yet known.
Resolve by range checking enum values which are used to index arrays.
RNA label & description truncation could cause invalid UTF8
which caused BLI_string_search to hang.
Resolve by ensuring truncation of RNA descriptions & labels never
truncates a multi-byte sequences.
The issue with BLI_string_search would still be good to resolve but can
be handled separately.
The `fmtlib` text formatting library, when compiled in C++20 onwards,
requires that the incoming format string is a compile-time constant so
it's able to perform type checks against it[1]. The change here ensures
it can do so.
While we're not set to go to C++20 any time soon, this is a backwards
compatible change that can be done today and allows us to focus on the
harder fmt-related issues later.
No change in performance or functionality was observed.
[1] https://godbolt.org/z/qG5dsf7YG
Pull Request: https://projects.blender.org/blender/blender/pulls/129272
Since GPv3 shader currently uses particle strand/points shader, we
need to modify that slightly to display the grease pencil overlays.
This adds the missing `vflag` attribute to the edit gpencil batch.
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/128116
This removes the need for the geometry shader and the
workaround path for Metal.
Note that creating 2 batches for each stroke might become
a bottleneck in bigger scenes. But currently the bottleneck
is always be the fill algorithm. It can be optimized further
if needed.
Rel #127493
Pull Request: https://projects.blender.org/blender/blender/pulls/129274
Addresses the case when Blender is shutdown before the
parallel compiler has finished processing all the shader batches.
The parallel compiler destructor will now attempt to terminate all
of the outstanding batches and free the shaders.
Authored by Apple: James McCarthy
Pull Request: https://projects.blender.org/blender/blender/pulls/129172
Regression since a904db3ee7 ("skip no-op colorspace transforms for
float images"), the newly added do_display_buffer_apply_no_processor
function did not handle case of both source and destination being
float images. This happens when VSE produces a float image, and
you turn on a Waveform scope.
Pull Request: https://projects.blender.org/blender/blender/pulls/129293
The first encounter wasn't counted for, which resulted in a bias of one
(vertices with single neighbor return false), I initialized the counting from
1 instead of zero which seems to solve the problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/129021
The issue was that the code that remaps the materials for when
a slot is removed was returning when the `material_index` attribute
didn't exist instead of continuing the loop over all drawings.
This issue was present both in `BKE_grease_pencil_material_remap`
and `BKE_grease_pencil_material_index_remove`
but `BKE_grease_pencil_material_remap` forced the `material_index`
attribute to be created, which meant that the early return
was never hit.
The fix fixes both issues:
* Continue instead of return.
* Don't create the `material_index` attribute in `BKE_grease_pencil_material_remap`
if it doesn't exist.
Pull Request: https://projects.blender.org/blender/blender/pulls/129288
The issue was that the strokes were not using the `POLY` type and
needed to be tagged.
This adds a function `tag_positions_changed` on the `GreasePencilDrawing`
so that the high-level python API can tag the positions if
the `point.position` attibute is written to.
Pull Request: https://projects.blender.org/blender/blender/pulls/129292
This adds the possibility to the user code to
group visibility and command generation compute
dispatch together to reduce the overhead of
PSO and pipeline switch.
This PR also make passes that have been submitted
(i.e.: that generated commands) as read-only.
This allows to automatically remove redundant
command generation when submitting the same
pass with the same view multiple times, or,
remove redundant visibility calculation for the
same view in multiple passes. This automation
is done for the common usage of the API (using `submit`).
Custom usage (using `submit_only`) needs to abide by
the rule of the API and update visibility and commands
when required.
Pull Request: https://projects.blender.org/blender/blender/pulls/129170
The issue only happened when compiling with clang which
apparently evaluated the parameters in a different order.
`IMB_steal_encoded_buffer` sets `ibuf->encoded_size` to 0.
Duplicate descriptions for dynamic enum menu items to resolve
use-after-free error.
based on !129008.
Ref !129164
Co-authored-by: Julian Eisel <julian@blender.org>
Blender leaks memory when the compositor gets canceled. That's because
later operations in the compositor are responsible for freeing the
results of earlier operations, so when the compositor gets canceled
before all operations got the chance to execute, memory will be leaked.
To fix this, force free all operations when the compositor gets
canceled.
This happens because blender 4.3 only knows about GPv3 IDs, and
therefore stores a reference to a directly linked GPv2 obdata as a GPv3
one, which cannot be found again on next file load in the GPv2 library.
The idea of this fix is, if the looup of a idcode+idname fails, to also
search for the same name but with an older, deprecated ID code.
Pull Request: https://projects.blender.org/blender/blender/pulls/129220
Blender crashes when picking Cryptomatte while rendering. This is
because pass data are not yet allocated. To fix this, we just fail the
picking until data becomes available.
Crash is poll function when drag type is other than layer/group For
example: dragging some element from outliner to layer list.
Also removed redudant check when returning from function.
Pull Request: https://projects.blender.org/blender/blender/pulls/129246
Now can pick "H.265 / HEVC" in the video codec dropdown.
Implementation notes:
- Remap CRF value (which is for H.264) slightly to better match H.265
CRF range (e.g. default Medium 23 -> 28).
- Set lossless mode via appropriate private param, and use 4:4:4 YUV
format just like for some other video codecs when in lossless.
- Currently there are no built-in presets for H.265. Maybe later, especially
if/when we'll add 10 bit or HDR videos.
Pull Request: https://projects.blender.org/blender/blender/pulls/129119
- Both "hit_resullt" & "hitresult" were used in the same functions
with different meanings. Rename `hitresult` to `select_id`,
a convention already widely used.
- Armature selection shadowed "result", using it to store two kinds
of selection results, use "hit_result" for GPUSelectResult.