Commit Graph

115929 Commits

Author SHA1 Message Date
Hans Goudey
f6290cd2a4 Cleanup: Remove unnecessary includes 2022-06-24 15:47:24 -05:00
Brecht Van Lommel
35da733e6b Fix T99058: geometry nodes ignore if subdivision surface modifier is disabled
It was looking up the last modifier in the stack, ignoring visibility, instead
of mesh->runtime.subsurf_runtime_data set by the modifier evaluation and used by
the drawing code.
2022-06-24 19:57:28 +02:00
Brecht Van Lommel
9b6e86ace1 Cycles: stop Metal rendering on command buffer error
If there is an error we should stop rendering, instead of finishing with a
wrong render result or reporting a wrong benchmark time.

Ref T96519

Differential Revision: https://developer.blender.org/D15287
2022-06-24 16:51:56 +02:00
Christian Rauch
29755e1df8 GHOST/Wayland: support client-side window decorations
This implements client-side window decorations for moving and resizing
windows and HiDPI support.

This functionality depends on the external project 'libdecor' that is
currently a build option: WITH_GHOST_WAYLAND_LIBDECOR.

Reviewed by: brecht, campbellbarton

Ref D7989
2022-06-25 00:10:39 +10:00
Dalai Felinto
f1d191120f Fix T99130: Spline factor gets messed up if one hair is too short
In the cases where length is zero, we simply equally distribute the
value based on the control point/curve index.

Differential Revision: https://developer.blender.org/D15285
2022-06-24 15:36:31 +02:00
Campbell Barton
ad8add5f0c Fix T98427: Crash adding quick effects smoke from Python
Manta flow used the `__main__` namespace which it was executed in,
this caused a bug when calculating fluid from Python, which clears
it's `__main__` name-space after execution.
This caused Manta-flows name space to be cleared too.

Resolve this by creating a separate name-space for manta-flow.

Reviewed by: SonnyCampbell_Unity

Ref D15269
2022-06-24 23:28:55 +10:00
Campbell Barton
2580d2bab5 PyAPI: Expose event.type_prev, value_prev
Before [0] mouse-motion events left the 'event.value' un-changed,
so a mouse-move would be set to PRESS/RELEASE based on previous events.

Support accessing the previous event value directly
to address feedback from T99102.

Note that the previous cursor location is already exposed.

[0]: 52af3b20d45ea525a0ce66b2613ac132c9032a3f
2022-06-24 23:19:44 +10:00
Campbell Barton
77eadbede4 Fix T99037: bpy.ops.transform.rotate fails in background mode
This reverts commit c503c5f756aab850e8afe2513b2dc7b645cf84af,
alternate fix for T82244.

Scripts that run in background mode expected rotation to be usable,
defaulting to the 3D viewport when there is no active windowing data.

Also resolves T88610.
2022-06-24 22:16:47 +10:00
Jeroen Bakker
585d81ba2b Workbench: Increase render tests fail threshold for hair.
When running the render test cases on MacOS/Intel the hair render
test fail. Most likely due to the dense geometry and the low
resolution of the test image.

This patch increases the fail threshold so these tests will pass.
Note that I haven't been able to test whether this is also the case
for Linux/Windows. If that is the case we should remove the platform
specific test.
2022-06-24 14:09:15 +02:00
Jeroen Bakker
f748a81f25 Test/Eevee: Increase failure threshold for image tests.
Makes the current test cases pass on NVIDIA 1080Ti/515.
The tests still fail on other platforms (AMD, Intel). Some are actual failures.
Other require platform specific reference images.

Original patch provided by Brecht van Lommel.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15264
2022-06-24 13:45:29 +02:00
Jeroen Bakker
7927ac2fbe Fix T99129: Eevee Hair Info Length not working (old particle hair).
When using the old particle hair with the hair info length it wasn't
working with AMD GPUs. The reason was that the drw_curves uniform buffer
wasn't initialized what made the shader select the incorrect length.
2022-06-24 13:03:29 +02:00
Dalai Felinto
79973494ec Cleanup: Fix building warnings on gcc 9.4.0
Solution by Jacques Lucke
2022-06-24 11:25:12 +02:00
Richard Antalik
e08c932482 Fix T98925: Editor panels are broken
Commit 277fa2f441f4 added channels region to unintended editors if sequencer was
used in area. This caused issues with some editors having 2 tool regions and
non functioning side panel.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D15253
2022-06-24 10:23:31 +02:00
Campbell Barton
3323cd9c9a GHOST/Wayland: support for cursor warp with hidden/wrapped grab enabled
As grab already uses it's own virtual coordinates, cursor warping can
be used when grab is enabled.

Currently nothing depends on this however it could be useful in future.
2022-06-24 14:38:17 +10:00
Campbell Barton
11f38f59e2 Cleanup: remove unused function WM_cursor_compatible_xy 2022-06-24 14:00:36 +10:00
Campbell Barton
4c4e8cc926 Fix T99021: Walk-mode doesn't work in Wayland
Walk mode implemented it's own grab which relied on WM_cursor_warp
to work (which isn't implemented for wayland).

Resolve this by using WM_cursor_grab_{enable/disable}.

Besides fixing Wayland this removes the need for workarounds:

- Ensure the event received were after the event generated from warping.
- Alternate logic that reset the "center" when using tablets.
- Checking the cursor location was scaled by native-pixels on macOS.

There is a minor change in behavior: on completion the cursor is left
at the location walk-mode began instead of the center of the region.
2022-06-24 13:58:21 +10:00
Campbell Barton
70648683a2 Cleanup: add C++ compatible WL_ARRAY_FOR_EACH macro 2022-06-24 10:22:46 +10:00
Campbell Barton
cc09661c4e Cleanup: remove unused cursor struct members in GHOST/Wayland 2022-06-24 09:59:37 +10:00
Campbell Barton
b3a713fffa Cleanup: use const arguments for GHOST/Wayland 2022-06-24 09:58:27 +10:00
Campbell Barton
9b5dda3b07 GHOST: use GHOST_ASSERT for non-release builds
GHOST_ASSERT now matches BLI_assert, which is only ignored for release
builds. Otherwise it prints or asserts when WITH_ASSERT_ABORT is enabled.
2022-06-24 09:00:19 +10:00
Campbell Barton
93de6b912f Docs: correct GHOST_TimerProcPtr time doc-string 2022-06-24 08:46:18 +10:00
Campbell Barton
4919403c29 Fix outdated pressure/tilt for tablet motions events under GHOST/Wayland
Accumulate tablet data before generating an event using the 'frame'
callback.
2022-06-24 08:19:08 +10:00
Jörg Müller
41a0411d79 Fix T99083: audio bad in command-line video player (blender -a)
There was a wrong sample size computation in PulseAudioDevice.
The sample format is switched to float32 for the command-line player.
2022-06-23 21:32:34 +02:00
Hans Goudey
b0fe0e6a30 Cleanup: Make function static 2022-06-23 13:03:31 -05:00
Hans Goudey
0473462241 Geometry Nodes: Speed up Separate color node in RGB mode
This applies the same optimization as b8bd304bd45397b8c to the separate
color node. I observed about a 50% improvement with 10 million values
when only extracting one channel-- from about 17ms to 11ms.
2022-06-23 12:34:31 -05:00
Brecht Van Lommel
a5ff46e0fc Cleanup: make format 2022-06-23 19:28:39 +02:00
Brecht Van Lommel
dc64673f6e Fix T97691: undefined behavior sanitizer warning for alignment in RNA functions
Thanks Loren Osborn for investigating this and proposing solutions.

Ref D14798
2022-06-23 19:22:50 +02:00
Max Edge
56435b3268 Fix T94621: Missing selection indication for virtual node sockets
A small regression as a result of adding a custom outline to the empty
virtual socket, which ended up overriding the colors when selected with
Shift+LMB.

Differential Revision: https://developer.blender.org/D15103
2022-06-23 12:22:23 -05:00
Angel Bueno
792bf82f11 Spreadsheet: Support operations for filtering colors
Support choosing an operation when filtering colors,
like the other types.

Differential Revision: https://developer.blender.org/D15191
2022-06-23 12:16:18 -05:00
Hans Goudey
9b775ebad7 Cleanup: Remove unused array in vertex paint code
Unused since 4f616c93f7cb8c8c8e038
2022-06-23 12:10:12 -05:00
Hans Goudey
6dde88c536 Vertex paint mode tried to do a "fast update" by trying to avoid tagging
the mesh ID for a full update. The conditions it uses are troublesome:
 1. There must be an evaluated mesh
 2. The evaluated mesh's active byte color layer must equal the original's

This logic doesn't make sense for a few reasons. First of all, the
`mloopcol` pointer doesn't make sense in the context of color
attributes (rather than the old vertex colors), since it only points
to byte color attribute on face corners. Second, just because the
layer pointers are equal doesn't mean something doesn't depend
on the attribute's values.

I think the best solution currently is to remove this "fast update"
case and instead work on optimizing the general case.

Also, T95842 suggests removing these pointers, and this is one
of the last remaining uses of `Mesh.mloopcol`.

Differential Revision: https://developer.blender.org/D15275
2022-06-23 12:05:48 -05:00
Hans Goudey
54182e4925 Mesh: Add an explicit "positions changed" function
We store various lazily calculated caches on meshes, some of which
depend on the vertex positions staying the same. The current API to
invalidate these caches is a bit confusing. With an explicit set of
functions modeled after the functions in `BKE_node_tree_update.h`,
it becomes clear which function to call. This may become more
important if more lazy caches are added in the future.

Differential Revision: https://developer.blender.org/D14760
2022-06-23 12:00:25 -05:00
Hans Goudey
3e5a4d1412 Geometry Nodes: Optimize selection for virtual array input
This makes calculation of selected indices slightly faster when the
input is a virtual array (the direct output of various nodes like
Face Area, etc). The utility can be helpful for other areas that
need to find selected indices besides field evaluation.

With the face area node used as a selection with 4 million faces,
the speedup is 3.51 ms to 3.39 ms, just a slight speedup.

Differential Revision: https://developer.blender.org/D15127
2022-06-23 11:51:33 -05:00
Xavier Hallade
633c2f07da Cyles: switch primitive.h inline hints to forceinline
This change helps decrease Intel GPU binaries compile time by 5-10
minutes without impacting other backends.

Reviewed By: sergey, brecht

Differential Revision: http://developer.blender.org/D15273
2022-06-23 18:36:48 +02:00
Hans Goudey
2eba15d3e8 Fix T98975: Broken vertex paint mode operators
All of the operators in vertex paint mode didn't work properly with
the new color attribute system. They only worked on byte color type
attributes on the face corner domain.

Since there are four possible combinations of domains and types now,
it mostly ended up being simpler to convert the code to C++ and use
the geometry component API for retrieving attributes, interpolating
between domains, etc. The code changes ended up being fairly large,
but the result should be simpler now.

Differential Revision: https://developer.blender.org/D15261
2022-06-23 11:33:11 -05:00
Richard Antalik
5c6ffd07e0 Fix T99110: Crash after running view_all operator in VSE
Crash caused by NULL dereference, when `Editing` is not initialized.

Check if data is initialized in poll function.
2022-06-23 18:20:02 +02:00
Richard Antalik
d1ea39aac7 Fix T99091: Freeze when changing strip source with thumbnails enabled
When input file is changed, `orig_height` and `orig_width` fields are
reset, which causes thumbnail dimensions to be incorrectly calculated.

Only draw thumbnails if both mentioned fields are non 0.
2022-06-23 17:49:26 +02:00
Brecht Van Lommel
1c83354c63 Fix T99028: crash deleting file output node with color management override
One case of copying image formats was not properly using BKE_image_format_copy.
To fix this for existing .blend file we need to do versioning, ensuring the curve
mapping is properly copied.
2022-06-23 16:35:11 +02:00
Andrii Symkin
c2a2f3553a Cycles: unify math functions names
This patch unifies the names of math functions for different data types and uses
overloading instead. The goal is to make it possible to swap out all the float3
variables containing RGB data with something else, with as few as possible
changes to the code. It's a requirement for future spectral rendering patches.

Differential Revision: https://developer.blender.org/D15276
2022-06-23 15:02:53 +02:00
Campbell Barton
b8403b065e Fix T99027: Touch typing in text fields results in dropped key presses
Fix by always testing unhandled double-click events as press events,
irrespective of the previous event type.

**Details**

Handling double-click events only ran when the previously pressed-key
matched the current pressed-key.

Originally when double-click support was added the previous type was
compared (ignoring it's press/release value) and while not necessary
it was harmless as it matched the check for double-click events being
generated.

As of [0] the logic for click/drag detection changed to ignore release
events as release this could interrupt dragging.
This made it possible to generate double-click events that failed the
`event->prev_press_type == event->type` comparison.
In these cases it was possible to generate double-click
events that would not fall-back to a 'press' value when unhandled.

[0]: 102644cb8cbb8b21e55643cebe2ed364885023a6
2022-06-23 22:25:13 +10:00
Jacques Lucke
e63799e791 Cleanup: fix typo that deactivated clang-format in rna_brush.c 2022-06-23 13:10:26 +02:00
Sebastian Parborg
b830263186 Fix T98871: Drivers not updated when joining an armature
If the some driver had been flagged as "invalid", the flag would not be
cleared when joining armatures which could lead to now valid drivers
still being flagged as invalid.

Now we clear this invalid flag on all drivers to force a recheck after
joining the armatures.
2022-06-23 11:47:37 +02:00
Colin Basnett
091100bfd7 Animation: Add function to remove all FCurves from an Action
Add a `BKE_action_fcurves_clear(action)` function, which removes all the
Action's FCurves, and expose it as `ActionFCurves.clear()` in RNA.

This is more ergonomic than calling `remove` on f-curves until the list
is empty.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14660
2022-06-23 11:45:53 +02:00
Colin Basnett
2ae4397ec9 Armature: Add poll message explaining bone groups need pose mode
Add a poll message to the bone group operators, to explain they only
work in pose mode. Before, the buttons would be greyed out with no
explanation.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15119
2022-06-23 11:37:23 +02:00
Colin Basnett
57816a6435 Dopesheet: Add Custom Properties panel
Adds a custom property panel for the active `Action` to the Dopesheet
editor. There was previously no way to edit these properties outside of
the Python API.

This panel will show up when
`context.active_object.animation_data.action` is set.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14646
2022-06-23 11:12:42 +02:00
Michael Jones
d8e9647ae2 Cycles: Add diagnostic tracing of MTLLibrary compilation time
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15268
2022-06-23 10:06:20 +01:00
Campbell Barton
d20bad914e Fix key repeat continuing after a window loses focus for GHOST/Wayland
Also remove NULL checks in keyboard enter/leave handlers,
as they didn't serve any purpose.
2022-06-23 15:38:43 +10:00
Yiming Wu
e4f51b3a6e LineArt: Cleanup minor warnings from variable type changes. 2022-06-23 13:22:56 +08:00
Campbell Barton
743a027862 Fix key repeat behavior for GHOST/Wayland
- Respect modifier keys (Shift press/release didn't change the case).

- Changing modifiers resets the timer instead of canceling key-repeat.

- Releasing keys (besides the key being repeated) resets the timer
  instead of canceling key repeat.

This makes key-repeat behave the same way as GTK & WIN32 text input.
2022-06-23 15:14:18 +10:00
Hans Goudey
1160a3a3f8 Cleanup: Clang tidy
Mainly duplicate includes and else after return.
2022-06-22 18:58:25 -05:00