This was reported by the studio. When opening one of the lighting
files in 4.3, Blender would crash.
The realize instance task for grease pencil needs to copy all the
layer attributes to the target geometry. When creating the
`dst_attribute_writers` using `lookup_or_add_for_write_only_span`
the `bke::AttrDomain::Point` was used when it should have been
`bke::AttrDomain::Layer`.
Pull Request: https://projects.blender.org/blender/blender/pulls/125603
This type of projection is often used e.g. in exhibitions that leverage big
curved screens.
Effectively, the frame is mapped onto a cylinder, with the x axis becoming the
longitude and y axis becoming the height.
Users can configure the min/max longitude, the min/max height and the radius of
the cylinder.
Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/123046
When a video width is a multiple of 8 but not 16 (i.e. line size
stride of RGBA frame is multiple of 32 bytes but not 64 bytes), then
on an AVX512 capable CPU the decoded video has a block of "wrapped"
artifacts on the left side.
This started happening in 4.1 with 4ef5d9f60f, where the vertical flip
is done together with YUV->RGB conversion. The logic in there checks
whether ffmpeg frame line size (which might include necessary SIMD
alignment/padding) matches packed imbuf line stride. However, ffmpeg
arguably has a bug, where `av_frame_get_buffer` always uses 32 byte
alignment, instead of 64 byte when on AVX512 code path. Report
has been made to ffmpeg upstream: https://trac.ffmpeg.org/ticket/11116
and in the meantime, explicitly pass `av_cpu_max_align` to
`av_frame_get_buffer`.
Pull Request: https://projects.blender.org/blender/blender/pulls/125578
Since the `overlays_enabled` optimizations were introduced in
fe39456ba5, it has been a constant
source of bugs: #113741, #116403, #120628, #125414
There are many cases where the code expects to have the Workbench
depth available even when overlays are disabled.
So this simply disables the optimization and ensures the depth buffer is
always valid.
Pull Request: https://projects.blender.org/blender/blender/pulls/125447
Use the new 'Dynamic Alloc String Storage API' for the allocation
strings of the `read-struct` function in the readfile code.
Compared to the previous code, this change:
- Fixes ASAN aborting before readfile-related memleaks prints.
- In addition to the 'main owner' data type, adds the actual read struct
type (and array size if relevant) to the alloc name.
--------------------
Note that this keeps all combinations of owner/types/array_num generated
strings for the whole duration of the program. However, this only
impacts Debug (and Release `WITH_ASSERT_ABORT`) builds.
The 'real' release builds also use a mapping now, but very small (one
entry per ID type), and with a basic `int` key. Further more, it is
optimized to only do one lookup for a whole ID and all of its 'owned'
structs, so there is no measurable impact on performances in blendfile
reading for release builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/125320
Calling `foreach_get/set` on a collection property did not trigger
a property update. In the attribute API, this lead to missing
updates after e.g. setting the values of an attribute.
This adds a call to `RNA_property_update` for the getter/setter
bpy rna function and adds a property update callback to all the
different attribute collection properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/125518
This removes the legacy Grease Pencil modifiers from the code.
These should have already been inaccessible from the UI and hidden from
the user. The modifiers have been reimplemented for the new GPv3
data structure.
On top of the modifier code, some other related things have been
removed as well:
* Operators related to the legacy modifiers.
* Keymaps for the legacy modifier operators.
* Some bits of code that used modifier functions.
Some code has to be kept, because it is still used:
* The core line art code, which is used by the new line art modifier. It's
moved to `modifiers/lineart`.
* The DNA structs for the legacy modifiers. They are still needed for
conversion.
* A few kernel functions for the modifiers are kept (also for conversion).
Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/125102
This shouldn't make any difference right now, because the main inputs
and outputs of a group always come first. But it's better to not rely on that
here if it can be avoided.
This reverts commit f3c32a36bc and the two followups.
The commit caused issues with both the operator and the modifier.
The operator could be fixed, for the modifier this needs deeper
investigation (see #124836 for a bit more info on this).
Until a better solution is found it is just better to go back to
previous behavior.
Reintroduces #103562 for now
Pull Request: https://projects.blender.org/blender/blender/pulls/125499
If a data-block referenced the same shared data more than once, it used to be
written multiple times. This worked out so far, because the written data is
always the same. So when reading the file, it doesn't matter which written
buffer Blender decides to read on. However, this makes the .blend file look
corrupt and leads to memory leaks on load (#125001).
Pull Request: https://projects.blender.org/blender/blender/pulls/125489
Match function and declaration names, picking names based on
consistency with related code & clarity.
Also changes for old conventions, missed in previous cleanups:
- name -> filepath
- tname -> newname
- maxlen -> maxncpy
When including Python on the tooltips they are meant to be shown using
a monospaced font. This is the case in two of the four places that
python is shown, but not in the other two which include Tool tooltips.
This PR makes them all consistent.
Pull Request: https://projects.blender.org/blender/blender/pulls/125521
Fixes an issue where the original material of the node tree wasn't
connected to the right sockets in most situations after applying
EEVEE-Next shadow mode versioning.
Pull Request: https://projects.blender.org/blender/blender/pulls/125438
This adds the `curve_offsets` collection property.
The curve offsets can be used to get the points that belong
to a curve. They are the offset indices of the first point of
each curve. The first offset is always zero and the last offset
is the total number of points in the drawing.
This adds two new python functions:
* `curves.remove_curves(indices=None)`
* `curves.resize_curves(sizes, indices=None)`
By default, `remove_curves` will remove all curves. If `indices`
are provided, only the curves with the given indices are removed.
The indices have to be in ascending order and mustn't repeat.
The `resize_curves`function will change the number of points
for each curve. If no indices are provided, there must be as
many elements in `sizes` as the number of curves there is.
Otherwise, there must be one element in `sizes` per element
in `indices`. The `sizes` are the new size for a given curve.
If the new size for a curve is smaller, then the curve is
trimmed from the end. If the new size for a curve is greater,
then the end values will be default initialized.
Pull Request: https://projects.blender.org/blender/blender/pulls/125502
This removes the terminal periods automatically added to the end of
tooltip items. The current desire is to only end in period if there
are multiple sentences - so if there is one in the middle of the
description. This also converts our uses of lists to use space and
bullet, rather than just bullet or asterisks.
Pull Request: https://projects.blender.org/blender/blender/pulls/125460
The viewport compositor slows down complex scenes even if it has very
simple setups. That's because it internally computes previews which
involves a fair bit of CPU computation, however, those previews are
actually never written to the original tree, so previewers weren't
really visible so it is effectively redundantly computations.
To fix this, we double down on disabling previews for the viewport
compositor and avoid any redundant computations in that case.
Introduced with d527e3a6bd.
Cached values are tagged as dirty during the update step, this can cause
conflicts where we attempt to then flush then changes into the PBVH but
have not yet updated the mesh pointers and reinitialized them.
This commit forcibly initializes the underlying data to prevent such
cases from happening when flushing to the PBVH.
Pull Request: https://projects.blender.org/blender/blender/pulls/125396
This is a PR that is built on top of #122094 (thanks to @SietseB
for the initial work).
Adds the following properties and functions:
* `layer.frames`,
* `layer.frames.new(frame_number)`
* `layer.frames.remove(frame_number)`
* `layer.frames.copy(from, to)`
* `frame = layer.get_frame_at(frame_number)`
* `frame.drawing`
* `frame.frame_number`
* `frame.select`: the selection state of the keyframe in the dope sheet
* `frame.keyframe_type`
* `drawing = frame.drawing`
* `drawing.type` (`DRAWING`/`REFERENCE`)
* `drawing.user_count`: The number of keyframes that use this drawing
* `drawing.attributes`: attribute read/write access to the drawing data
To be able to access attributes on drawings, a new
`AttributeOwnerType::GreasePencilDrawing` is added.
The API in `BKE_attributes.h` is updated to handle this type.
In `rna_attributes.cc`, there is a new
`rna_def_attribute_group_grease_pencil_drawing` that defines the
attribute group. For this to work, it also defines its own rna
callback functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/124787
Rather than a manually managed union, use `std::variant` which is
generally safer. E.g. an invalid access will now throw an exception
instead of causing undefined behavior (which may or may not crash, or
cause a data corruption). Code is also simplified this way.
Pull Request: https://projects.blender.org/blender/blender/pulls/125494
This patch implements all baking operators for LineArt for GPv3.
The old baking operators are renamed with `_legacy_` to
distinguishing both when calling the operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/125079
While the python API for the legacy Grease Pencil object can be fully
deprecated, annotations still make use of the `bGPdata` DNA and
therefore need their own python API.
This removes `RNA_def_gpencil` entirely, but replaces parts of it
in `RNA_def_annotations` to make sure that annotations keep
working as before. Note that this is only a very small subset of the
legacy Grease Pencil API.
Technically, this "removes" python API functionality from annotations
because they are full Grease Pencil IDs, but the idea is to make them
simpler and encourage users to use Grease Pencil objects instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/125097
Use "asset storage" instead of just "storage", because there are other
members acting as storage (e.g. holding all catalog data), while this is
asset specific.
This was just rather useless level of abstraction. I heard from other
devs that these helper classes caused confusion, so better to avoid
this.
Now the asset representation has all the needed bits to create its full
path, blend-file path and asset library relative path. In fact only the
asset library relative path needs to be stored to make all this
available, since the asset representation already stores a reference to
the asset library owning it, so the paths can be recreated easily.