Commit Graph

128893 Commits

Author SHA1 Message Date
Jacques Lucke 271f634a84 Fix #113319: crash with out of bounds index in curve sample node
This was broken in 5063f7a725.
2023-10-06 13:58:17 +02:00
Christoph Lendenfeld d85e7f4577 Fix #87160: Clean Keyframes only works if channels are selected
The issue was that the code filtered for selected channels,
while the expectation was that it would only filter for selected keys.

This PR changes the behavior of the operator in the following way:
* when "Clean Channels" is **disabled**, it will clean only selected keyframes, regardless of the channel selection
* when "Clean Channels" is **enabled**, it will clean selected channels regardless of keyframe selection

The same logic was applied to the Graph Editor code.
It only makes a difference in the case when "Clean Channels" is enabled.
That is because channels were automatically selected when a key was selected.

In addition to that I moved the menu entry for "Clean Channels" to the channel menu
to reduce confusion.

Another solution would have been to make the Dope Sheet select channels
when keys are selected. This might still be done in the future, but I think the
only correct fix is to change the actual operator behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/113335
2023-10-06 13:51:04 +02:00
Leon Schittek 8d15783a7e UI: display invalid cache as striped lines in the timeline
Unify the way the different state's of a cache are shown in the timeline:
* Baked: fully opaque
* Cached: slightly transparent
* Invalid cache: slightly transparent, dark diagonal stripes

This improves accessibility since patterns are easier to recognize
for colorblind or otherwise visually impaired people.

The slight transparency is done with an alpha of 0.7 and the diagonal
stripes use the cache's color at 50% value.

Implements #108196.

Pull Request: https://projects.blender.org/blender/blender/pulls/108481
2023-10-06 13:12:16 +02:00
Xavier Hallade d26a2b09bc Cycles: oneAPI: use hardware cos
Speckles and missing lights were experienced in scenes with Nishita Sky
Texture and a Sun Size smaller than 1.5°, such as in Lone Monk and Attic
scenes.
We previously worked around these by using a more precise
software implementation of cosine.
After recent changes in Cycles, it turns out this workaround isn't
currently needed.
2023-10-06 13:10:27 +02:00
Pratik Borhade 97b831df8e Merge branch 'blender-v4.0-release' 2023-10-06 16:26:53 +05:30
Pratik Borhade b5ebf31fb1 Fix #113022: Disabled menu item's text uses inner color
This fails to differentiate between active buttons and disabled buttons
for some custom themes (and also in blender light theme)

Instead use text color with 0.5 alpha value for disabled item's text.
(Don't blend between text and inner color)

Pull Request: https://projects.blender.org/blender/blender/pulls/113082
2023-10-06 12:54:14 +02:00
Campbell Barton a91ee4d5e3 Merge branch 'blender-v4.0-release' 2023-10-06 21:48:37 +11:00
Campbell Barton c5d01df691 Merge branch 'blender-v4.0-release' 2023-10-06 21:48:34 +11:00
Campbell Barton 59d81a23d9 AUTHORS: update 2023-10-06 21:47:31 +11:00
Campbell Barton 8974ca8f24 Tools: set the number of jobs to the CPU count for various utilities
Previously this was the double the CPU count because:

- Modern CPU's from AMD & Intel support SMT/hyper-threading which
  present twice as many cores, doubling again has little to no benefit.
- Using 2x or 4x the number of physical cores number can use a lot of
  memory on systems with many cores which are becoming more common.
2023-10-06 21:47:03 +11:00
Sybren A. Stüvel 1b273f2bf4 Merge remote-tracking branch 'origin/blender-v4.0-release' 2023-10-06 11:47:46 +02:00
Sybren A. Stüvel 4c64c34f49 Fix #110874: Anim: Theme confusion with 'Pose Bone' label
Update the label of the "Bone Pose" theme setting to "Bone Pose Selected".
That is now consistent with the already-existing "Bone Pose Active"
label.

Also add tooltips that clarify what these theme colors are used for.
2023-10-06 11:46:52 +02: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
Nathan Vegdahl 8735103b8e Merge branch 'blender-v4.0-release' 2023-10-06 10:24:28 +02:00
Clément Foucault c5bf383826 Fix: DRW: Missing braces around array constructor 2023-10-06 10:19:46 +02:00
Nathan Vegdahl e26d287520 Fix #112018: increase AgX LUT resolution
AgX exhibited some banding-like artifacts that were due to being
approximated with a 3D LUT.  This commit resolves that by increasing
the LUT resolution enough to mitigate the artifacts and make them
unnoticeable.

Additionally:
- The previous LUTs were written in a space-inefficient way, using
  e.g. "0.000000" instead of "0".  The new LUTs are written more
  efficiently, avoiding quite as dramatic a file size increase as
  usually accompanies 3D LUT resolution increases.
- The previous LUTs included output values greater than 1.0, which was
  both incorrect for a tone mapper, and also pointless since Blender
  immediately clips them anyway.  The new LUTs clip to 1.0.  This also
  allows the more efficient writing to squeeze even more space savings
  out of the LUTs.
- The previous inverse AgX LUT contained NaNs.  Those have been
  replaced with 0.0 in the new inverse LUT.

Note that due to discrepancies between the LUTs previously provided
to Blender and the AgX scripts that were later published, the color
transform in these LUTs are slightly different.  But they are close, and
equivalently good.

Pull Request: https://projects.blender.org/blender/blender/pulls/113253
2023-10-06 10:12:24 +02:00
Hans Goudey b5b0a296b6 Cleanup: Else after return in curves trim 2023-10-06 10:11:16 +02:00
Campbell Barton 273af6855a CMake: cache the HAVE_BROTLI result
Avoid detecting HAVE_BROTLI every time CMake runs,
only re-detect if the freetype includes change.
2023-10-06 17:58:26 +11:00
Campbell Barton 6b2f9dd71d Merge branch 'blender-v4.0-release' 2023-10-06 17:34:18 +11:00
Campbell Barton e1dac0b122 Fix glitch resizing windows with LIBDECOR on Wayland
The window contents and the window boarders were noticeably out of sync
when resizing the window quickly.

Resolve by keeping the current size as-is, rely on deferred handling
of the pending window size to apply the new size along with the contents.
2023-10-06 17:32:43 +11:00
Campbell Barton a110873f52 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:15 +11:00
Campbell Barton 9ddb3143c0 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:13 +11:00
Campbell Barton 91011b06a0 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:10 +11:00
Campbell Barton edfc78e0f2 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:07 +11:00
Campbell Barton b9d300380f Cleanup: correct typo in assertions 2023-10-06 17:13:44 +11:00
Campbell Barton d59a79ef95 Fix redundant window activation/deactivation events under Wayland
Any window state change (resizing for e.g.) triggered
activation/deactivation events. Resolve by only sending events on state
change. The activation caused cursor motion events from #107594.
2023-10-06 17:12:32 +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
Jeroen Bakker 4a94e17156 Cleanup: Remove unused attribute in GLShaderInterface 2023-10-06 07:47:08 +02:00
Jeroen Bakker 79ca1b16ab Cleanup: Make format 2023-10-06 07:40:26 +02:00
Jeroen Bakker c801c73d79 Python: Update BGL Deprecation Warning
BGL is deprecated and will not work on Metal devices. Although the
inital plan was to remove it in Blender 4.0, We don't see any harm
to still have it in the code-base until OpenGL itself is deprecated.

Add-on developers are warned when using the BGL module that the
add-on/script will not work on all platforms.

There are still some limitations inside the GPU module that needs
a more friendly API. This API isn't clear at this time.

Pull Request: https://projects.blender.org/blender/blender/pulls/112579
2023-10-06 07:37:44 +02:00
Campbell Barton 31dce9d11d Merge branch 'blender-v4.0-release' 2023-10-06 16:21:01 +11:00
Campbell Barton 36021021aa GHOST/Wayland: remove window activation on tablet proximity in
Activating on tablet proximity isn't needed and would activate windows
that were already active. The window manager handles activation.
2023-10-06 16:20:08 +11:00
Campbell Barton ba472eb69e Merge branch 'blender-v4.0-release' 2023-10-06 16:16:58 +11:00
Campbell Barton c413a8d183 Fix error clearing the windows libdecor state on failure on Wayland
API docs note the state should remain unchanged when accessing the state
fails.
2023-10-06 16:15:47 +11:00
Campbell Barton bd66e2e662 Cleanup: use defines for superscript numbers in unit.cc 2023-10-06 14:12:26 +11:00
Campbell Barton 2b77cd726d Cleanup: wrap definitions across multiple lines, add struct identifiers
When units were initially defined having each on their own line was
compact, since them more fields have been added, making the lines
overly long and the difference between each field non-obvious.

Further, the conversion from C to C++ [0], wrapped definitions onto the
same line (for some reason), resulting in lines over 700 wide.

Use clang-format & add struct ID's for clarity.

[0]: 129f78eee7
2023-10-06 13:57:52 +11:00
Campbell Barton ade74a6584 Merge branch 'blender-v4.0-release' 2023-10-06 13:27:23 +11:00
Campbell Barton 5e2b8c43e4 Fix invalid collection length for dummy unit collection
While this didn't show up as a bug, if this length was used it could
result in an out of bounds read.
2023-10-06 13:23:42 +11:00
Campbell Barton a52c597051 Cleanup: correct argument name (wasn't following conventions) 2023-10-06 12:50:51 +11:00
Campbell Barton 71b1712d79 Cleanup: spelling in comments 2023-10-06 12:50:27 +11:00
Jesse Yurkovich 9a5f5ca6a9 Cleanup: make format 2023-10-05 18:11:54 -07:00
Jesse Yurkovich d47ceb53f8 Cleanup: Replace usage of old BLI_array macros with C++ types
This replaces the older dynamic c arrays with blender::Vector as
appropriate. Many files required minimal changes and the before/after
are quite similar.

There's 3 remaining usages of the old machinery but those will require
more involved changes and design.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110981
2023-10-06 03:02:17 +02:00
Lukas Stockner 7d908ed091 Merge branch 'blender-v4.0-release' 2023-10-06 02:26:33 +02:00
Lukas Stockner 887570065f Fix #112948: Cycles: Principled Sheen over Coat should use Coat normal
Conceptually, Sheen is layered over Coat, so if e.g. a bump map is applied
to the Coat layer, it should also affect Sheen.
2023-10-06 02:22:50 +02:00
Hans Goudey ecb52140cd Fix #113128: Socket hide value not copied to group input
This needs to be copied explicitly to the interface socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/113286
2023-10-06 00:43:45 +02:00
Lukas Stockner c68f568eb3 Merge branch 'blender-v4.0-release' 2023-10-05 23:01:06 +02:00
Lukas Stockner 97dfbc9a63 Fix #110183: Cycles: Numerical issues with distant area light sampling
The solid angle computation for the sampling/PDF code was running into
cancellation issues for small solid angles.
Reformulating the terms using asin() instead avoids this.
2023-10-05 22:53:33 +02:00
Brecht Van Lommel 1849e192fa Merge branch 'blender-v4.0-release' into main 2023-10-05 22:03:29 +02:00
coyo_t b0706a57ac Fix #106760: Cycles OSL boolean socket not working
Pull Request: https://projects.blender.org/blender/blender/pulls/109576
2023-10-05 21:55:10 +02:00
Brecht Van Lommel 9e8ded92e5 Merge branch 'blender-v4.0-release' into main 2023-10-05 20:00:07 +02:00