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.
We would have to use task isolation here because of the use of
`EnumerableThreadSpecific`. Anyway, nested threading isn't
helpful because of the relatively small node sizes.
Pull Request: https://projects.blender.org/blender/blender/pulls/129222
The `find_curve_mapping_from_index` function could fail if no
`interval` was returned from `find_frames_interval`, but this error
was not handled by the caller. This meant that
`InterpolateOpData::from_operator` could create empty
`InterpolationPairs` for every layer. In this case, the operator would
not do any interpolation, but it would still create a keyframe.
The operator shouldn't try to interpolate when there are no mappings
found.
The fix makes `find_curve_mapping_from_index` return `true`
when it succeeds. Then it checks if any mappings have been found
and if none were found returns `nullptr` from `InterpolateOpData::from_operator`.
The operators can then check if the `InterpolateOpData` exists
and otherwise exit.
Pull Request: https://projects.blender.org/blender/blender/pulls/129212
Blender crashes when changing the compositor execution device. That's
because cached resources that were originally computed for CPU are now
being used for GPU and vice versa, which can be unexpected in code that
uses them.
To fix this, we free and recreate the entire compositor context when the
execution device or precision change, because it is much easier and
safer to recreate everything as opposed to trying to update the
necessary resources.
When selection type is set/and for gesture selection tools, Instead of
current attribute, all three selection attributes (`.selection`, `left_handle`,
`right_handle`) are reset in every iteration of for loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/129147