Commit Graph

107514 Commits

Author SHA1 Message Date
Lukas Tönne
8c2cf0f218 Fix: GPv3: Memory leaks from Grease Pencil undo steps
The `StepObject` stores customdata but relies on C++ object destruction.
CustomData is a C struct and doesn't get freed automatically, the
StepObject needs a destructor that takes care of the owned custom data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119125
2024-03-06 15:42:25 +01:00
Falk David
bab3e5c442 Fix: GPv3: Frames map not saved
The copy constructor of the Layer class didn't do a copy
of the frames storage (DNA) and only a copy of the frames map (runtime).
This is fine, but we need to make sure to tag the frames storage,
because it is out of sync otherwise.
During edit mode undo, the layers were copied (but the frames storage not tagged) which meant that after undoing and then saving the file,
the frames would be gone after reloading.

The fix makes sure we tag the frames storage, so that it is properly synced.
2024-03-06 13:56:27 +01:00
Miguel Pozo
500a891ac9 Fix: EEVEE-Next: Use the correct shadow radius
Typo/mistake from #118860.
2024-03-06 13:21:39 +01:00
Lukas Tönne
e3c0f64154 GPv3: Fix outline modifier unstable end cap direction
The angle of the outline modifier caps was computed in a [-pi, +pi)
interval, but this creates an unstable situation for angles close to
180. Small variation can lead the angle to flip from +180 to -180 and
change the direction of the semi-circle. Instead generate arcs always
in counter-clockwise direction and use angles in the [0, 2pi) intverval.
This creates stable directions for end caps and also allows larger
arcs where necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/119122
2024-03-06 12:40:46 +01:00
Lukas Tönne
f51e93bec7 GPv3: Shrinkwrap modifier
Port of shrinkwrap modifier from GPv2.

Adds a new API function in `BKE_shrinkwrap.hh` for the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119118
2024-03-06 12:05:00 +01:00
Bastien Montagne
23ce5b6567 Merge branch 'blender-v4.1-release' 2024-03-06 10:06:08 +01:00
Bastien Montagne
bb00621965 Fix recent regression preventing animation on any linked data.
Regression in 427eed292d.

Root of the issue was that animation system was using a single same
check to decide if an F-Curve/driver was valid to use to animate some
data, and whether user can create/edit animation for that data.

Both cases are actually different, since e.g. linked data is not
user-editable, but it can still be animated (either by related linked
Actions, drivers defined in the linked data, or some more hackish
changes like py API/RNA scripting).

This commit now defines two checks:
 * `RNA_property_animateable`: whether a RNA pointer & propoerty is
   animateable, based on their types and definition.
 * `RNA_property_anim_editable`: whether a specific data referenced by
   the RNA pointer and property is effectively user-editable.

The new `driveable` check added by 427eed292d is also renamed to
`RNA_property_driver_editable` (since the basic type-based
`RNA_property_animateable` is also valid for drivers currently).

Pull Request: https://projects.blender.org/blender/blender/pulls/119089
2024-03-06 10:02:53 +01:00
Omar Emara
d31ff88af7 Merge branch 'blender-v4.1-release' 2024-03-06 08:28:04 +02:00
Omar Emara
bfec649bd9 Fix #119043: Compositor crashes with intricate setup
The Realtime Compositor crashes with intricate node setups. That's
due to hardware limitations where shaders can't have as many output
images as needed by the compositor shader operations. To fix this, we
recursively split shader operations until their output count fits the
hardware limitation.

Pull Request: https://projects.blender.org/blender/blender/pulls/119075
2024-03-06 07:25:05 +01:00
Sean Kim
3f57081346 Cleanup: Remove unnecessary property for new hide operators
This PR removes the mistakenly added `WM_operator_properties_border` RNA properties for the new `PAINT_OT_hide_show_masked` and `PAINT_OT_hide_show_all` operators. Neither of these is a box gesture operator so they do not need them.

Pull Request: https://projects.blender.org/blender/blender/pulls/119113
2024-03-06 06:25:41 +01:00
Sean Kim
2b3d93295e Cleanup: Convert eShapeType to enum class
This PR converts the other `gesture` `enum` to an `enum class` and does minor renaming of its members.

Pull Request: https://projects.blender.org/blender/blender/pulls/119111
2024-03-06 06:24:46 +01:00
Campbell Barton
f1eecd6425 Cleanup: quiet missing-declarations warning, format 2024-03-06 15:45:37 +11:00
Sean Kim
705964d7bb Sculpt: Migrate Box Hide to common gesture code
This PR migrates the existing `PAINT_OT_hide_show` operator to the
previously extracted `gesture` namespace performed in #118881

The current operator has support for choosing whether the hide / show
action is performed on every vertex inside or outside the selection
area. This has been added to the common gesture functionality too,
but no common operator property has been exposed for it for the other
Lasso / Box tools to use.

Other modes of the current "hide_show" operator have been split
into separate operators: `PAINT_OT_hide_show_all` and
`PAINT_OT_hide_show_masked`.

Prerequisite for #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119040
2024-03-06 05:25:43 +01:00
Campbell Barton
c4a74ff2de Fix #119102: GLSL was the default formatter without a file extension
Regression in [0] which registered the GLSL formatter before Python.
Resolve and note that the registration order matters in code-comments.

[0]: 462c144f41
2024-03-06 15:12:00 +11:00
Campbell Barton
d686699316 Cleanup: various non-functional C++ changes 2024-03-06 14:47:29 +11:00
Campbell Barton
aba193ad30 Cleanup: disable unused code 2024-03-06 14:43:15 +11:00
Campbell Barton
95273b0c23 License headers: add SPDX headers 2024-03-06 14:43:14 +11:00
Germano Cavalcante
d37328840a Fix #119107: assert triggered when snapping with constraint in UV editor
This assertion is incorrect regardless.
2024-03-05 23:36:28 -03:00
Sean Kim
1fe82d536d Cleanup: Add missing license and copyright headers
This PR adds the standard license header that was missed when the file was originally created.

Pull Request: https://projects.blender.org/blender/blender/pulls/119105
2024-03-06 02:20:17 +01:00
Harley Acheson
77e84cb528 Merge branch 'blender-v4.1-release' 2024-03-05 12:18:09 -08:00
Harley Acheson
49c723e117 Fix #118765: Show Startup Popup Warning on Main Window
During startup, popup block warnings should be displayed on the main
window, not a child window even if it is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/119096
2024-03-05 21:16:35 +01:00
Miguel Pozo
bdba57e095 Fix: EEVEE-Next: PCF on perpendicular surfaces 2024-03-05 20:39:06 +01:00
Hans Goudey
8d26692912 Merge branch 'blender-v4.1-release' 2024-03-05 14:26:04 -05:00
Hans Goudey
90fb838416 Fix: Geometry Nodes Sort Elements node crash with nested instances
Typically nodes that edit instances only change the top level of
instances. As an oversight, that wasn't done in the sort elements node.
This causes problems as the top level of instances are reordered and
nested instances are edited. As the top-level is replaced, its
contained geometry sets (the nested instances) are deleted.

To fix, only reoder the top-level instances in this node.
2024-03-05 14:18:29 -05:00
Miguel Pozo
71ff93bb32 Fix: EEVEE-Next: PCF Overshadowing
Avoid overshadowing caused by shadow filtering.

Pull Request: https://projects.blender.org/blender/blender/pulls/118910
2024-03-05 20:02:47 +01:00
Miguel Pozo
c0f23e79e3 EEVEE-Next: More conservative shadow LOD selection
Ensure shadow-maps at non-zero LODs cover <1 screen texel.
This still doesn't solve projective aliasing, though.
2024-03-05 19:06:51 +01:00
Miguel Pozo
fe93664cef EEVEE-Next: Avoid shadowmap padding on 0 radius punctual lights
Use the original Light radius to compute the shadowmap projection.
Avoid unnecessary padding in shadowmaps, increasing the perceived
shadow resolution when the shadow softness is not 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/118860
2024-03-05 18:59:44 +01:00
Harley Acheson
615edb3f3c UI: Props Dialog Default Properties
Allow activating numerical buttons upon opening of props dialogs. Set
defaults for some dialogs where appropriate.

Pull Request: https://projects.blender.org/blender/blender/pulls/119007
2024-03-05 18:54:50 +01:00
Falk David
a11335d19a Cleanup: Move BKE_fcurve.h to C++
No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119094
2024-03-05 18:39:08 +01:00
Hans Goudey
25ad66cb4c Merge branch 'blender-v4.1-release' 2024-03-05 11:58:23 -05:00
Hans Goudey
6181341bad Fix #119091: Incorrect path for WM context RNA property
Mistake in 61fb2b17c8
2024-03-05 11:57:22 -05:00
Harley Acheson
a1f92f5820 Refactor: ui_draw_popover_back Impossible Null Dereference
The function ui_draw_popover_back has a "block" argument, that is
checked for null, but then has an "else" that would require it and
cause a null pointer dereference. This is an internal function that has
one caller, in response to a condition on that same block's flag.
Therefore this PR removes this function's check for null and the else
code as this condition is not possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/119092
2024-03-05 17:39:35 +01:00
Hans Goudey
94770b74be Merge branch 'blender-v4.1-release' 2024-03-05 11:32:47 -05:00
Hans Goudey
7b94e61f09 Fix #119047: Avoid copying captured attribute to itself
The "capture field on geometry" utility is used in many places to store
the result of field evaluation as an attribute. There is a special case
for when an attribute already exists with the same name, data type, and
domain. But when exactly the same attribute was stored, it would assert
because it ended up copying an array to itself. Arguments for those copy
functions aren't supposed to alias each other.

As a fix, clarify the logic a bit to return earlier in this case.
Also remove a redundant case handling the same thing later on
in the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119063
2024-03-05 17:32:09 +01:00
Hans Goudey
5993c517bd Cleanup: Use C++ Array, Span, int2 for lasso coords 2024-03-05 11:29:04 -05:00
Hans Goudey
139607dd26 Cleanup: Move BLI_bitmap_draw_2d.h to C++ 2024-03-05 10:28:17 -05:00
Hans Goudey
164eb3c25b Cleanup: Move lasso utility files to C++ 2024-03-05 10:23:11 -05:00
Hans Goudey
b4bce46410 Merge branch 'blender-v4.1-release' 2024-03-05 09:53:18 -05:00
Sean Kim
4d8dad056c Fix #119070: Fix crash in sculpt menu lasso tool
This PR adds an extra check to exit from sculpt gesture code early to
avoid attempting to allocate a 3 * (UINT_MAX - 1) amount of elements
inside the trim gesture code.

Pull Request: https://projects.blender.org/blender/blender/pulls/119073
2024-03-05 15:50:40 +01:00
Hans Goudey
f2ab2ad8da Cleanup: Correct comments about custom data masks 2024-03-05 09:46:36 -05:00
Falk David
a4e5469cc0 BLI: Bounds: Add basic functions
The overall goal is to be able to eventually replace the `BLI_rect.h` C-style API.
This only adds come basic functions and tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/118964
2024-03-05 14:32:48 +01:00
Philipp Oeser
a58a2b0f5d Merge branch 'blender-v4.1-release' 2024-03-05 13:15:45 +01:00
Philipp Oeser
8c3b85d666 Fix #84848: Specific Rig Crashes blender when going into pose mode
The armature reported had two bones with a `bMotionPath` but its lengths
are zero (which causes trouble in `motion_path_cache` drawing code due
to 0 allocations).

Not exactly sure how we got there, something like
`animviz_verify_motionpaths` should take care of this already in current
code, but this might be from a time where there were not enough sanity
checks.

So now early out in `motion_path_cache` if we encounter such a
"corrupted" motion path.

Pull Request: https://projects.blender.org/blender/blender/pulls/119081
2024-03-05 13:15:18 +01:00
Philipp Oeser
959595069d Fix #95411: Collada export crashes if temporary file is not accessible
This can happen e.g. when relative "//" is in Preferences > File Paths >
Temporary Files is used.

Now catch the corresponding COLLADASW::StreamWriterException
and cancel export then.

NOTE: 51126fab33 might have prevented the most common case
to run into this crash (but there might be other cases still so being safe
here does not hurt)

Pull Request: https://projects.blender.org/blender/blender/pulls/118958
2024-03-05 13:14:45 +01:00
Julian Eisel
4733b11a8c Cleanup: Make asset catalog ID immutable
There's no need for the catalog ID to change ever with the current
catalog system design. If that changes, a new catalog can probably be
created instead. Avoiding modifications also helps avoiding data races.

Also means the currently unused default constructor becomes unavailable.
2024-03-05 12:26:48 +01:00
Matias Mendiola
d5517e8d93 GPv3: Fix: Avoid the creation of new objects for empty material slots when separating by material
This PR fix the creation of new objects for empty material slots

Pull Request: https://projects.blender.org/blender/blender/pulls/119062
2024-03-05 12:17:03 +01:00
Bastien Montagne
15ccec1edb Merge branch 'blender-v4.1-release' 2024-03-05 11:59:59 +01:00
Lukas Tönne
01f794a7d5 GPv3: Fix outline modifier edge cases
Fixes behavior of the outline modifier in some edge case:

- When the outline radius gets larger than the input stroke radius it
  caused a negative offset, inverting the outline in thin areas like the
  tips of the default stroke. The offset should always remain positive
  or zero (collapses onto the input curve).
- When the outline collapses the modifier was skipping points on outside
  corners, where at least one point should be added in all cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/119084
2024-03-05 11:57:36 +01:00
Bastien Montagne
1906ee76ba Fix (studio-reported) IDproperties of liboverrides not being animatable.
Regression from 427eed292d, in IDProperty case the 'ensured' PropertyRNA
pointer is some sort of empty template, and cannot be used for many
things.

Instead of calling `rna_ensure_property` twice for each call to
`RNA_property_animateable`, rather add an optional parameter to static
helper `rna_property_editable_do`, and call it directly from
`RNA_property_animateable`.
2024-03-05 11:53:06 +01:00
Pratik Borhade
690679e3ce GPv3: Length modifier end property not working
When `random_(end/start)_factor` is non-zero, the `end segment` property
won't have any effect on the curves end. This is accidently controlled by `start_fac`.

Resolves #119059

Pull Request: https://projects.blender.org/blender/blender/pulls/119074
2024-03-05 11:51:29 +01:00