This commit brings multi-monitor window positioning support to the macOS
GHOST backend. This fixes a plethora of issues with macOS window
creation and positioning, such as:
* Windows not being properly restored when loading a file with Load UI
* Users default startup windows not being properly restored on multiple
screens
* Temporary windows (Settings, Render, Playblast, etc..) wrongly
appearing in unexpected places / other screens
* Duplicating an area into a new window (AKA popping out an editor) not
working on non-primary screens.
* etc..
Internally, this makes all macOS windows coordinates be relative to the
user primary monitor, instead of being local to the currently focused
one. I have tested this to properly work using all sorts of multiple
screen arrangements, and can also confirm that restoring windows from
screens that do not exist anymore / are now out of bounds (due to being
unplugged or re-arranged) also works properly, in which case they get
snapped back to the closest available screen similarly to other backends.
This fixes issue #126410 and implements behavior described in TODO task #69819.
Pull Request: https://projects.blender.org/blender/blender/pulls/141159
Almost all uiLayout methods that creates sub-layouts returns a uiLayout
reference, API users must use the returned sub-layout to add items,
this prevents a accidental copy that could break Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/141051
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141349
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141349
The `CurvesGeometry::resize` function would not work properly when
passing a new size of zero.
1) The `CustomData_realloc` would allocate an array with zero size.
2) A new size of 1 is passed to `implicit_sharing::resize_trivial_array`
for the curve offsets when it should pass 0.
3) A value is written out-of-bounds to `curve_offsets`
This fixes the issues in the following ways:
1) `CustomData_realloc` now doesn't allocate any data when the new
size is 0 and sets the `layer->data` to `nullptr`.
2) When the new number of curves is 0, resize the `curve_offsets` to 0
not to 1. This also ensures that the data pointer is `nullptr`.
3) Make sure to only write the first and last curve offset when the
number of curves is greater than 0.
Pull Request: https://projects.blender.org/blender/blender/pulls/141333
The returned string was one byte too large, because it contained the null
terminator for string `IDProperty`. Noticed this when retrieving strings
parameters in an operator which are stored as id properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/141321
This replaces the Move/Link to Collection operator popup with a menu,
allowing this to be able to search collection to move and to expand
this menu from other menus.
This removes the expected memory leak of using the popup.
Move to Collection operator now uses `session_uid` to identify
target collection, this now allows to target a collection from another
scene, however, is not exposed throw UI)
Resolves#133772
Pull Request: https://projects.blender.org/blender/blender/pulls/140883
While the previous logic tended to work as it would use the serial
for the last active table event - follow the spec and and always pass
in the serial for the proximity_in event.
In the viewport, semi-transparent strokes could appear more yellowish.
This was because the `reveal_tx` uses the `GPU_R11F_G11F_B10F` format
(loosing precision in the blue channel).
Now using `GPU_RGB10_A2` for `reveal_tx` to fix the issue.
We don't need to change the format for the `color_tx`.
Pull Request: https://projects.blender.org/blender/blender/pulls/141335
The alpha channel wasn't properly handled when using "multiply" layer
blending.
The formula in `blend_mode_output` for `MODE_MULTIPLY` was first
multiplying the `color.a` by `opacity`, storing the result back into
`color` but then multiplying by `color.a` again.
Instead, multiply `color.a` and `color` by the `opacity` separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/141337
While drag toggle decorators, the button where drag started
still is active, so it can conflict with the button to add/remove
keyframe while dragging upward.
Use `UI_BUT_ACTIVE_OVERRIDE` flag since it has precedence in
`ui_context_button_active`.
Last tested to work in 2.83.
Ref !141317
We do not do any audio time stretching when doing time remapping.
As we also use the audio to keep track of time passed, we should always
pass the actual timestamp we are starting playback from.
The issue was that the old logic would try to undo time remapping on cfra.
However cfra is already correct and is not remapped. I'm guessing that
this changed at some point and we forgot to fix it up in the sound code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141288
- Use the typed enum for wayland cursor ID's.
- Return an std::optional<...> for cursor access,
with std::nullopt when the cursor doesn't have an equivalent value
from ghost.
- Add "stub" calls to `update_cursor_scale` where removed as part of
!140366 but will be needed when custom cursors support updating
based on output scale.
`node_bilateralblur.blend` covered a specific case where the
determinator was a single value. This was renamed to
`node_bilateralblur_det_single_value.blend` and added a single value
input test for the image, and a standard bilateral blur test for cpu/gpu
Coverage:
- Function: 66.67% -> 100%
- Line: 39.10% -> 100%
- Region: 45.71% -> 100%
- Branch: 22.22% -> 88.89%
Pull Request: https://projects.blender.org/blender/blender/pulls/141315
Detection of whether an object is in Edit mode can rely on checking its
obdata ID status (for meshes e.g.), which will falsly make remapping
code think it is remapping the obdata of an edited object.
Somewhat work around the issue by forcing such remapping for the time
being. On the long run, check should be updated to only rely on the
Object's status.
Follow up to #140668 that fixes the same issue when using multiple
windows & scenes. This is needed as the active tool can apply to
multiple scenes.
Ref !141260
The Make Links operator does not work with Extend Sockets and generally
do not respect the node's link function. This patch makes it such that
the operator will fallback to an Extend socket if all else fails,
connecting to the first available socket that is not already linked to
the target node.
The main motivation for supporting this is to allow rapid connections to
the File Output node from big nodes like the Render Layers and Image
nodes, which is typically a slow process for users.
Pull Request: https://projects.blender.org/blender/blender/pulls/141287
This was used by the legacy Grease Pencil system while using the draw
tool to quickly render a stroke buffer.
Nowadays, we don't use this buffer anymore and just rerender
the Grease Pencil object.
Changing the computation to be split in 2 steps (one for each matrix)
fixes the issue.
However, it seems this function is used in a lot of places which
I am not sure if this has the potential to slow down some other
operations. So I will simply add a precise version of the function
for now.
Pull Request: https://projects.blender.org/blender/blender/pulls/141327
This replaces uiItemMContents, uiItemDecoratorR* and
uiItemProgressIndicator API with uiLayout methods following
uiLayout refactors and the Python API.
`eButProgressType` is changed to a typed enum class
`blender::ui::ButProgressType`
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141189
If render settings resolution scale had lowered resolution, cached
images from render image/animation session could "stay around"
and be incorrectly used in the VSE preview area. Two cases I found are
fixed here:
- Intra-frame cache was not flushed upon actual final resolution
change,
- "Source images" for effect/scene strips were not removed when
requested resolution no longer matches their rendered resolution.
Pull Request: https://projects.blender.org/blender/blender/pulls/141297
This is extracted from #140967.
Previously, it was possible to sync a bundle/closure node based on what's linked.
However, it was not possible to detect if the syncing was possible or necessary
in the first place. Knowing this helps building UI features that inform the user
about outdated nodes.
The crash happens when hitting tab while using attribute search in the Geometry
Nodes modifier. This triggers some auto-completion code (which doesn't work here
currently, but that's potentially a separate problem). However, the
auto-completion code did not handle the case when the string that's
auto-completed does not have a maximum length, i.e. it is dynamic.
This patch adds some handling for the case when the auto-completed string
storage has a dynamic size.
Pull Request: https://projects.blender.org/blender/blender/pulls/141200
Adds NURBS weight, radius and tilt to Transform panel.
To avoid code duplication code is a bit refactored and `struct TransformMedian_GreasePencil` is removed.
Also GP case has a race condition in existing version. It is fixed using `std::atomic`.
Pull Request: https://projects.blender.org/blender/blender/pulls/141079
Introduced in d73b8dd4f3
Unfortunately, the `Sculpt` struct has an implicitly generated copy
constructor which accesses the deprecated field in `sculpt_ops.cc`,
instead of allowing access to potentially deprecated fields at runtime,
this commit silences the warning by appending `_deprecated` to the field
and removing `DNA_DEPRECATED` from it.
Additionally, to preserve forward compatibility, the field is added to
`dna_rename_defs.h`
Pull Request: https://projects.blender.org/blender/blender/pulls/141298
Change `eCustomDataType` to `bke::AttrType` for uses of the attribute
API (the `AttributeAccessor` one anyway). I didn't touch any values that
might be saved in files; those should be handled on a case by case basis.
Part of #122398
Pull Request: https://projects.blender.org/blender/blender/pulls/141301