Since all legacy Grease Pencil modifier are converted to regular modifiers
in versioning, we should never be in a position where we need to write the
old modifiers anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/130388
When points are close together in 2D view space the eraser intersection
function does not have a valid direction vector (zero). This cancels out
terms in the computation that would still contribute to the result and
the function always returns zero intersections.
This patch adds a special case when the direction vector is zero,
so the point distance to the circle is still calculated (just not in
any particular direction).
Pull Request: https://projects.blender.org/blender/blender/pulls/130341
While copying `PointerRNA` struct is currently extremely cheap, this
won't be the case in the future once it starts storing more complex
data.
Keeping an independent copy in `PropertyRNAOrID` struct should never be
needed, as this is a fairly short-lived runtime data, so store a pointer
to the given PointerRNA instead.
Properties that are animated, but have different values than their
animation data, are drawn in orange. This was skipped whenever any NLA
tracks were active (likely because this would re-evaluate the NLA for
every property drawn, which is a performance bottleneck).
This commit lifts this limitation slightly, and only skips the "has this
changed?" check if there are any non-muted NLA tracks. This means that
using the NLA purely as a stash of Actions is now possible without
losing the 'orange means it changed' indicators in the UI.
Fixes: #129968
Pull Request: https://projects.blender.org/blender/blender/pulls/130130
This is not implemented yet so remove the callback function which draws
channel color for GPv3 layers. Also `acf_gpl_channel_color` is a legacy function,
it may lead to different channel color as explained in #130370.
Pull Request: https://projects.blender.org/blender/blender/pulls/130445
The issue was that when the fill strokes were merged into the drawing,
the `fill_opacity` attribute would be created on the drawing
(when it didn't exist before) and initialized to 0. This meant that
all previously drawn fill strokes would disappear.
The fix manaully initializes the `fill_opacity` attribute on the
target geometry before calling `join_geometries`.
Ideally this could be something the attribute system handles
or the `join_geometries` function takes care of by getting
some information about how to initialize attributes.
Pull Request: https://projects.blender.org/blender/blender/pulls/130442
Tell ffmpeg swscale to do accurate YUV->RGB conversion, instead of
slightly faster but not really accurate one. Fixes banding and some
color shifts in video files, particularly in dark regions.
The accurate conversion is a bit slower though, on 4K resolution video,
time taken to convert video frame from YUV to RGB:
- x64 (Ryzen 5950X): 2.3ms -> 3.7ms
- arm64 (M1 Max): 0.6ms -> 2.9ms
My take is that paying 1-2ms per 4K video playback is acceptable
since the result is obviously "more correct" and matches what VLC/ffplay
produces.
From what I can tell, "accurate conversion" turns off some dedicated
assembly code paths within ffmpeg. Maybe someday ffmpeg would get
accurate and assembly-optimized routines for that.
With more accurate decoding, we can now lower the expected render
test threshold again, since x64 & arm64 decoding is much closer now.
Comparison screenshots in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/130383
While adding test coverage for in-memory and packed texture scenarios, I
found that UDIMs were not being handled correctly in both cases. For
in-memory scenarios the per-tile generated/dirty status was not taken
into account. For packed scenarios the wrong filename substitutions were
being used.
This fixes both of these cases and adds test coverage for these
scenarios now. Both relative and absolute path options are validated.
Note: Both in-memory and packed images behave incorrectly when using the
'KEEP' and 'PRESERVE' texture export modes, so those remain untested
currently. A design on exactly what should happen in these modes is TBD.
Pull Request: https://projects.blender.org/blender/blender/pulls/130391
This only happened if there are multiple different resource
handle used inside the same `PassSimple`.
Fix is to use the same logic to find the first instance.
Fix#130384
The background box for VSE text strips can have rounded corners now.
Actual rounded shape is a superellipse with 2.1 exponent; this is
very close to a circle section but feels a bit nicer with more
continuity between the flat part and the rounded part of the box.
At very large rounding radius this is not very fast; optimization
for that case will come in a separate commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/129665
This probably never in practice in these cases.
Constructing a `std::string` from nullptr is invalid.
Starting with C++23, the `nullptr_t` is even explicitly deleted.
The issue was that pointers to `CustomDataLayer.name` are not stable when
attributes are removed. So the change is to create a temporary copy of the
names that need to be removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/130373
Not sure why I got an error about this today in one of my usual
builds... very mysterious, but the `BLI_array_utils.hh` include does
seem to be missing anyway.
When reading UsdPreviewSurface materials from USD files, duplicate links
between nodes would often result. This typically occurs between the
Image node and its upstream UV Mapping node, or between the Image node
and a downstream Separate RGB node. As processing progresses, we
de-duplicate the nodes themselves as each new input/output socket is
discovered. However, we would unconditionally add a link between the
nodes even if we've already added one.
Cycles will complain about this situation and it's obviously incorrect:
`Cycles shader graph connect: input already connected.`
As most UsdPreviewSurface material networks are all fairly small
(<10 links total) I'm not worried about the cost of counting the links
at this point.
Pull Request: https://projects.blender.org/blender/blender/pulls/130356
Doc only mentioned 'None' separators, but 'tuple' items with an empty
identifier string are also valid separators, and allow to get 'named'
separators in the UI.
When copying the window to the swap chain the image needs to be copied
upside down to match Vulkan/OpenGL image coordinate differences.
There was an of by 1 error when copying resulting in minor drawing
glitch which was noticeable when looking at the viewport grid.
Pull Request: https://projects.blender.org/blender/blender/pulls/130328
The crash was caused by the selection attribute not being
initialized properly. The size was 0.
The fix uses `ed::curves::ensure_selection_attribute` to ensure
the attribute is created and on the right domain.
Extrude should only work for a point selection, so the poll
function of the operator is updated to reflect this.
Pull Request: https://projects.blender.org/blender/blender/pulls/130333
1. Trace operator was missing a topology cache tag after replacing the stroke
data. This caused an invalid normals cache and crash in drawing code.
2. The drawings must not be manipulated outside the main thread. Job data now
stores a curves geometry array that is used to update the drawings at the end of the job.
3. Since the job data now stores an array it has to be allocated using MEM_new.
Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/130313
No functional changes intended.
After moving the keying set code to animrig with b38d8ecb86,
a few things needed cleaning up.
* Improving comments
* adding `const` where possible
* simplify code in some areas
Pull Request: https://projects.blender.org/blender/blender/pulls/130314
wdas_cloud.blend file on 4.3+ raises an assert, due to reading some
VSE data:
readfile.cc:4798, blo_verify_data_address(), at
'MEM_allocN_len(new_address) >= expected_size' Corrupt .blend
file, unexpected data size.
This is caused by 30dbb7820d which removed completely unused
data from Sequence struct. But it turns out, Sequence serialization
inside scene_blend_read_data is "somewhat strange", to put it mildly,
and silently assumes that struct offset of seqbase and channels
will never change.
For now, restore the previously expected struct member offset,
ensure it stays like that via static_assert, and add notes on
how someone should fix this in a better way.
Pull Request: https://projects.blender.org/blender/blender/pulls/130296
Fix an assertion that an embedded data-block has a zero 'real user'
count. Apparently it's possible for the shader node tree (embedded by
the material) to have a user count of 1.
Since that looks valid to me (only one user, namely the material itself)
I think it's fine to extend the assertion to that.
I did keep the assertion, to ensure that the embedded data-block is not
shared by multiple users. That shouldn't be possible, in any case.
Pull Request: https://projects.blender.org/blender/blender/pulls/130281
No functional changes intended.
This patch moves the relevant keying set code from editors to animrig.
All functions are in the animrig namespace, and as such have lost their
`ANIM_` prefix.
Other than that, the code has been moved as is into `animrig/intern/keyingsets.cc`
Note that I also had to move `id_frame_has_keyframe` and `fcurve_frame_has_keyframe`.
I moved that into `ANIM_keyframing.hh` and `ANIM_fcurve.hh` since I found that more fitting.
Due to Windows defining `DELETE` as macro I had to rename `ModifyKeyMode::DELETE`
to `ModifyKeyMode::DELETE_KEY`
As a result of this two includes from animrig to editors were removed.
This is part of #121336
Pull Request: https://projects.blender.org/blender/blender/pulls/129980
This allows using C++ types in the region runtime data, which will
make it easier to move the remaining runtime data out of the
`ARegion` DNA type and improve code readability in these areas.
Pull Request: https://projects.blender.org/blender/blender/pulls/130196