Commit Graph

123662 Commits

Author SHA1 Message Date
Bastien Montagne
5095ecc67b Cleanup: Rename LibOverride-related enum flags/tags.
Mainly use a shorter, straight-forward prefix (`LIBOVERRIDE`), and
unify/make these enum names more consistant. No functional changes
expected here.
2023-05-02 16:14:53 +02:00
Bastien Montagne
9ea2170cce LibOverride: Resync: Fix some issues with partial resync.
In some cases, some partial resync roots would be missed during the
partial resync process, leading to incomplete resync of all the needed
data.

This was caused by tagging some liboverrides for resync _after_ they had
already be evaluated as part of parenting hierarchy of other
liboverrides. Fix is simply to split both steps apart, such that all IDs
that need it are tagged to resync first, and then hierarchies are
evaluated to find the required partial resync roots whithin a hierarchy.
2023-05-02 16:14:53 +02:00
Bastien Montagne
ba9ca7afb6 LibOverride: Resync: Delete non-user-edited 'isolated from root' liboverrides.
These should not be needed anymore. Follow-up to previous commit.
2023-05-02 16:14:53 +02:00
Bastien Montagne
5574a1bfc1 LibOverride: Fix/Improve resync behavior in some complex cases.
This commit mainly addresses issues when a part of an override hierarchy
does not match anymore the linked reference data, and gets isolated form
the hierarchy root (there is no parenting chain to the root anymore).

The typical case being an object or sub-collection being moved to
another subcollection in the linked data.

Case identified while working on some Pets production files.

Note that in some cases this isolated chunk of the hierarchy will be
linked back into the appropriate place, in others it should be fully
removed (instead of staying as unused data). The later will be handled
in a another future commit.

This commit mainly detect and use a new tag for such cases, and correct
the checks to take it into account.

It also does a bit of cleanup, and replaces some asserts by `CLOG_ERROR`
reports.
2023-05-02 16:14:53 +02:00
Bastien Montagne
b724015840 LibOverride: Fix wrong assert in some cases in RNA tracks handling.
Due to index-only referencing in insertion of new NLA tracks in
liboverride data, it may happen that the source of an inserted track
cannot be found.

This index-only based handling of NLA tracks in liboverrides is very
weak, in the future this will be solved by ensure uniqueness of their
names, then name-based reference can be used instead, as already done with
modifiers, constraints, etc.
2023-05-02 16:14:53 +02:00
Jeroen Bakker
17201752d9 Vulkan: Add FLOAT to SRGB and Depth24 Conversion
This PR adds support to convert host/device data from floats
to GPU_SRGB8_A8 and GPU_DEPTH_COMPONENT24.

Pull Request: https://projects.blender.org/blender/blender/pulls/107544
2023-05-02 15:57:17 +02:00
Jeroen Bakker
13fe6d0170 Vulkan: Silence Compilation Warnings
This PR silences some compilation warnings in the command buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/107541
2023-05-02 15:52:53 +02:00
Julian Eisel
5e3bf37982 Cleanup: Add internal header for View2D files
Code was exposing apparently internal functions to the public header, so
it could reuse it in other View2D files. Worse even, a struct was
defined twice in different source files and they would have to be kept
in sync, just because there is no shared header file.
Such internal header files are useful and don't really cause any harm.
2023-05-02 15:02:06 +02:00
Jacques Lucke
20b19f2b12 Fix: calculating duplicates in kdtree does not work with selection
This fixes a crash where merging vertices by distance leads to a crash since
0652945dbd. The change did not cause
the bug though, it just made the underlying issue visible.

The issue was that `kdtree_order` assumed that the `KDTreeNode.index` didn't
have gaps, i.e. every index in a certain range is used. However, that is not the
case when only a subset of the vertices of a mesh are added to the kdtree.

Pull Request: https://projects.blender.org/blender/blender/pulls/107535
2023-05-02 14:25:55 +02:00
Pratik Borhade
c04e709c6a Bump blender file format subversion
This change is required for 0001485365. File version bump was included
in PR but it was behind the main branch. In main, version was updated
by 5d0595fded.
2023-05-02 17:37:58 +05:30
Campbell Barton
3b5aba8cf8 Fix invalid argument to BLI_path_split_dir_file
get_index_dir passed in the wrong size, also remove strange use of
BLI_path_split_dir_file which copied the directory into `file`,
only to overwrite it with the `file` afterwards.
2023-05-02 21:32:51 +10:00
Campbell Barton
27e4ab80fb BLI_path: disallow passing NULL arguments to BLI_path_split_dir_file
Instead BLI_path_split_dir_part & BLI_path_split_file_part can be used.
2023-05-02 21:32:51 +10:00
Campbell Barton
1ab72e8459 Cleanup: use BLI_path_* prefix for path splitting functions
Also order string size after each string instead of grouping strings and
their sizes afterwards.
2023-05-02 21:08:13 +10:00
Pratik Borhade
0001485365 Allow renaming F-curve modifier
Modifier name is being displayed as label in panel header which has restricted
the editing of it. This PR will allow to change the name of F-curve modifier
by exposing string property "name"
Included versioning code for modifier name. This will add suffix to the name if
multiple instances of same modifier exists in modifier stack.

Differential Revision: https://archive.blender.org/developer/D17142

Pull Request: https://projects.blender.org/blender/blender/pulls/104949
2023-05-02 13:07:48 +02:00
Campbell Barton
90361278d7 Cleanup: use function style casts, remove redundant parenthesis 2023-05-02 20:26:17 +10:00
Sergey Sharybin
93b9b79b19 Fix strict compiler warning
Mismatched array bounds in function declaration and definition.

Pull Request: https://projects.blender.org/blender/blender/pulls/107530
2023-05-02 11:32:45 +02:00
Sergey Sharybin
e3f14b99c3 Refactor: Convert ImBuf to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/107503
2023-05-02 11:32:27 +02:00
Sergey Sharybin
a54c399b41 Fix crash doing a stroke in the weight paint
A regression since 2d2f4d9d28: the sculpt session is re-used by the
weight paint, so changes to semantic in one place requires same
changes in another.

Before the change the `original` was intiialized to false (due to the
clear-alloc), but after the change it was the accum with an inverted
meaning which was initialized to false.

Pull Request: https://projects.blender.org/blender/blender/pulls/107533
2023-05-02 11:02:13 +02:00
Adi Sage
cc84d83929 Fix #106853: Tooltip fix of OT_constraints_clear
The existing tooltip of Clear Constraints modifier in object mode
(`object.constraints_clear`) didn't match its functionality. It said it
works only on the active object, but it affects all selected objects.

Hence, the tooltip has been changed from 'Clear all the constraints for
the active object only' to 'Clear all the constraints for the selected
objects'.

Also the tooltip for 'Clear Pose Constraints' in Pose Mode was updated
for consistency with the above update.

Pull Request: https://projects.blender.org/blender/blender/pulls/106918
2023-05-02 10:23:51 +02:00
YimingWu
4c99043a85 Weight Paint: Fix wrongly used lookup_or_default()
This function is changed by #107059 since my original patch in #106417,
so when merged it caused compilation error. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/107529
2023-05-02 10:19:35 +02:00
Campbell Barton
03377281d2 Cleanup: avoid nullptr casts to access a struct members size 2023-05-02 17:19:49 +10:00
Campbell Barton
015343033c Cleanup: use FILE_MAX instead of PATH_MAX for sequencer add code
This is clamped by StripElem::name which is a filename component,
so no need to use PATH_MAX which is much larger.
2023-05-02 17:19:48 +10:00
Campbell Barton
b315a17902 Cleanup: replace strcpy, strcat with BLI_string_join
Avoids buffer overflows & more straightforward.
2023-05-02 17:19:48 +10:00
Campbell Barton
f154d37335 BLI_path: add a size argument to BLI_path_frame
Resolves potential buffer overflow in
USDVolumeWriter::construct_vdb_file_path which passed in a smaller
fixed size buffer than FILE_MAX.
2023-05-02 17:19:48 +10:00
Campbell Barton
0428043967 BLI_string: add BLI_strncat, replace use of strcat that could overflow 2023-05-02 17:19:48 +10:00
YimingWu
0a0a29887d Fix #106354: Account for hidden vertices in weight gradient operator
Weight gradient operator didn't respect hidden vertices. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/106417
2023-05-02 09:05:26 +02:00
Campbell Barton
2483c19ad3 BKE_idprop: string size argument consistency, fix off by one errors
The length passed to IDP_NewString included the nil terminator
unlike IDP_AssignString. Callers to IDP_AssignString from MOD_nodes.cc
passed in an invalid size for e.g. There where also callers passing in
the strlen(..) of the value unnecessarily.

Resolve with the following changes:

- Add `*MaxSize()` versions of IDP_AssignString & IDP_NewString which
  take a size argument.

- Remove the size argument from the existing functions as most callers
  don't need to clamp the length of the string, avoid calculating &
  passing in length values when they're unnecessary.

- When clamping the size is needed, both functions now include the nil
  byte in the size since this is the convention for BLI_string and other
  BLI API's dealing with nil terminated strings,
  it avoids having to pass in `sizeof(value) - 1`.
2023-05-02 15:15:40 +10:00
Campbell Barton
d5d3305280 Cleanup: IMB_metadata_set_field assigned the string twice in some cases 2023-05-02 14:11:40 +10:00
Campbell Barton
ae76fa2da3 Fix #107525: Crash loading pre 2.5x files with multiple windows open 2023-05-02 13:36:16 +10:00
Campbell Barton
b6a7b786c6 Cleanup: reduce line wrapping caused by trailing comments 2023-05-02 10:42:24 +10:00
Campbell Barton
a0db0a5580 Cleanup: move comments wrapped with MultiLine control statements
In some cases comments at the end of control statements were wrapped
onto new lines which made it read as if they applied to the next line
instead of the (now) previous line.

Relocate comments to the previous line or in some cases the end of the
line (before the brace) to avoid confusion.

Note that in quite a few cases these blocks didn't read well
even before MultiLine was used as comments after the brace caused
wrapping across multiple lines in a way that didn't follow
formatting used everywhere else.
2023-05-02 09:54:48 +10:00
Campbell Barton
6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
Campbell Barton
391f86bc38 clang-format: set BraceWrapping::AfterControlStatement to "MultiLine"
This was the code-style Blender used before switching to clang-format
which did not support this style of brace placement at the time.

Since then support was added, this helps readability as the beginning
of braces isn't as clear in the case of multi-line conditionals.

This implements a proposal from #75956.
2023-05-02 09:37:08 +10:00
Campbell Barton
ec25c7b341 Cleanup: remove outdated/invalid comment 2023-05-02 09:36:51 +10:00
Campbell Barton
6a5ab77dcc Cleanup: format 2023-05-02 08:41:10 +10:00
illua1
0652945dbd Fix #107306: Merge by distance node is not deterministic
In some cases the node didn't reproduce the same results given the
same input. Based on the test results (just 2 very detailed cubes
and a transformation), it doesn't seem to affect performance that
much. Credit to @MMMM who pointed out this option.

Pull Request: https://projects.blender.org/blender/blender/pulls/107312
2023-05-01 22:15:19 +02:00
Germano Cavalcante
c7f1ad1058 Fix #107474: Proportional Size not saved when canceling the operation
cc623ee7b0 did not consider some implications such as the habit of
users initiating transform operations just to change the size of the
Proportional Edit.

Therefore, partially revert the cc623ee7b0.
2023-05-01 13:58:17 -03:00
Hans Goudey
5525e5b942 Fix #107480: Crashes in mesh format conversion for old files
There were a few issues, but they mostly came from the fact that some
versioning was done in the "after linking" versioning, which came after
the regular legacy mesh conversion. Also, the `MFace` array wasn't
necessarily part of CustomData for some very old files.

The `BKE_mesh_strip_loose_faces` function was moved because it now
uses the deprecated `me->mface` pointer.
2023-05-01 11:33:42 -04:00
Michael B Johnson
3c74575dac Fix #107062: support opacityThreshold when exporting USD
This PR addresses issue “USD export does not respect opacity threshold for clip alpha blend mode #107062”

This commit extends the USD Preview Surface material support to author the opacityThreshold attribute of materials on export, when the Alpha Clip blend mode is selected.

When authoring alpha cutouts in Blender, one sets the Blend Mode to "Alpha Clip", and the Clip Threshold to some value greater than zero.
When this case is detected on export, we now author the opacityThreshold attribute to match the specified clip threshold.

Note that opacityThreshold is already handled correctly on import, so this change allows the feature to be fully round-tripped.

Co-authored-by: Matt McLin <mmclin@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/107149
2023-05-01 17:28:23 +02:00
Hans Goudey
f59fdc40ec Fix: Missing normalization for sampled normals when adding curves
Mistake when splitting up commits for 0a5f0890cc.
2023-05-01 08:41:20 -04:00
illua1
314866eb3a Fix #107431: tag node tree topology as changed when changing socket order
Pull Request: https://projects.blender.org/blender/blender/pulls/107437
2023-05-01 13:22:44 +02:00
Chris Blackbourn
3ea060860a UV: Tuning rotating to minimum square during packing
* Perform rotate_inside_square earler in the pipeline. (improved layout)
* #rotate_inside_square with AABB margin if there is only one island.
* Conservative bounds when using xatlas on non-D4 transforms.
2023-05-01 23:18:15 +12:00
Aldo Bleeker
d68ed238b9 Cycles: solve compilation errors with OptiX 7.7
* User simpler API names that accept both PTX and OptiX-IR
* New argument for optixProgramGroupGetStackSize, leave to default
* Remove OptixPipelineLinkOptions::debugLevel that does nothing

Pull Request: https://projects.blender.org/blender/blender/pulls/107450
2023-05-01 12:07:26 +02:00
Omar Emara
3f6912ece2 Realtime Compositor: Implement Mask node
This patch implements the Mask node for the realtime compositor. The
evaluation of the mask is not GPU accelerated, but is cached as a form
of temporary implementation until we implement a GPU evaluator for
masks.

One limitation currently is that we do not redraw the viewport while the
mask is getting edited by the user, because always doing that will be
redundant in most situations, and conditioning the redraw requires a lot
of work that should be handled outside of this patch.

This is similar to the Texture node implementation in 151a53110c.

Pull Request: https://projects.blender.org/blender/blender/pulls/107464
2023-05-01 11:29:06 +02:00
Omar Emara
92983967cb Cleanup: Improve readability of Mask node flags
This patch improves the readability of the Mask node flags by using the
same naming conventions as other node flags.
2023-05-01 12:07:57 +03:00
Julian Eisel
f8d2156dda Fix #104722: Outliner renaming uses wrong item
The property value should be reset for the next operator execution, not
remembered. Also hide it from auto-generated UIs, this is an internal
property nothing meant for the user to edit.

Also see discussion in #105872.
2023-05-01 11:03:39 +02:00
Julian Eisel
20f54a5698 Asset Browser: Let "Clear Asset" act on entire selection
Users were confused that "Clear Asset" would only act on the clicked on
asset, not the entire selection. They would have to clear them one by
one, which can be quite annoying. The previous commit prepared the asset
clearing operator for this, so all this commit has to do is expose the
selected IDs to context.
2023-05-01 10:47:55 +02:00
Julian Eisel
f22e2bab72 Assets: Prefer selected IDs over single active ID for asset mark/clear
Shouldn't cause user visible changes.

Usually batch operations are more handy, so prefer editing multiple
items over a single one. That is, act on the whole selection not the
active item. Mark and clear will now respect this when retrieving IDs
from context, however right now there's no case where actually both
selected and the active ID are exposed in context. Because of this there
shouldn't be a user visible change until the following commit.
2023-05-01 10:47:55 +02:00
Jason Fielder
36e1ebc78d Metal: Resolve runtime issues with texture views
When creating a texture view, Metal may require that the original
GPUTexture state is modified in some way. This may be a result
of deferred creation, or, to cache the texture view against the
source.

As a result, GPUTexture passed into GPU_texture_create_view
cannot be const.

Small fixes have also been made in the Metal texture
implementation to ensure correct function of texture views.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/107167
2023-05-01 09:14:00 +02:00
Campbell Barton
46316b29dc GHOST/Wayland: remove keyboard modifier mismatch warning suppression
Detecting when to show warnings about GHOST/XKB modifier
mismatches was rather involved, remove the check as it's
unnecessary for Gnome-Shell >= v43.

Older versions of Gnome-Shell will show warnings on window activation
with modifier keys held.
2023-05-01 11:57:45 +10:00