Commit Graph

6015 Commits

Author SHA1 Message Date
Campbell Barton
2316b73a1d Merge branch 'blender-v4.0-release' 2023-10-12 17:23:57 +11:00
Campbell Barton
4ea76b8530 Fix #113273: Status bar not refreshed when canceling the operation
Resolve regression in [0].

[0]: 42f8b49581
2023-10-12 17:21:34 +11:00
Campbell Barton
b4504c7840 Cleanup: spelling in comments 2023-10-12 16:03:18 +11:00
Campbell Barton
1eabc2d4cd Merge branch 'blender-v4.0-release' 2023-10-12 16:00:26 +11:00
Campbell Barton
4e4fc8c276 Fix #107523: Cursor not cleared when panning stops 2023-10-12 15:59:22 +11:00
Harley Acheson
e00bd55576 Merge branch 'blender-v4.0-release' 2023-10-11 08:26:58 -07:00
Harley Acheson
1b28b79768 Revert: Fix #111666: Hide Mouse in Redo Panel Inputs #113428
Reverting this as Campbell would prefer a solution that does not
involve modal cursors.

Pull Request: https://projects.blender.org/blender/blender/pulls/113551
2023-10-11 17:25:38 +02:00
Brecht Van Lommel
46d32d8966 Merge branch 'blender-v4.0-release' into main 2023-10-10 15:36:39 +02:00
Brecht Van Lommel
478e1ab6d3 Fix build error on Windows after BLI_read changes
Don't use posix-only ssize_t in platform independent code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113493
2023-10-10 15:36:15 +02:00
Campbell Barton
028c4b440c Merge branch 'blender-v4.0-release' 2023-10-10 22:28:53 +11:00
Campbell Barton
fa40724a72 BLI_fileops: Add 'BLI_read' wrapper to ensure the requested data is read
According to the documentation `read` isn't required to read all the
data requested. Although until recently I'd never encountered this and
none of Blender's code checks for read succeeding but not reading the
requested size.

Resolves #113473 where images over 2gb fail to load.

Ref !113474.
2023-10-10 22:27:40 +11:00
Campbell Barton
1a234805d0 Merge branch 'blender-v4.0-release' 2023-10-10 19:05:03 +11:00
Campbell Barton
bb9b60f13d Fix build error Windows with ssize_t not being defined 2023-10-10 19:03:31 +11:00
Campbell Barton
9ebe1c386f Merge branch 'blender-v4.0-release' 2023-10-10 18:02:48 +11:00
Campbell Barton
34899ec13d Fix crash when the animation player fails to create a texture 2023-10-10 18:00:05 +11:00
Campbell Barton
70e548a79f Merge branch 'blender-v4.0-release' 2023-10-10 14:14:58 +11:00
Campbell Barton
60f4f71733 Merge branch 'blender-v4.0-release' 2023-10-10 14:14:55 +11:00
Campbell Barton
8b5d271c5c Fix playing back image files over 2gb in the animation player
Use size_t to store the file size.
2023-10-10 14:01:23 +11:00
Campbell Barton
3307e0afe8 Fix crash on startup with large images in the animation player
The image size was used to set the window size, large values could
make the window fail to create it's GPU context.

Resolve by constraining window size by the main display dimensions.

Even in cases where the window would succeed to create its generally
not useful to have a window larger than the screen size.
2023-10-10 13:57:44 +11:00
Campbell Barton
53a27eba86 Merge branch 'blender-v4.0-release' 2023-10-10 11:06:35 +11:00
Campbell Barton
af737c3a57 Merge branch 'blender-v4.0-release' 2023-10-10 11:06:33 +11:00
Campbell Barton
e03fd667f2 Fix clipped text with the animation player
The text was drawn at the very bottom left of the window.
2023-10-10 11:04:36 +11:00
Campbell Barton
256ace4c57 Fix animation player scrubbing with multiple file arguments
While passing in multiple files is supported, scrubbing both images
an movies wasn't working properly when multiple files were passed in.

For images, arguments such as "*.png" expand to multiple image files
which were each assigned a frame index of 0, this would play but stopped
scrubbing from working completely.

For movies, passing in multiple files would play back all files but
only properly scrub the first file, if other videos were longer than
the first scrubbing would jump to those.

Resolve by starting the frame index where the previous files left off.

Also resolve divide by zero when showing the indiciator for a single
frame.
2023-10-10 11:04:36 +11:00
Campbell Barton
137f8dd7bc Cleanup: spelling in comments 2023-10-10 09:44:57 +11:00
Hans Goudey
8f27baf388 Merge branch 'blender-v4.0-release' 2023-10-09 23:54:43 +02:00
Hans Goudey
976eaae02f Cleanup: Move BKE_object.hh to C++
Simplifies the fix to #111120, where the object bounds functions
may return a C++ type instead of `BoundBox`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113462
2023-10-09 23:41:53 +02:00
Harley Acheson
6e9be2ae2f Merge branch 'blender-v4.0-release' 2023-10-09 09:32:58 -07:00
Philipp Oeser
78489af86a Fix #113346: Append/Link fails if no name is specified
Removing one unnecessary check in wm_link_append_exec that caused us to
error out even though multiple files are selected. This removed check
is also done later on in the function so safety is still ensured.

Pull Request: https://projects.blender.org/blender/blender/pulls/113350
2023-10-09 18:29:49 +02:00
Bastien Montagne
df0d7c9c3d WM Jobs: Refactor all worker status variables into a single shared struct.
Move the three current 'status variables' (stop, update and progress)
into a single 'WorkerStatus' struct. This is cleaner and will allow for
future workin this area without having to edit tens of 'startjob'
callbacks signatures all the time.

No functional change expected here.

Note: jobs' specific internal code has been modified as little as
possible, in many cases the job's own data still just store pointers to
these three values. Ideally in the future more refactor will be using a
single pointer to the shared `wmJobWorkerStatus` data instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/113343
2023-10-09 12:12:22 +02:00
Harley Acheson
e246c111fb Merge branch 'blender-v4.0-release' 2023-10-08 13:20:04 -07:00
Harley Acheson
49c62e8e16 Fix #111666: Hide Mouse in Redo Panel Inputs
When grabbing cursor with "hide" option then also hide the mouse
cursor, and show again when done.

Pull Request: https://projects.blender.org/blender/blender/pulls/113428
2023-10-08 22:18:53 +02:00
Campbell Barton
5c98d53125 Cleanup: use early return to reduce right-shift in ghost_event_proc 2023-10-08 19:30:52 +11:00
Campbell Barton
0df1a0df3d WM: use time-stamps from events for double-click check
Using the time from events is more accurate under Wayland which
can create events while the main thread is busy.
2023-10-08 19:30:52 +11:00
Campbell Barton
8adc4cf7fa Cleanup: remove redundant window size assignment in playanim_window_zoom 2023-10-08 17:59:38 +11:00
Campbell Barton
c1a01ae7b4 WM: move last press time from the wmEvent into wmWindow
This was only ever used in the wmWindow::eventstate so it doesn't
make sense to store in every event.
2023-10-08 16:16:57 +11:00
Campbell Barton
fc78182cc8 Refactor: use const event data, use static_casts
In some cases processing events was modifying them, as there can be
multiple event consumers, manipulating events isn't correct.
Even though in practice it didn't cause issues, it's straightforward
not to do this and makes logic easier to reason about.
2023-10-08 15:23:39 +11:00
Campbell Barton
8f8a9ef488 Cleanup: remove unused GHOST_kEventTimer
There was a type error assigning customdata, (wmTimer *) was expected
although this data isn't created so it was never hit.
2023-10-08 14:31:15 +11:00
Campbell Barton
0742ef808f Fix writing past struct bounds of GHOST_TEventImeData
IME editing would cast GHOST_TEventImeData to wmIMEData then read/write
an additional member that doesn't exist in GHOST_TEventImeData.

In practice it's likely struct padding prevented this from showing up
as a bug. Nevertheless it's bad practice to rely on this.

- Make GHOST_TEventImeData read-only, move the is_ime_composing boolean
  into the window.
- Add static assert to ensure both structs are the same size.
- Correct code comments.
2023-10-08 14:29:08 +11:00
Campbell Barton
77a94e9e38 Cleanup: various non-functional changes for C++ 2023-10-07 18:29:48 +11:00
Falk David
7e87435cf4 GPv3: Initial drawing tool
This PR implements an initial drawing tool that can already be used for testing.
While this is not fully feature complete (compared to the current grease pencil draw tool) the following is already implemented:

* Pressure support for radius and opacity.
* Material color and vertex color support.
* New active smoothing algorithm based on curve fitting.
* Simplify algorithm as a post-process step.

Some deliberate limitations include:
* The drawing plane is always the front plane. Drawing on surfaces is also not supported.
*

The current approach has not been optimized for performance yet. The goal was to have a straightforward implementation
first and then focus on performance later.

There are numerous parameters in the code that are hard-coded for now. These should be exposed at some point, potentially as user settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/110093
2023-10-06 10:49:54 +02:00
Campbell Barton
91011b06a0 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:10 +11:00
Campbell Barton
35edcf2ed6 Fix #107594: Phantom cursor motion when resizing windows under Wayland
Resizing a window in Wayland caused cursor motion events in the window
which could be seen as buttons flashing when the cursor was detected
as hovering over buttons.

This was caused by two bugs:

- Missing checks for failure to access the cursor location before
  converting the coordinates from GHOST to screen-space meant the
  wmWindow::eventstate location would move each time the location
  was updated.

- Resizing the window wasn't detecting state changes and would
  continuously send window activation events. Window activation set
  wmWindpw::addmousemove which triggered the previous bug, making the
  cursor flicker during resize.

This commit only addresses the first issue, where failure to access
the cursor location wasn't accounted for
(window activation will be fixed separately).

All GHOST_GetCursorPosition & wm_cursor_position_get calls now account
for failure, resolving uninitialized stack memory use in some cases.

This resolves similar issues for macOS, WIN32 & X11 although it seems
likely these platforms rarely fail to access the cursor location.
2023-10-06 17:12:32 +11:00
Campbell Barton
a52c597051 Cleanup: correct argument name (wasn't following conventions) 2023-10-06 12:50:51 +11:00
Bastien Montagne
acde11f159 Cleanup: wmJobs: Use defined startjob callback type everywhere.
For some reasons, `WM_jobs_stop` and `WM_jobs_kill` would use their own
'type' of function pointer - and not even a matching one!

Among (many) other reasons why this was bad, it required very stupid
casting from code using these functions - and made editing wmJob `startjob`
signature needlessly complicated.
2023-10-05 16:13:15 +02:00
Campbell Barton
325e8ea605 Merge branch 'blender-v4.0-release' 2023-10-05 15:05:31 +11:00
Campbell Barton
2cf8c7ecf4 Docs: note why the wait cursor isn't set for the startup file 2023-10-05 14:56:29 +11:00
Campbell Barton
36056ba37a Merge branch 'blender-v4.0-release' 2023-10-05 13:58:46 +11:00
Campbell Barton
3859a08704 Cleanup: use the name 'ot' for wmOperatorType for unused arguments 2023-10-05 13:55:35 +11:00
Campbell Barton
de89decd77 Cleanup: include argument names in callbacks
While not essential it gives a hint to the naming conventions for
function arguments.
2023-10-05 13:45:19 +11:00
Campbell Barton
f5b71e5152 Cleanup: rename Global "lib" & "ima" for clarity
Rename members to make it clear they're for the last used file-paths:

- ima -> filepath_last_image
- lib -> filepath_last_library
2023-10-05 13:33:37 +11:00