Commit Graph

117278 Commits

Author SHA1 Message Date
Philipp Oeser
7fcb565776 Fix #135330: Incorrect pasted flipped armature keyframes
Caused by 6d832ee5b3

The bone names were flipped correctly, however, we were missing the
actual FCurve BezTriple flipping.
This was caused by passing the wrong FCurve into
`do_curve_mirror_flippping` -- this function is checking for existence
of the FCurve in the `KeyframeCopyBuffer`, so we gotta pass
`fcurve_in_copy_buffer` (instead of the new fcu).

Pull Request: https://projects.blender.org/blender/blender/pulls/135381
2025-03-04 09:35:42 +01:00
Philipp Oeser
64c15823f7 Fix #135355: ops.render.opengl() in the console wont return {'FINISHED'}
Caused by 40ac21e5a5 [does not remember/resore the previous ScrArea &
ARegion anymore].
Without this, the operator reporting might get confused by using the
wrong area/region, so added back

NOTE: I tried to just notify `NC_SPACE | ND_SPACE_INFO_REPORT` in
`screen_opengl_render_end` (same as in `wm_operator_finished` >
`wm_operator_register`), but to no avail...

Think this is quite good pratice to leave us with the original area/
region anyways though.

Thx @brecht for improvements (restoring in `screen_opengl_render_init`
already, also taking care of restoring in some early out cases)

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135394
2025-03-04 09:35:27 +01:00
Philipp Oeser
3589c5489a Fix: Cursor snapping does not work for Curves bezier handles
For this to work, we have to take into account handles in TransVert as
well.

Behavior is the same as in legacy curves (meaning that if the control
point itself is selected, the handles are ignores).

Part of #133448 (same thing for grease pencil, which I plan to also make
part of TransVert, but better solve for Curves first, so we can share
code here).

Pull Request: https://projects.blender.org/blender/blender/pulls/134945
2025-03-04 09:35:12 +01:00
Omar Emara
a50144e55c Fix #134914: Backdrop remain after loading new file
The compositor backdrop is still visible even after a new completely
different file is loaded. This is because compositor contexts cache
things like the backdrop, and contexts are stored on interactive
compositor renders, which are not freed until Blender is closed. To fix
this, we cleanup the interactive compositor renders that were created
upon file load.

Pull Request: https://projects.blender.org/blender/blender/pulls/135390
2025-03-04 08:33:17 +01:00
Campbell Barton
72d89eee87 Fix use of the pixelsize for the size of rounded area bounds
Use the scale-factor instead of the pixelsize.

Without this, changing the line-width can double or half the size of
rounded corners.

Ref !135383
2025-03-04 10:10:09 +11:00
Brecht Van Lommel
1689c3ed0b Fix #135354: View render animation from Python no longer shows progress
To match old behavior, keep showing the time cursor in case a blocking
animation render is used from a Python script.
2025-03-03 19:29:54 +01:00
Clément Foucault
446ad3ba13 Fix #135246: Overlay: Loose wire disapears when line antialias is off
This was caused by the normals not being available (default to
`vec3(0)`) which produced `NaN`s down the line after the
unsafe normalize. Changing to `safe_normalize` fixes the issue.
2025-03-03 18:58:14 +01:00
Aleš Jelovčan
7206ad7dc4 Fix #135395: Use new Grease Pencil object type for status bar stats
Status bar stats did not display any data for Grease Pencil, because
the check still used the legacy Grease Pencil type.

Pull Request: https://projects.blender.org/blender/blender/pulls/135397
2025-03-03 17:46:16 +01:00
Clément Foucault
3653fe9524 Fix #135191: Overlay: Edit Mesh: Face selection Z-fighting with edit cage
The offset was not applied inside the vertex shader for
the edit Face selection overlay. Making the offset apply
to this shader fixes the issue.
2025-03-03 16:21:00 +01:00
Sebastian Parborg
6a3642cb1f Fix #135193: Correctly clamp the current frame when starting playback
The old code didn't properly communicate that it changed the current
frame leading to de-syncs in state between the frame shown and the audio
etc.
2025-03-03 15:21:47 +01:00
Sybren A. Stüvel
6f80d722c6 Fix #135163: Grease Pencil layer visibility animation doesn't work in NLA
Add a new function `bke::animdata::prop_is_animated()` that returns
whether an RNA path + array index is animated by anything. This covers
the assigned Action, NLA Action strips, and drivers.

This function is now used in the determination whether the visibility
of a GreasePencil layer is animated.

The easiest way to implement this with the existing F-Curve-visiting
logic was to call `adt_apply_all_fcurves_cb()`. However, that function
did not allow the callback function to signal "stop looping, I found
what was I was looking for", so I extended it to do just that. I don't
expect the extra conditions to significantly slow down the other uses,
as the branch predictor will very likely optimise for the "returning
true" case for those calls that simply visit everything.

Pull Request: https://projects.blender.org/blender/blender/pulls/135317
2025-03-03 14:24:07 +01:00
Falk David
c24b540400 Fix #135313: Grease Pencil: Layer adjustments get applied repeatedly during playback
The issue was that during playback, the evaluated Grease Pencil ID
is not being copied again for re-evaluation. This meant that the
adjustments get re-applied over and over again.

Ideally, we would restore the drawing pointers before modifiying them
again, but this is a bit trickier to implement.

To fix this issue for now, we do the layer adjustments during object
data evaluation. Using the geometry set for modifier evaluation
means that we copy the data and apply the adjustments for every
object.

In the future this can be optimized to only happen once per
Grease Pencil ID (in `BKE_grease_pencil_eval_geometry`).

Pull Request: https://projects.blender.org/blender/blender/pulls/135387
2025-03-03 14:09:06 +01:00
Miguel Pozo
f2c7e60a8c Fix #135357: Overlay-Next: Reference images briefly disappear when entering orthographic view
depth_bias_winmat_ is computed after sync.
2025-03-03 13:46:13 +01:00
Habib Gahbiche
b0fbd9154e Fix: 2D cage gizmo rotation part not being highlighted
The transform gizmo in the sequence editor does not show highlights properly for rotation, when hovering over it or while dragging it.

This patch has no further side effects on operators that use the 2d cage gizmo without rotation such as the crop gizmo and the viewer (transform) gizmo in the compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/135065
2025-03-03 10:46:20 +01:00
Harley Acheson
1a72a0f22c Fix #135295: Always Restore Previous Editor with set_or_cycle
ED_area_newspace correctly changes an area's space when the type and
subtype are set beforehand. But SCREEN_OT_space_type_set_or_cycle, when
changing to a new editor rather than cycling, needs newspace to ignore
the set subtype and use the last-used saved in the space. This
situation cannot be tested for in newspace. Instead have the operator
pass -1 as subtype to signal this intended behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135367
2025-03-02 21:38:02 +01:00
Campbell Barton
2be7586bce Fix the line-width controlling UI element scale & drag threshold
The line-width is used to calculate the `U.pixelsize` which should only
be used to control the size of lines & points.

Update doc-strings to mention the intended use, remove unused defines.
2025-03-02 15:46:22 +11:00
Pratik Borhade
725617c7a0 Fix #135185: Delete pose asset crash
This is due to accessing member of nullptr Asset. After deleting the
action id from asset library, `CTX_wm_asset` won't return value because
force reset for files was tagged (`FL_FORCE_RESET_MAIN_FILES`).
Instead of updating library from active asset, use library reference to
clear then read/draw the updated asset library

Pull Request: https://projects.blender.org/blender/blender/pulls/135219
2025-03-01 14:56:24 +01:00
John Kiril Swenson
f874d46589 Fix: UI: Transform Feedback for Invalid Trackball
Patch #132957 added helpful UI feedback when attempting to rotate or
scale an object whose transforms are set to "only affect locations."
But it neglected to check for invalid trackpad rotations that are
affected the same way. This patch renames the original `HLP_ERROR` to
`HLP_ERROR_DASH` to distinguish it from a `HLP_ERROR` transform cursor
with no dashed line present, which matches trackball's normal state.

Pull Request: https://projects.blender.org/blender/blender/pulls/134653
2025-02-28 21:14:36 +01:00
Harley Acheson
ead7a881a5 Fix: Constrain Docking Hint to Window Bounds
While joining and docking areas there is hint shown near the mouse that
describes the potential operation. But it is cut off if your mouse is
at the extreme right or bottom edge of the window. This PR just clamps
the position so it is always visible.

Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Pull Request: https://projects.blender.org/blender/blender/pulls/135211
2025-02-28 19:04:22 +01:00
Gracjan Jeżewski
901353ce4c Fix: Hydra camera missing depth of field parameters
Add the missing F-Stop and Focus Distance.

Pull Request: https://projects.blender.org/blender/blender/pulls/134896
2025-02-28 17:37:35 +01:00
Brecht Van Lommel
9e44514b46 Fix: Hydra incorrect assmes camera object is always a camera 2025-02-28 17:37:35 +01:00
Philipp Oeser
65288e4130 Attempt to fix build error
introduced in 9855c11d2c
2025-02-28 17:30:11 +01:00
Philipp Oeser
412cefe9bb Fix: Broken "File -> External Data -> Pack Linked Libraries"
The operator refused to pack libraries with absolute paths (wasnt the
case in its original implementation 16411da41e, but was added in
129fb516f4 -- for the reason of preventing "bad things happen on
unpacking" without an explanation of what these exactly are). It did so
by cancelling as soon as **one** library with ab absolute path was
found.

Now with the introduction of essential assets, we have those absolute
path linkages more or less "by default"  as soon as e.g. a brush is
used, so the operator is more or less unusable now. NOTE: these absolute
essential asset library paths seem to be converted to relative on save?
Upon reload, these are then gone... (might be another hint for an
alternative fix, see below)

By "bad things happen on unpacking" I would assume the scenario of
folders being created in unwanted locations (e.g. when moving from one
OS to another), but the same thing is also true for packing **files**
instead of libraries (there, absolute paths are allowed, and unpacking
in original locations can equally fail or create folder structures that
are "unexpected"). NOTE: for files though we have the choice of
unpacking to a relative folder (which wouldnt really be possible since
libraries can be nested and we would have to correct paths all over the
place). NOTE: the chance of creating "unwanted" folder structures with
relative paths might be slimmer, but if you have a lot of "upwards"
parent folders, relative can easily "break" as well.

Possible ways to resolve this:

### [1] skip libraries identified as essentials assets (still cancel on all other absolute paths)
Can check a library path to be contained in `EssentialsAssetLibrary`
`essentials_directory_path`. This would be the safest imo since it is a no-behavior change.

### [2] lift the limitation of absolute paths alltogether
Like mentioned above, things could break with "relative" almost as
easily as with "absolute", there might even be scenarios where
"absolute" is wanted. It is a more behavior-changing fix that we might
explore more after 4.4 is out.

### [3] skip absolute libraries (but continue with non-absolute libraries)
This does change behavior as well (it does not cancel as soon as **one**
library with ab absolute path was found anymore, but the worst case
scenario is that you end up with an "incomplete" file if you really
mixed absolute and realtive lib linking).

This PR implements [1] for now, [2] or [3] can follow for 4.5.

Fixes #134665

Pull Request: https://projects.blender.org/blender/blender/pulls/134839
2025-02-28 17:14:14 +01:00
Philipp Oeser
9855c11d2c Fix #135217: ColorManage Settings RNA paths incomplete/wrong
`ColorManagedDisplaySettings`, `ColorManagedViewSettings`,
`ColorManagedInputColorspaceSettings` were affected since these are used
from multiple places (Scene, File output nodes, ..).

Similar to how we are getting the path for `ImageFormatSettings` (which
pretty much has the distinction logic already), we can do so for the
ColorManage Settings as well (piggbacking on the already correct path to
the `ImageFormatSettings`.

With this, we can also remove these "known failures" from the test
introduced in 4032b853c3.

Pull Request: https://projects.blender.org/blender/blender/pulls/135238
2025-02-28 17:13:43 +01:00
Sybren A. Stüvel
559d7575a6 Cleanup: remove mention of once-planned 'Animation' data-block
Remove the mention of the 'Animation' data-block in a comment, as that
never was actually implemented.

No functional changes.
2025-02-28 17:12:39 +01:00
Damien Picard
910895dcf3 I18n: Disambiguate "To"
Depending on context, "To" can have different translations. Add
"Modifier" context to one of them.

Reported by Alexandr Fatih.

Pull Request: https://projects.blender.org/blender/blender/pulls/135173
2025-02-28 15:46:33 +01:00
Damien Picard
1fc5f9d408 I18n: Disambiguate "Home"
"Home" in the context of the navigation key, as opposed to the home
directory in the file browser.

Reported by Satoshi Yamasaki.
2025-02-28 15:46:33 +01:00
Damien Picard
e76d997b44 I18n: Disambiguate "Clip"
Volumes' "Sequence Mode" recently got the "Sequence" context in
2b3f0d0110. The intention was to disambiguate the "Extend" enum item,
but this caused another item, "Clip" to also get this context. That
one already existed and referred to a sequencer clip.

Use the more specific "Volume" context instead.

Reported by Gabriel Gazzán.
2025-02-28 15:46:33 +01:00
Damien Picard
7f2fef78c3 I18n: Translate "Action" name when created with action.new operator
Actions get the default name "Action" when created through
action.new(). This is user data that can be translated.

Reported by Gabriel Gazzán.
2025-02-28 15:46:33 +01:00
Andrej730
25922344e5 RNA: WM API: fileselect_add - document filter_glob operator property usage
Pull Request: https://projects.blender.org/blender/blender/pulls/135288
2025-02-28 15:44:45 +01:00
Sergey Sharybin
c4e9cc18c5 OpenEXR: Change DWA compression mapping
OpenEXR DWA compression in Blender is derived from a more user-friendly
quality slider which has an intuitive range 0 .. 100.

Initially the mapping was done so that the visually lossless JPEG
quality of 97 was mapped to the default DWA compression 45. A point was
made that we should make it so default quality is mapped to the default
compression, following the intent of DWA for rendering and compositing
the main target.

This change adjusts the mapping so that quality of 90 is mapped to DWA
compression 45.

This change relies on the library update to fully utilize the DWA
compression #135037.

This change leads to the difference in the way proxies of EXR images
are generated:

```
                    DWA compression        Size (bytes)
Before the change   750                    175,208,243
After the change    225                     77,838,827
```

It is worth noting that the DWA compression seemed to be ignored in
the 4.4 branch before this change (this is what the original report is
about, a bit indirectly).

This is measured on the Fabrik Eingang footage converted to EXR. The
absolute value is ptobably not that important, it just shows the
reduction in size. This also leads to a lower quality of the proxy
image, but it is not worse than an actual JPEG proxy: the quality is
set to rather low 50 for the strip proxies.

Ref #134802

Pull Request: https://projects.blender.org/blender/blender/pulls/135103
2025-02-28 10:33:36 +01:00
Pratik Borhade
b69b201e20 Cleanup: Rename LayerTreeNode variable
Function is used by both layers and groups after e51fff61c5.
Keep the name more general.

Pull Request: https://projects.blender.org/blender/blender/pulls/135286
2025-02-28 09:37:00 +01:00
Lukas Tönne
4437782e00 Fix #135126: Mantaflow crashes when resizing a liquid domain
The `with_smoke` case is handled correctly and checks for reallocation,
but the liquid case was ignored for unknown reasons.

The `with_smoke` distinction was added years ago (c7596cd820)
but for some reason the `with_liquid` case was ignored for reallocation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135247
2025-02-28 09:03:29 +01:00
Campbell Barton
bba5b88b29 Fix #135245: Crash passing a dict for OperatorProperties to RNA funcs
The code-path for coercing a dictionary to operator/gizmo properties
was being used RNA functions where it's not supported.

Raise a type exception instead of crashing.
2025-02-28 16:59:53 +11:00
Padraig-O-Cinneide
f928987216 Fix #130890: Toggle the offset option after snap fails
Regression in [0] caused changing snap options to fail on redo.

Resolve by ensuring the depsgraph is evaluated.

Ref: !135279

[0]: 1c0f374ec3
2025-02-28 13:17:28 +11:00
Jesse Yurkovich
1833d79231 Fix: USD: Don't attempt to export the special custom_normal attribute
Suppress exporting this attribute as there's no conversion to USD that
supports its data type (2d, 16-bit int) and because mesh normals (from
the `corner_normals` API) are already exported. This causes a rather
annoying UI Warning notification that the attribute isn't convertible
during export.

Pull Request: https://projects.blender.org/blender/blender/pulls/135271
2025-02-28 01:47:37 +01:00
Campbell Barton
322abbd311 Fix file-selector operators performing an undo push on failure
Operators are only expected to perform an undo push when finished.
2025-02-28 11:45:11 +11:00
Harley Acheson
f9df73b875 Fix #134621: Only Update Face Orientation Alpha if Using Old Colors
With 4c67c78452 we changed the default theme color for front faces,
used by the Face Orientation overlay, to have zero alpha so that it
could be used in more cases. But versioning updated this for all old
files, which can overwrite users who made deliberate changes to it.
This PR alters the versioning code to only change the color if it
currently exactly matches the old default.

Pull Request: https://projects.blender.org/blender/blender/pulls/135262
2025-02-27 20:25:47 +01:00
Jacques Lucke
66ba309f6e Fix #135031: data-race in Remove Attribute node 2025-02-27 17:16:17 +01:00
Pratik Borhade
9d12ac29ea Fix: Grease Pencil: Add channel_color RNA prop to layer groups
Property wasn't added to earlier because it was part of tree-node.
But it was moved to tree-node just in main, see: 3ef2ee7c53
Failing right now in 4.4.

Pull Request: https://projects.blender.org/blender/blender/pulls/135225
2025-02-27 13:32:35 +01:00
Jacques Lucke
09fd1d48e2 Fix #135164: crash when deleting nodes from node tree after appending
The issue was that changing session ids for a data-block were not handled gracefully enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/135230
2025-02-27 12:47:01 +01:00
Jacques Lucke
9df6e9214e Fix #135152: crash because of missing gizmo update after closed editor
The visibility of Geometry Nodes gizmos sometimes depends on the
selected nodes in a node editor. Therefore, when the editor is closed,
the set of available gizmos has to be refreshed.
2025-02-27 12:44:57 +01:00
Lukas Tönne
b34c116398 Fix: Geometry Nodes menu socket can leak memory
The enum items propagation mechanism for Menu sockets makes a local copy of item
pointers to propagate between node group inputs and interface definitions.
In case these items are not used (e.g. because they are already shared with the
socket) the local copy must still be released to avoid leaking the memory.

This only happens with more than 4 enum items, because of the internal default
buffer for `Vector`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135226
2025-02-27 12:31:31 +01:00
Pratik Borhade
255dec2c51 Fix #135136: UI: Shader node template panels can't collapsed on drag
Multiple panels of material in properties tab were not
collapsed/expanded when click-dragged over them. This is because wrong
button type for interface-panel. To support multi-drag, button has to be
of type toggle, see: `ui_do_but_ANY_drag_toggle()->
ui_drag_toggle_but_is_supported`

Pull Request: https://projects.blender.org/blender/blender/pulls/135154
2025-02-27 11:02:35 +01:00
Jason C. Wenger
80a38bb1e4 Fix #120770: poor un-subdivide performance with disconnected geometry
- Refactor tagging logic into a function to remove duplicate code

  The two phases of tagging were identical logic just with the variables
  and tag values swapped. This change ensures the two loops use matching
  behavior.

- Adjust iteration to prevent restarting from the beginning of the mesh
  after each island.

- Simplify and speed iteration tests.

  testing to ensure v->e is non-null is redundant - verts with no edges
  would never have passed `bm_vert_dissolve_fan_test` in the first
  place, so can't be tagged as `VERT_INDEX_INIT`.
  Re-testing `bm_vert_dissolve_fan_test(v)` is redundant - it was
  checked above, and during tagging, the topology does not change.
  Topology only changes later, after tagging is complete.
  Therefore it's guaranteed to return the same result as the first time.

- Simplify loop logic, rename vars for clarity

  offset and nth were constants, and depth was what causes alternation.
  However none of that math is necessary - it can simply be done with
  call order.

  'seek_a' and 'seek_b' were renamed to what they actually are - lists
  of verts that are tagged for collapse and ignore, respectively.

  Further, by checking if any verts were tagged during the first
  iteration pass, the second iteration pass can be avoided entirely if
  it will perform no work.

Ref: !135212
2025-02-27 15:53:12 +11:00
Campbell Barton
51113085de Cleanup: remove disabled BMWalker logic for un-subdivide
This isn't going to be enabled and made the in-lined tagging more
difficult to follow.
2025-02-27 15:53:12 +11:00
Harley Acheson
89e78e7065 Fix: MacOS Status Status Bar Swap Areas Spacing
For MacOS, when hovering your mouse over the area corner "action zones"
the Status Bar shows a "Swap Areas" item that has unnecessary spacing
between the Control modifier key icon and left mouse button icon. This
is because I forget different icons were shown for Mac. This PR just
uses the proper calculated spacing that knows better.

Pull Request: https://projects.blender.org/blender/blender/pulls/135208
2025-02-27 05:13:09 +01:00
Sean Kim
a106480b92 Fix #135130: Mask from Cavity does not work via operator
Introduced with 6b0fa709fa.

Pull Request: https://projects.blender.org/blender/blender/pulls/135139
2025-02-27 02:16:29 +01:00
Harley Acheson
f930b7a731 Fix #135097: Wrap Text Lines Without Control Chars in Glyph Cache
Our text wrapping code is written in a way that requires the Line Feed
character to be in our glyph cache. This is problematic as none of the
control characters will ever be there if not using fallback. With
fallback these glyphs could be a zero-width character from a symbol
font, or something with width if using a last resort font. So we'd have
to ignore the advance in the latter case. This came to a head recently
because we are turning off fallback in some circumstances. 12b1f8bd7a
removed the rendering of control characters so they are never in the
cache. That change requires this one, which does wrapping based on the
string's codepoint, not that of its glyph.

Pull Request: https://projects.blender.org/blender/blender/pulls/135196
2025-02-26 21:25:13 +01:00
Philipp Oeser
a636b101d7 Fix #121609: Shrinkwrap invert vertex group (no group specified) wrong
Same was true for SimpleDeform.

Invert vertex group influence should only have an effect if there is a
group specified.
Shrinkwrap always uses a weight (gets weights via
`BKE_defvert_array_find_weight_safe` -- which gets full weight for no
group specified, rightfully so), if this gets inverted, we get no
influence at all.

Now move the inverting of the weights to `BKE_defvert_array_find_weight_safe`,
adjust the other callers accordingly (Bevel also does not need to check for a valid
vertexgroup beforehand).

Pull Request: https://projects.blender.org/blender/blender/pulls/121625
2025-02-26 15:56:08 +01:00