Commit Graph

153 Commits

Author SHA1 Message Date
Harley Acheson
1ad39b95d9 Merge branch 'blender-v4.4-release' 2025-03-02 12:39:19 -08: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
98aee659cf Merge branch 'blender-v4.4-release' 2025-03-02 15:50:15 +11: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
Harley Acheson
21e14163c6 Merge branch 'blender-v4.4-release' 2025-02-28 10:05:31 -08: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
Campbell Barton
85af07f438 Cleanup: spelling in comments 2025-02-23 21:02:54 +11:00
Sean Kim
5cce8cc073 Merge branch 'blender-v4.4-release' 2025-02-19 12:59:30 -08:00
Julian Eisel
05c6446c38 Fix #128966: Update Dopesheet playhead in separate window
The playhead is redrawn as an overlay, so instead of a full region
redraw using `ARegionType.draw()`, at least an overlay only redraw using
`ARegion.draw_overlay()` needs to be triggered.

Any redrawing within a window is skipped if neither the screen, nor any
of its areas or regions are tagged for redraw. So since there are no
other areas or regions to be fully redrawn in this window, no redrawing
will happen. The screen needs to be tagged for redraw, which will skip
most drawing in this case, and just draw the overlays as wanted.

Pull Request: https://projects.blender.org/blender/blender/pulls/134579
2025-02-19 21:53:15 +01:00
Brecht Van Lommel
c7a33a62a2 Cleanup: Directly include DNA_userdef_types.h and BLI_listbase.h
Instead of relying on them being included indirectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/134406
2025-02-12 23:01:08 +01:00
Bastien Montagne
87a4c0d3a8 Refactor: Make Library.runtime an allocated pointer.
Move `Library.runtime` to be a pointer, move the related
`LibraryRuntime` struct to `BKE_library.hh`. Similar to e.g.
Mesh.runtime, that pointer is expected to always be valid, and is
allocated at readtime or when creating a new Library ID.

Related smaller changes:
* Write code now uses standard ID writing codepath for Library IDs too.
  * Runtime pointer is reset to nullptr before writing.
* Looking up a library by its absolute path is now handled through a
  dedicated utils, `search_filepath_abs`, instead of using
  `BLI_findstring`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134188
2025-02-07 17:47:16 +01:00
Brecht Van Lommel
3725fad82f Cleanup: Various clang-tidy warnings in editors
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Campbell Barton
eb1340517f Fix use after free toggling quad-view 2025-01-29 12:15:53 +11:00
Bastien Montagne
9c237af041 Refactor: RNA: add discrete suffix to RNA_pointer_create.
This is a noisy preliminary step to the 'RNA ancestors' change. The
rename helps clearly tell what each `pointer_create` function does.

Pull Request: https://projects.blender.org/blender/blender/pulls/133475
2025-01-24 16:45:32 +01:00
Julian Eisel
efadb938f0 Fix #132422: Crash when opening UV editor from shader editor
Fixes: #132422, #133288.

`ED_area_init()` is called when the editor in an area changes, this also changes
the available regions. That means, region polling needs to be executed. The
crash was happening because that wasn't the case, and the asset shelf region was
initialized before the polling was executed, which allocates region data in the
`on_poll_success()` callback.

Also had to pass context to `ED_area_init()`, which is an annoyance, but should
be fine. Similar functions like `ED_area_exit()` take it too.

Pull Request: https://projects.blender.org/blender/blender/pulls/133388
2025-01-22 19:24:38 +01:00
Damien Picard
4b729022f6 I18n: Disambiguate "Precision"
"Precision" mode for a modal operator, not the measurement.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Sebastian Parborg
da88fc87fd Fix: Try to mitigate frame sync race condition when stopping playback
We would update the scene frame before we actually stopped the
callback timers for automatic frame sync.
This could lead to a race condition where the set frame would be
overwritten before we stopped the callback timer.

Pull Request: https://projects.blender.org/blender/blender/pulls/132022
2024-12-17 17:49:07 +01:00
Hans Goudey
50585b8131 Fix #131749: Missing text for operator buttons
Missing change of nullptr to std::nullopt after a recent cleanup.
2024-12-11 10:07:59 -05:00
Campbell Barton
083b690fb5 Cleanup: spelling in comments 2024-12-09 09:14:44 +11:00
Campbell Barton
2a0a6d38df Cleanup: use term "current-frame" instead of "playhead" 2024-12-09 09:14:42 +11:00
Sebastian Parborg
6d1bc2feb1 Fix: remove uneeded A/V sync frame interpolation
This was trying to smooth out the playback but could instead lead to
worse frame pacing. It was also masking some bugs in the PulseAudio
backend that has been fixed.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
32a26b8e19 Fix: Properly reset the audio devices when changing settings
Previously changing audio devices or settings while Blender was playing
back could lead to crashes or the playback state between Blender and
Audaspace de-syncing.
2024-12-03 16:25:59 +01:00
Julian Eisel
d9eb1d7155 Fix #130758: UI: Spreadsheet: Animation update does not affect tree view
Redraw was not triggered for the region containing the tree-views. Ensure it's
handled by the editor redrawing logic for animation playback.

Pull Request: https://projects.blender.org/blender/blender/pulls/131303
2024-12-03 14:15:02 +01:00
Harley Acheson
798a48f6ef UI: Use Separate Mouse Cursors for Join Operations
To better indicate the point during dragging where join changes to
docking, use specific "join" cursors like we used to use.

Pull Request: https://projects.blender.org/blender/blender/pulls/131167
2024-12-02 20:30:51 +01:00
Hans Goudey
953c4f1599 Cleanup: Remove references to legacy Grease Pencil object
These are converted on startup to the new type. There are still
some references left, mostly where it looked like there still needs
to be changes to properly deal with the new object type.
2024-11-27 09:17:16 -05:00
Sebastian Parborg
43560ad9f7 Refactor: Make areas_do_frame_follow to be easier to parse
Also make it callable outside of screen_ops.cc.
2024-11-26 12:18:06 +01:00
Harley Acheson
1235a914cd Fix #130732: Join/Dock Tag Redraw on Secondary Participants
Joining and Docking tag the source and target areas for redrawing. But
there are times when areas are split and recombined as part of the
processes. In some cases areas that are not either source or target
must also be tagged for redraw. Especially for Outliner and 3DView as
they try to avoid full redraws with RGN_DRAW_NO_REBUILD, but needed
here.

Pull Request: https://projects.blender.org/blender/blender/pulls/130801
2024-11-25 20:14:18 +01:00
Harley Acheson
ed6e6200d4 UI: Slightly Softer 50% Split Snap
Based on feedback from Alaska, this slightly narrows (softens) the
snapping to 50% when splitting an area without modifiers held.

Pull Request: https://projects.blender.org/blender/blender/pulls/130800
2024-11-23 19:28:08 +01:00
Harley Acheson
82667d5626 UI: Misc Changes to Area Splitting Operator
Changes to area splitting when dragging from a corner action zone.
Increases the distance you must drag into the area before anything
starts. Increases minimum size that you can create to about 2X the
header height. Slight snap to 50% when no modifier keys are held.

Pull Request: https://projects.blender.org/blender/blender/pulls/130706
2024-11-22 19:23:53 +01:00
Harley Acheson
62541bffc2 UI: Area Move Snap to Min and Max
While resizing areas by dragging on their edges, add a slight snapping
to the minimum and maximums without any modifier keys pressed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130702
2024-11-22 18:34:51 +01:00
Hans Goudey
129a2aa0f4 Refactor: Move region runtime data out of DNA
Pull Request: https://projects.blender.org/blender/blender/pulls/130303
2024-11-21 19:34:53 +01:00
Harley Acheson
f339ab4325 UI: Minimum Docking Target Size
When dragging an area to a new location, current code limits the size
of the target area to AREAMINX and HEADERY, which is the minimum sizes
that an area can occupy. This is too small and results in frustration
for some users. When moving an existing area you are unlikely to want
it to be an unusable size. This PR makes the minimum target size 3X
wider. If an area is not large enough to be bisected into two such
areas then it won't be offered as a docking target in that orientation.

Pull Request: https://projects.blender.org/blender/blender/pulls/130546
2024-11-20 19:02:42 +01:00
Jacques Lucke
e62aa986b2 Format: use fmt::format correctly with runtime format strings
The `fmt::format` can process the format string at compile time. Currently, we
don't seem to be using that as we don't use `FMT_STRING`. Starting with C++20,
that will be the default though, and one has to explicitly opt out in places
where the string is not known at compile time using `fmt::runtime(...)`.
Currently, our code does not compile as C++20 because of that. Unfortunately, we
have many places with runtime format strings, because of i18n.

Pull Request: https://projects.blender.org/blender/blender/pulls/130392
2024-11-20 10:41:29 +01:00
Harley Acheson
d1171635ff Fix #129414: On linux, Join Use Active Window when Overlapping
On Linux we can't always determine topmost window under cursor,
therefore check for overlapping windows and, if so, only use the
active window.  This allows dragging between windows as long as
they don't overlap

Pull Request: https://projects.blender.org/blender/blender/pulls/130242
2024-11-14 22:31:36 +01:00
Pratik Borhade
68ddaa2f0a Fix #128930: Cancel resize area with Right mouse
Add RMB switch case in modal fn() to cancel area resize operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/129100
2024-11-11 12:48:13 +01:00
Campbell Barton
29e184596e Fix error accessing invalid stack memory joining areas from a shortcut
Avoid relying on an area lookup with off-screen coordinates,
check if the properties were set instead.
2024-10-31 18:45:44 +11:00
Harley Acheson
cf2d3d0867 Fix: Docking Called from Shortcut Without Status Bar
When starting a docking operation from an assigned shortcut, the source
area will be incorrect if the Status Bar is not currently being shown.
This PR just adds defaults that are never valid window coordinates.

Pull Request: https://projects.blender.org/blender/blender/pulls/129187
2024-10-18 04:28:33 +02:00
Harley Acheson
bdee3dfaa2 Fix #128906: Remove Docking Draw Callbacks After Deactivate
If we lose focus while splitting or docking we need to make sure that
the overlay drawing callbacks are stopped.

Pull Request: https://projects.blender.org/blender/blender/pulls/128957
2024-10-13 20:24:35 +02:00
Harley Acheson
dc6e021472 Fix #128616: Allow Docking to work from Menu shortcut
Allow Docking to work correctly if using a shortcut to the area header
context menu item. There is no longer a need to set the source or
target area locations.

Pull Request: https://projects.blender.org/blender/blender/pulls/128730
2024-10-08 21:37:54 +02:00
Campbell Barton
0f3fdd25bc Cleanup: various non-functional changes for C++
- Remove redundant parenthesis
- Use strings macros
- NULL -> nullptr
2024-10-02 15:47:05 +10:00
Harley Acheson
bfe693c8c2 UI: Changes to Docking Mouse Cursors
This makes one change and another correction to the mouse cursors used
during Docking. The change is to use WM_CURSOR_EDIT for Mac while just
hovering over the corner action zones. This means that Mac users will
transition from this to WM_CURSOR_HAND_CLOSED, instead using two hand
cursors.  The correction is to use the "split" cursors while splitting
areas. That it doesn't do that now is a mistake made during #127810.

Pull Request: https://projects.blender.org/blender/blender/pulls/128396
2024-10-01 21:04:20 +02:00
Harley Acheson
b2eb8cc0df UI: Edge Highlighting While Resizing Editors
Highlighting of the active edges of editors while resizing.

Pull Request: https://projects.blender.org/blender/blender/pulls/120998
2024-09-27 00:56:52 +02:00
Campbell Barton
473bd60164 Cleanup: clarify arguments using const or r_ prefixed return args 2024-09-26 15:03:24 +10:00
Harley Acheson
8450aa275f UI: Area Docking as Regular Feature, Not Experimental
This PR makes "Interactive Editor Docking" a regular feature, available
by default, and removes the option from Experimental Preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/127810
2024-09-24 23:23:48 +02:00
Jonas Holzman
aa5385f648 Fix: Interactive Docking modal operator re-run glitch
Docking can close windows during its operation. If the current window
does not match before and after an operator has run our event handling
code can assume that a new blend file has been loaded and will rerun
the operator. This PR avoid this problem by just not starting if the
event initiating it is of type WINDEACTIVATE. There might be a later
fix that addresses the underlying issue, but this is simple, small, and
harmless.

Pull Request: https://projects.blender.org/blender/blender/pulls/126379
2024-09-19 00:47:37 +02:00
Campbell Barton
2593fffa4d Fix local view failing to restore axis-roll
Entering local-view, then setting an axis via the num-pad and exiting
local view would restore the original axis but not the axis-roll.

Store the axis-roll for local-view & smooth-view operations.
2024-09-10 17:31:06 +10:00
Harley Acheson
565f9f6b8a UI: Do Not Allow Docking into Temp Windows
Do not allow dragging screen areas into Temp windows, like Properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/127379
2024-09-10 02:43:07 +02:00
Harley Acheson
72a0be0944 UI: Mac Cursors While Docking
With docking enabled, for Mac hovering over the corner actions zones
shows an open hand cursor, while dragging it uses the closed hand
cursor. For other platforms this just uses the "move" cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/127291
2024-09-10 00:55:52 +02:00
Harley Acheson
382244c258 UI: Docking Drag Mouse Cursor
This shows the docking feedback very similar to how tooltips are shown
elsewhere. It describes the operation and also includes the icon and
name of the moving/changing area.

Pull Request: https://projects.blender.org/blender/blender/pulls/126898
2024-09-04 22:43:57 +02:00
Harley Acheson
04652334f3 UI: Fix Docking Issue With No Overlay
Docking uses window overlays during feedback and these have to be
stopped and changed if you move the target from window to window.
The logic of changing the window that gets the overlay will sometimes
fail when the target window is null and old window was null - it
gets stopped (because they are equal) but not started again. This PR
just adds a check for null window.

Pull Request: https://projects.blender.org/blender/blender/pulls/126906
2024-08-29 04:36:49 +02:00