105022 Commits

Author SHA1 Message Date
Campbell Barton
d5f2043ab3 PyDoc: fix indentation with multi-line property descriptions
New lines were written without indentation,
causing invalid RST to be generated.
2021-03-31 17:43:30 +11:00
Campbell Barton
1e4c35d910 PyDoc: correct sphinx syntax for gpu.state.blend_set 2021-03-31 17:42:21 +11:00
Campbell Barton
b547ac32d9 Cleanup: use early return for imbuf image loader functions
Most imbuf loaders already did this, use early exit for the remaining
loaders that didn't.
2021-03-31 17:05:57 +11:00
Campbell Barton
e7f890aa59 WM: use data-path utility functions for WM operators
Use utility functions to decompose data paths and resolve the
RNA property from a data-path.
Replaces in-line string manipulation and RNA access.

This allows more complex data paths to be used, where previously string
literals in a data path could break the simple data-path handling logic.
2021-03-31 15:29:50 +11:00
Campbell Barton
1beca76934 PyAPI: add bl_rna_utils.decompose_data_path
Utility function for splitting an RNA path, to be used by `bpy.ops.wm.*`
2021-03-31 15:03:19 +11:00
Campbell Barton
c59a7f44a1 Fix bl_rna_utils._TokenizeDataPath function argument extraction error
Converting functions with single arguments to a string
added an additional comma.
2021-03-31 15:01:44 +11:00
Campbell Barton
5678e6c2bc Cleanup: improve navigation gizmo flag use
Flag check for V3D_LOCK_CAMERA used boolean style assignment to a char,
which worked with this flag but could fail if other flags are added
that use this convention in the future.

- Add static type checks for values so any change to DNA types
  will need to be made in the navigation gizmo too.
- Move camera lock check from `rv3d` to `v3d`,
  as this isn't stored in the region data.
2021-03-31 13:04:12 +11:00
Harley Acheson
87aa514611 UI: Gizmo Button to Lock Camera to View
2D gizmo navigation button that toggles 'Lock Camera to View' while in Camera View.

Differential Revision: https://developer.blender.org/D10835

Reviewed by Campbell Barton
2021-03-30 14:09:26 -07:00
Germano Cavalcante
1425411249 Cleanup/Refactor: Unify functions that redraw the depth buffer
Now `ED_view3d_backbuf_depth_validate`, `ED_view3d_draw_depth` and
`ED_view3d_draw_depth_gpencil` are unified in `ED_view3d_depth_override`.

This new function replaces `ED_view3d_autodist_init`.

Also, since `ED_view3d_depth_update` depends on the render context, and
changing the context is a slow operation, that function also was removed,
and the depth buffer cached is now updated inside the new unified drawing
function when the "bool update_cache" parameter is true.

Finally `V3D_INVALID_BACKBUF` flag has been renamed and moved to
`runtime.flag`.

Differential revision: https://developer.blender.org/D10678
2021-03-30 16:23:58 -03:00
Germano Cavalcante
da1b002c8d UI: Skip undo steps when changing properties of the 3d cursor
Differential revision: https://developer.blender.org/D10695
2021-03-30 16:13:21 -03:00
Germano Cavalcante
54d7dea283 Fix: buttons whose property contains an 'owner_id' ignore rna undo check
Introduced in rBce462fa1 but harmless since curretly only `StructRNA`
without `owner_id` have the `STRUCT_UNDO` flag cleared.

So this commit does not bring any functional changes but it will be
useful for {D10695}.
2021-03-30 16:10:58 -03:00
Antonio Vazquez
67b40f829e Fix T87058: GPencil Cutter delete all strokes if they are selected and the layer is locked
The problem was produced because the strokes were selected, but the loop to clear this flag before applying cutter was using unlocked layers only, and the protected layer flag was not reset.

Now, the flag is reset for all layers, locked and unlocked.
2021-03-30 19:43:45 +02:00
Wannes Malfait
6ddd280b21 Nodes: Expose multi input socket in python API
It was not possible to determine if a socket was multi input previously
with BPY. This patch exposes the flag as a read-only property of a node
socket. This is important for addons which automatically add connections
between nodes.

Differential Revision: https://developer.blender.org/D10847
2021-03-30 10:15:23 -05:00
Hans Goudey
6ea09db7a1 Cleanup: Improve comment 2021-03-30 10:03:11 -05:00
Ankit Meel
e5f0d176d4 CMake: issue warnings when changing options
Only done in top level CMakeLists, and platform_apple.

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10343
2021-03-30 20:28:45 +05:30
Hans Goudey
9f323e9bf7 UI: Bring back hover shortcuts for mesh modifiers
Earlier last year, the shortcuts on hover were built as a way to regain
speed lost by removing the "Apply" and "Copy" buttons from the panel.
For the active modifier concept introduced for geometry nodes, the
shortcuts were changed to only affect the active modifier.

Based on feedback, this change slowed down many people's interaction
with the modifier stack so the UI team decided to return hover shortcuts
for modifier panels.

The downside of this change is that it looks like the active modifier is
"selected" and it could be confusing that the modifier shortcuts don't
apply to it. We can explore different ways to display the active status
to address this.

Ref T87012
2021-03-30 09:56:04 -05:00
Germano Cavalcante
1f58a0ea3c Cleanup: use doxy sections and rearrange editmesh_knife.c 2021-03-30 11:50:05 -03:00
Hans Goudey
b1380101df Geometry Nodes: Set default grid vertices to 3 by 3
This is a relatively arbitrary value, but a good starting point-- it's
simple while also showing the possibility of the subdivisions.

Ref T86819
2021-03-30 09:33:42 -05:00
Hans Goudey
a4b6c222fa Fix unused variable warning caused by recent cleanup
Caused by a cleanup, rBd037fef3bd1dc.
2021-03-30 09:18:33 -05:00
Jeroen Bakker
88b5d7f5f3 Cleanup: remove unneeded method.
size can be accessed via instance attribute.
2021-03-30 16:03:43 +02:00
Jeroen Bakker
094c950915 Cleanup: clang-format. 2021-03-30 16:03:43 +02:00
Jeroen Bakker
88e0ed3288 Cleanup: Use constexpr. 2021-03-30 16:03:43 +02:00
Jeroen Bakker
b48a573adb Compositor: Fix Incorrect Attaching NodeSockets.
Introduced by recent commit.
2021-03-30 16:03:43 +02:00
Jeroen Bakker
04a92297dd Cleanup: Replace std::vector with blender::Vector. 2021-03-30 16:03:43 +02:00
Jeroen Bakker
d4e76712d4 Cryptomatte: Fix When Image based Cryptomatte Aren't On The First Render Layer.
The image user wasn't updated to reflect the correct render layer.
2021-03-30 16:03:43 +02:00
Jeroen Bakker
e125c9329d Fix: Compile Error COM_Debug.
We should replace `ifdef COM_Debug` with a constexpr function.
2021-03-30 16:03:43 +02:00
Jeroen Bakker
3ead9b2b36 Cleanup: Replace virtual methods with bitflags. 2021-03-30 16:03:43 +02:00
Campbell Barton
5a6d5d20de UI: add description methods for wm.context_* operators
Generic context operators now look-up the RNA properties to extract
their description (when it's available).

Add `bl_rna_utils.data_path.property_definition_from_data_path()`
to handle the details of accessing the RNA property definition.
2021-03-31 01:02:08 +11:00
Kévin Dietrich
88d94d89fa Fix T87007: Cycles Background not updated if strength is initially null
When the strength is initially set to zero, the shader graph is
optimized out to remove any node which will not be executed because of
this, which removes pretty much every single node, except for the
output. As the graph is empty, the world shader is made invisible to
rays so it is not evaluated in the kernel.

However, when the strength is then modified, the Background is not
updated as the modification happens on the Shader Node and not on the
Background Node, so it is never tagged as modified.

To fix this, we need to tag the Background as modified when its shader
is also modified so the Kernel data is properly updated.

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-30 15:41:33 +02:00
Patrick Mours
f1fe42d912 Cycles: Do not allocate tile buffers on all devices when peer memory is active and denoising is not
Separate tile buffers on all devices only need to exist when denoising is active (so any overlap
being rendered simultaneously does not write to the same memory region).
When denoising is not active they can be distributed like all other memory when peer
memory support is available.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10858
2021-03-30 14:04:56 +02:00
Ankit Meel
7fd3b07da1 Build Environment: set MAKE_THREADS as per the CPU
It is a better default.

Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10652
2021-03-30 16:42:19 +05:30
Campbell Barton
681a7d724b PyAPI: replace repr with our own escape function in animsys_refactor
Use the same string escaping logic shared by RNA path resolving code.
2021-03-30 21:57:23 +11:00
Jacques Lucke
5da5a1cc2d Geometry Nodes: support multiple group input nodes
Previously this was only supported within nested node groups.
Now it is also supported for the root node group that is referenced
by the modifier.
2021-03-30 12:34:16 +02:00
Bastien Montagne
05fa5ca337 Cleanup: Typo in comment. 2021-03-30 12:15:19 +02:00
Scott Wilson
74d5a93b2b Armature: Add Display Axis Offset
Display the bone axes at the head (root) of the bone by default, instead
of the tail (tip), and add a slider so that it's possible to adjust this
position.

Versioning code is in place to ensure existing files behave the same
(axes shown at tail), whereas new Armatures will be using the new
default (axes shown at head).

Reviewed By: #animation_rigging, #user_interface, Severin, Sybren

Differential Revision: https://developer.blender.org/D7685
2021-03-30 11:40:26 +02:00
Sybren A. Stüvel
0d65d27386 Python: clarify error message when accessing datablock by library
When using `bpy.data.actions[action_name, "nonexistant-library"]`,
use the term `filepath` instead of `name` in the error message.

Also increase the size to match the file path length.

Ref D10253
2021-03-30 19:31:50 +11:00
Henrik Dick
39bead4d51 Fix simple solidify wrong custom data on large ngons
Fixes an unreported issue that vertex data on large ngons (>255)
is messed up due to type conversion to char and back to int.

Ref D10734
2021-03-30 19:13:36 +11:00
Sybren A. Stüvel
fd10c21f51 Cleanup: animation, remove BONE_UNKEYED flag
Remove the `BONE_UNKEYED` flag. It was only written (set/cleared) but
never actually read.

Also remove `framechange_poses_clear_unkeyed()` as its only function was
to clear the `BONE_UNKEYED` flag. It wasn't used anywhere either.

The only code that used the flag was the `extract_pose_from_action()`,
which was removed in 2869ce6cfab3aa4ff471bef6e49ac6fe15426247 (2009).

No functional changes.
2021-03-30 09:46:26 +02:00
Jeroen Bakker
563d513e37 Cleanup: clang-tidy warning. 2021-03-30 08:08:43 +02:00
Jeroen Bakker
89e46f578f Cleanup: clang-tidy warning. 2021-03-30 08:08:15 +02:00
Germano Cavalcante
52d09dad9c Knife: snap refactor, prepare for snap gizmo
Minor changes preparing for snap gizmo inclusion.

- Extract `knife_snap_edge_in_angle` into a utility function.
- Check the snap vertex on closest edge instead of the face.
- Add MODE_INVOKING state.
- Remove unnecessary NULL checks.
- Control 'ignore_edge_snapping' while dragging instead of checking
  dragging in `knife_snap_update_from_mval`.

Ref D8220
2021-03-30 16:19:33 +11:00
Hans Goudey
73b5afd352 Cleanup: Fix incorrect socket list name 2021-03-29 22:41:34 -05:00
Hans Goudey
d037fef3bd Cleanup: Use float4x4 type and constructor 2021-03-29 22:15:07 -05:00
Ray Molenkamp
f9eaf93d37 MSVC: ASAN support for VS 16.9
This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

MSVC: Asan support for 16.9

This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

Differential Revision: https://developer.blender.org/D7794
Reviewed By: brecht, sergey
2021-03-29 19:11:17 -06:00
Richard Antalik
6c33d3d01b Fix T86944: Incorrect seeking in some movies
`av_seek_frame()` failed to seek to nearest I-frame. This seems to be
a bug or not implemented feature in FFmpeg. Looks like same issue as
ticket https://trac.ffmpeg.org/ticket/1607 on ffmpeg tracker.

If seeking is done using format specific function (`read_seek2`)
field of `AVInputFormat` is set, `see av_seek_frame()`, use
`av_seek_frame()` function. Otherwise use wrapper that actively searches
for I-frame packet.

Searching is flexible and tries to do minimum amount of work. Currently
it is limited to equivalent of 25 frames, which may not be enough for
some files, but there may be files with no I-frames at all, so it is
best to keep this limit as low as possible. Previously this problem was
masked by preseek, which was hard-coded to 25 frames. This was removed
in rB88604b79b7d1.

If this approach would be unnecessary for some formats, in worst case
file would be seeked 2 times which is very fast, so there will be no
visible impact on performance.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10845
2021-03-30 02:58:53 +02:00
Richard Antalik
ffbe803505 VSE: Add fit method to RNA API
Add fit_method argument to new movie and image RNA API functions.
This argument is optional.

ref T86925

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10816
2021-03-30 02:58:53 +02:00
Richard Antalik
6c6f3baaa8 VSE: Fix image adding inconsistency
When adding images with operator, image file path is split into filename
and directory passed to load function in name and path fields of
SeqLoadData struct. This is because when loading images directory
and filenames are split.

RNA API function passes whole path in path filed.

Apart from loading API inconsistency, this causes initial image loading
to fail, so strip resolution is not set. Also name field of SeqLoadData
should be reserved for strip name.

Let operator code concatenate and split filepath when needed so loading
API can be consistent with RNA API and also between strip types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10818
2021-03-30 02:58:53 +02:00
Hans Goudey
7d467915a4 Cleanup: Decrease variable scope 2021-03-29 18:48:34 -05:00
Brecht Van Lommel
91c44fe885 Cycles: disable NanoVDB for AMD OpenCL
It is causing issue with AMD OpenCL drivers, due to a potential driver bug.

Ref T84461
2021-03-30 00:00:17 +02:00
Germano Cavalcante
661e6e0966 Gizmo: Use a utility function to read snap gizmo values
No functional changes.

This makes the `ED_gizmotypes_snap_3d_update` function more specialized.
2021-03-29 14:32:48 -03:00