The default keymap item that triggers `Shrink/Fatten` uses the `Alt`
modifier, which coincidentally is the same key that toggles
`Offset Even`. What is undesirable.
The solution is to alternate between Alt Press and Alt Release
depending on the `Offset Even` property.
Pull Request: https://projects.blender.org/blender/blender/pulls/141904
This fixes 4 bugs all conspiring to make the referenced SubD scenario
quite broken:
- When manually creating a MeshSequenceCache, the reading of edge and
vertex crease data was skipped. Fixed by reading crease data inside
the common `read_mesh` method.
- When importing an Alembic with animated edge or vertex crease data, a
MeshSequenceCache modifier was not being added to the object. This was
due to not checking the relevant crease properties and required adding
a specialized `has_animations` function.
- When importing animated vertex crease data, a duplicate `vertex_crease`
attribute would be created, breaking the animation. Fixed by using the
attribute API rather than custom data.
- The MeshSequenceCache scenario would call into the Alembic Mesh reader
which ended up referencing deallocated stack memory for the
ImportSettings. In release builds this would cause sporadic failures
because the value of `blender_archive_version_prior_44` would be
random. There was already a very old TODO for this and we finally
really needed to address it.
A new test was added which exports animated creases on two meshes and
re-imports them back in. It verifies that each mesh gets a
MeshSequenceCache modifier added and also ensures the values of the
creases are correct for all frames.
Pull Request: https://projects.blender.org/blender/blender/pulls/141646
This is not an actual solution, it falls back to a perspective camera instead
of crashing. Note full_rastertocamera exists specifically for computing raster
size for adaptive subdivision, and changing it should not affect anything else.
Pull Request: https://projects.blender.org/blender/blender/pulls/141905
This was caused by 87c011f8bb. The drawing code for the input nodes was moved
into a new `custom_draw_fn` callback on the socket declaration. This was not
taken into account when drawing the sidebar yet, which is an oversight and was
not an intentional change.
This fix applies to all the nodes that use the new custom draw function.
Pull Request: https://projects.blender.org/blender/blender/pulls/141872
The node warnings were only referenced by the tooltip function. Since they are
recreated on every evaluation, this resulted in a use-after-free. The fix is to
just copy the node warnings into the callback.
Of course this extra copy does have some performance implications, but I don't
think those are significant currently.
Pull Request: https://projects.blender.org/blender/blender/pulls/141875
Different operations may need to lock different part of the interface,
e.g. for rendering, the image editor may still need refreshing while the
interface is locked, but when baking data into a scene, the image editor
needs to be locked because it is not thread safe to get data from a
partially evaluated depsgraph.
This is a better fix on top of 7c8b8b2457
that addresses the root cause with more flexibility for future
operations that requires different interface locking strategy as
well.
Pull Request: https://projects.blender.org/blender/blender/pulls/141866
When the Join as Shapes operator created new shape keys, trigger a rebuild
of depsgraph relations. Otherwise mesh evaluation may see original keys
instead of evaluated ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/141892
Only major and minor versions are available at that point, not the
blendfile subversion.
Version info is available in both `bpy_library` items returned by the
context handler, as a `version` property that is a tuple of two numbers.
Co-authored-by: Campbell Barton <campbell@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141462
These changes introduce modifications to the SYCL queue creation
in OneapiDevice::create_queue. In case several DPC++ devices are
detected by Blender and exposed through it, we are now creating
a new SYCL context for each device, which allows us to prevent
execution failures due to some known issues in the DPC++ runtime
regarding multi GPU support. As this would have some small
performance impact, few percents, it is only applied to
multi GPU configurations, while the behavior for a single
GPU configuration remains the same.
Pull Request: https://projects.blender.org/blender/blender/pulls/141834
Caused by 3d6ea7c075
Before that commit, it was possible to retrieve shape key data from
other objects with a different number of edges or faces. One crucial
case where that is important is when the other mesh is a triangulated
with otherwise the same vertex count.
In general it's better to be flexible and allow other changes besides
the vertex count, especially since that's such a simple check that users
can easily understand.
Pull Request: https://projects.blender.org/blender/blender/pulls/141794
The 'surface' Object pointer of the new curves ID was not defined as
overridable, which would break liboverride hierarchies, which would then
be re-generated everytime on blendfile opening.
LZO and LZMA is only used for compressing point caches inside of
Blender. As we already use ZSTD for compressing other data in Blender it
makes sense to remove LZO and LZMA to simplify our library requirements
(and lessen our library maintenance burden).
I've talked to Sergey about this and he suggested that I leave the LZO/LZMA
libraries and code around but effectively disabled until beta, so if there is a
huge uproar, we can easily reinstate the support.
Pull Request: https://projects.blender.org/blender/blender/pulls/141461
This adds a function `GreasePencil::count_frame_users_for_drawings()`
that computes the drawing user counts from the layer frames. This is used
to correctly initialize the runtime drawing user counts when reading the ID.
Note that we don't expose any functionality to instance drawings currently.
This change is also in preparation for when this will be possible.
Also adds a function `GreasePencil::validate_drawing_user_counts()` that
compares the actual user counts with the runtime user counts that are
stored. Only runs these checks in debug builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/141458
Replace a `StringRef` with `std::string`, so that a copy is made of the
grid item identifier.
This identifier is used on redraw, to correlate the newly-drawn items
with items from the previous redraw. Using a `StringRef` here was
problematic when there's local assets, as those can be freed & re-built
(which in the case of the report happens on save/undo). Because of this,
the reference got corrupted, and the map lookup would fail. The "old
items" map now has a copy of the identifier, ensuring it is independent
of the data it represents.
Co-authored by Julian Eisel.
Pull Request: https://projects.blender.org/blender/blender/pulls/141888
Regression caused by 9e4c26574a.
Add strip stack as a key to the final cache.
Use the pointer to the list of sequences, as it is the easiest one to
obtain in all places where it is needed. This is slightly different
from the code prior to the 9e4c26574a where strips.last() was used,
but it allows to use the same logic in the prefetch job.
Pull Request: https://projects.blender.org/blender/blender/pulls/141778
Only last tangents layer was written to all tangent layers before this fix.
Code before fix evaluate tangents for all layers into mesh loops data (which keeps data only for one layer) and then writes information about 'each' layer which is actually only the last one.
Code after fix evaluates tangents in the beginning of the loop that exports tangent data so that data for correct layer is being written into fbx.
Co-authored-by: Andrey Zhitkov
Pull Request: https://projects.blender.org/blender/blender/pulls/141839
Blender will crash if a file with an Alpha Over node was saved in 4.4,
then in 4.5 alpha, then back to 4.4. This is because the node was
missing forward compatibility code that allocates storage that was
necessary for the file to load correctly on older versions.
This was essentially missed in b62ef2cdd6 and 976efdcac9.
Pull Request: https://projects.blender.org/blender/blender/pulls/141873
The C++ Vector container has the benefits of the older C type,
along with improved performance, better type and memory safety,
and significantly improved ergonomics.
Pull Request: https://projects.blender.org/blender/blender/pulls/141759
When calculating the font size clamp by the requested cursor size
instead of 256.
This will often make the cursor smaller since allowing 256px wide
cursors is quite large.
Also de-duplicate size checks & round the text size to an integer to
avoid fractional scaling from subtle changes to the text.
Instead of relying on the the `U.ui_scale` being set when activating
the window, calculate the cursor size from the windows DPI.
This also de-duplicates cursor scale calculation.