Commit Graph

82904 Commits

Author SHA1 Message Date
Sergey Sharybin
b4dca4ea2c Cleanup: Use raw string literal
Resolves modernize-raw-string-literal Clang-Tidy warning

The way warning works is it suggests to use raw literal when
overhead of having escape characters is higher than the overhead
of having raw literal syntax (talking about code size overhead).
This means that the warning will not trigger for "foo\"bar".

Differential Revision: https://developer.blender.org/D10322
2021-02-05 16:43:23 +01:00
Sergey Sharybin
5ec4ba8080 Cleanup: Use lambda instead of function bind
More detailed explanation why it is a preferred way of coding
nowadays can be found at

https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-bind.html

Resolves modernize-avoid-bind Clang-Tidy warning.

Differential Revision: https://developer.blender.org/D10320
2021-02-05 16:43:23 +01:00
Jacques Lucke
a0867f05a4 DNA: support structs with a size of 1 or 2 bytes.
Before the smallest possible dna struct size was 4 bytes.

Differential Revision: https://developer.blender.org/D10287
2021-02-05 16:24:46 +01:00
Richard Antalik
66923031e6 Cleanup: Minimize seq->tmp usage
Using this persistent field in `select_more_less_seq__internal` was
inapropriate in this case.

Split select more/less and linked code, because it was mixed in
`select_more_less_seq__internal()`
These operators work in completely different way.
`select_linked_internal()` doesn't use seq->tmp at all.

`seq->tmp` was used to mask strips selected by operator while iterating.
Use GSet to store temporary data instead of `seq->tmp`.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10326
2021-02-05 16:21:58 +01:00
Jacques Lucke
16abe9343a Geometry Nodes: add Volume to Mesh node
This node takes a volume and generates a mesh on it's "surface".
The surface is defined by a threshold value.

Currently, the node only works on volumes generated by the
Points to Volume node. This limitation will be resolved soonish.

Ref T84605.

Differential Revision: https://developer.blender.org/D10243
2021-02-05 16:20:14 +01:00
Jacques Lucke
46e0efb462 Geometry Nodes: support fixed pivot axis in Align Rotation to Vector node
When the pivot axis is not set to auto, the node will try to align the rotation
to vector as best as possible, given the selected rotation axis.

Ref T85211.

Differential Revision: https://developer.blender.org/D10292
2021-02-05 16:10:54 +01:00
Sergey Sharybin
56903024dc Cleanup: Use transparent functor
Resolves modernize-use-transparent-functors Clang-Tidy warning.

Differential Revision: https://developer.blender.org/D10323
2021-02-05 15:39:50 +01:00
Victor-Louis De Gusseme
4d39a0f8eb Geometry Nodes: Add Attribute Proximity Node
This node calculates a distance from each point to the closest position
on a target geometry, similar to the vertex weight proximity modifier.
Mapping the output distance to a different range can be done with an
attribute math node after this node.

A drop-down changes whether to calculate distances from points,
edges, or faces. In points mode, the node also calculates distances
from point cloud points.

Design task and use cases: T84842

Differential Revision: https://developer.blender.org/D10154
2021-02-05 08:28:31 -06:00
Ankit Meel
7054d03701 Cleanup: Clang-tidy modernize-use-default-member-init
Using assignment syntax as we don't use `{}` initialization yet.

Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9501
2021-02-05 19:09:36 +05:30
Jeroen Bakker
6b4cd92e4d Merge branch 'blender-v2.92-release' 2021-02-05 13:07:14 +01:00
Jeroen Bakker
4212ea7b7d Fix T85260: Viewport render does not draw background
Regression introduced by {rBed809866b172} where overlays weren't drawn
when overlays are turned off. The background in wireframe, solid
(always) and material preview and render preview (when not using scene
world) are also part of the overlays.
2021-02-05 13:05:58 +01:00
Philipp Oeser
8c0b0b7c96 Merge branch 'blender-v2.92-release' 2021-02-05 12:46:42 +01:00
Philipp Oeser
0a546beb1f Fix T85396: Display Texture Paint UV only working in editmode
Caused by rBf83aa830cd00.

Since above commit, only meshes in editmode were considered for drawing
(because
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs was
used), but the option needs to work for texture paint mode as well, so
use BKE_view_layer_array_from_objects_in_mode_unique_data instead on
pass the draw_ctx->object_mode.

note: there is no good filter_fn to check if we have UVs if mesh is not
in editmode, this shouldnt cause much of a performance hit though.

Maniphest Tasks: T85396

Differential Revision: https://developer.blender.org/D10319
2021-02-05 12:43:00 +01:00
Campbell Barton
606805d1b7 Cleanup: use 'r_' prefix for return arguments, order last 2021-02-05 22:34:03 +11:00
Campbell Barton
f8cbd333d6 Cleanup: outdated/unhelpful comments 2021-02-05 22:33:27 +11:00
Richard Antalik
f21b4e69b0 Fix T82973: Strips overlap after transforming
When transforming multiple strips to limits of sequencer timeline they get
squashed into one channel.

Store selection minimum and maximum channel in TransSeq and limit
transformation so no strip can be transformed beyond timeline boundary.

Reviewed By: Sergey, mano-wii

Differential Revision: https://developer.blender.org/D10013
2021-02-05 10:40:35 +01:00
Julian Eisel
fa96aa5811 Fix missing preview images for actions when browsing in external files
When reading the preview images of external .blend files, action data-blocks
were not handled.
Preview support for actions was added in 2397ccc583af.
2021-02-05 11:28:34 +01:00
Sergey Sharybin
db40d5ed97 Cleanup: Modernize type definition in Alembic
Use newer `using` semantic for type definition.
Solves modernize-use-using Clang-Tidy warning.
2021-02-05 11:04:28 +01:00
Sergey Sharybin
b6921506c9 Fix integer types in ImBuf leading to warnings
Replace `long long` with an explicit `int64_t`. This is also what is
used in the FFmpeg headers.

Fixes clang diagnostics warning about wrong format used in the log.

Should be no functional changes.
2021-02-05 10:58:44 +01:00
Campbell Barton
38420f19b6 Cleanup: rename USER_ZOOM_{CONT->CONTINUE} improve comments
USER_ZOOM_CONT only had comments saying this was 'oldstyle',
remove these comments, add brief explanations of the zoom style
in the enum.
2021-02-05 17:04:14 +11:00
Campbell Barton
f2bf5acd58 Keymap: use Shift-Tab to cycle backwards over edit-buttons
All modifiers were being checked, a hang-over from 2.4x
where this checked the modifier flag was non-zero.
2021-02-05 16:44:42 +11:00
Campbell Barton
d975e19583 Cleanup: correct spelling in code 2021-02-05 16:30:49 +11:00
Campbell Barton
17e1e2bfd8 Cleanup: correct spelling in comments 2021-02-05 16:23:34 +11:00
Campbell Barton
b62b923f54 Cleanup: replace inline loops with RNA_enum_from_identifier 2021-02-05 09:45:17 +11:00
Campbell Barton
7e850ffa73 Cleanup: cmake indentation, white-space 2021-02-05 09:45:16 +11:00
Bastien Montagne
94cf74afbb Cleanup/refactor: Undosys: Get rid of the magic values for undo direction.
Move `eUndoStepDir` to `BKE_undo_system.h` and use its values
everywhere.

Note that this also introduce the `STEP_INVALID` value in that enum.

Finally, kept the matching struct members in some lower-level readfile
code as an `int` to avoid having to include `BKE_undo_system.h` in a lot
of unrelated files.
2021-02-04 22:03:39 +01:00
Bastien Montagne
7d5640ee10 LibOverride: Improve/Fix issues in override resync process.
When we have a local override, its linked reference may not be detected
as needing to be overridden anymore.

In that case, if there is no actual override defined by the user, assume
that we can get rid of this local override as part of the resync
process, and use the linked data directly instead.
2021-02-04 19:23:10 +01:00
0f893656f4 Fix T85356: Dope Sheet not showing keyframes of Geometry Nodes graph
The animation filter wasn't following ID pointers to Node Trees yet.
2021-02-04 18:56:41 +01:00
2397ccc583 Animation: Add PreviewImage to bAction struct
Make it possible to attach a preview image to an Action.

In the #asset_browser_pose_libraries project, poses will be stored as
individual Action datablocks. Having a thumbnail for each pose is of
course essential.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10306
2021-02-04 18:56:41 +01:00
Jacques Lucke
e7af04db07 Geometry Nodes: new Is Viewport node
This node outputs true when geometry nodes is currently evaluated
for the viewport and false for final renders.

Ref T85277.

Differential Revision: https://developer.blender.org/D10302
2021-02-04 16:36:34 +01:00
Bastien Montagne
95703d19e0 Liboverride: clean-up/sanitize tagging of root overrides.
now do this in utils that also handle the hierarchy tagging, doing it in
caller code is prone to errors.

Issue reported by @sebbas, thanks.
2021-02-04 16:15:16 +01:00
Sebastián Barschkis
07f7483296 LibOverride: Added log statements in liboverride operator functions
As discussed in D10301.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10303
2021-02-04 15:11:42 +01:00
Sebastián Barschkis
bd973dbc44 LibOverride: Only show relevant operators in outliner menu
No need to show certain operators when they have no functionality.

For example, when adding a library override from the outliner menu, there should only be an option to add one (i.e. reset, delete, resync operators not relevant for objects without library override).

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10301
2021-02-04 15:09:12 +01:00
Germano Cavalcante
4ef8033116 Merge branch 'blender-v2.92-release' 2021-02-04 10:50:43 -03:00
Germano Cavalcante
760a16b88b Fix for 3D view transform: flipped rotation direction for numeric input
The rotation direction was flipped recently.

This meant that rotation on a single axis gave negative results compared
with previous Blender releases.

This partially reverts a9b53daf23ba8b6cb4c930e06154ffd35522b00d.

Differential Revision: https://developer.blender.org/D10299
2021-02-04 10:43:57 -03:00
Johannes Jakob
bec08621d6 Fix T85363: Cmd + Tab shortcut overridden on macOS
Adds an exception so that the key-binding `control + Tab` does not get
duplicated as `command + Tab` on macOS because this is a global system
shortcut for the app switcher.

The key-binding `command + Tab` was shown for the operators “Toggle
Graph Editor“ and “Toggle Dope Sheet” in Dope Sheet and Graph Editor,
but only `control + Tab` actually worked.

Differential Revision: https://developer.blender.org/D10304
2021-02-04 14:27:44 +01:00
Campbell Barton
3be5859b21 Cleanup: pass keymap items as const where possible 2021-02-04 22:21:10 +11:00
Jacques Lucke
dff51d418a Fix: window manager can reference scenes and workspaces
This also fixes T83592 for me.

Differential Revision: https://developer.blender.org/D10046
2021-02-04 11:31:01 +01:00
Campbell Barton
4895d1f9ce Cleanup: replace '_imp' function suffix with '_impl'
Use the more common abbreviation for `implementation`.
2021-02-04 13:10:29 +11:00
Campbell Barton
54cb9e1d79 PyAPI: correct docstring 2021-02-04 13:10:29 +11:00
Harley Acheson
492e64c7bc UI: Win32 Child Windows On Top
Win32 child windows on top of parents. Short-term solution of forcing is_dialog when owned.

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

Reviewed by Brecht Van Lommel
2021-02-03 17:51:19 -08:00
Nathan Craddock
01d49d1542 Presets: Cleanup preset naming
Before committing D10224, bundled preset names that are lowercase need
updating to title case for display in the UI. This changes several of
the preset file names to title case, and fixes a couple of other naming
issues in the preset names. A few strings in the code are also changed
to reflect the new filename of the Blender keymap.
2021-02-03 17:34:27 -07:00
Campbell Barton
d30320b4f5 Merge branch 'blender-v2.92-release' 2021-02-04 11:22:11 +11:00
Campbell Barton
3f90c11621 Fix T85318: Driver variable don't resolve collection indices
The driver variable `splines[0]` (on a curve)
behaved as if the path was `splines`.

Resolve pointers was well as properties as it's supported by the caller.

Error in original commit that added property support
82b0a9e36900c8aeb374078bd4cb3a7d7f8295e6.
2021-02-04 11:19:09 +11:00
Campbell Barton
d85c5accec Cleanup: unused function warning 2021-02-04 10:01:19 +11:00
Wayde Moss
0352546cdd NLA: Fix nlasnapshot_blend() Misplaced Null Check
From original commit: rB40b7929cc040
2021-02-03 17:35:21 -05:00
Wayde Moss
40b7929cc0 NLA: Extract nlasnapshot_blend()
Refactor
//nlastrip_evaluate_actionclip()// and //nlaeval_blend_value()// into
//nlasnapshot_blend()//, //nlastrip_evaluate_actionclip()//,
//nlasnapshot_from_action()//.

**Motivations**:
* {T83615} Requires reading all pose bone fcurves before being able to
apply pre-blend transforms. The function //nlasnapshot_from_action()//
achieves this. This effectively removed the need to specially handle
Quaternion blend queuing so that code has been removed.

* {D8296} Adds support for keyframe remapping through an upper stack of
strips. Instead of introducing a variant of the form:
//nlastrip_evaluate_actionclip_inverted_get_lower()//,
//nlastrip_evaluate_actionclip()// will later be extended to take an
`evaluation_mode` as input to avoid duplicating the recursion functions
related to //nlastrip_evaluate()//.

* //nlasnapshot_blend()// will eventually have variants of
//nlasnapshot_blend_get_inverted_lower_snapshot()// and
//nlasnapshot_blend_get_inverted_upper_snapshot()// which are all
independent of NlaStrips and NlaTracks, further simplifying the
blending implementation. Ideally, //nlastrip_evaluate()// would get
renamed to //nlasnapshot_blend_strip()// but that'll be a later patch
to avoid unnecessary patches slowing the review of more important
patches.

No User-side Functional changes

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10220
2021-02-03 16:45:53 -05:00
Wayde Moss
264af1519e NLA: Fix Strip Truncate When Next to Transition
**Problem**:
Translating a strip will truncate it when next to a transition.

**Solution**:
The code only accounted for the prev/next strip for whether it exceeds.
When it was a transition, the exceed logic fails. Now, we use the
nearest non-transition strip instead.

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10083
2021-02-03 16:19:07 -05:00
Pablo Dobarro
70371299ae Merge branch 'blender-v2.92-release' 2021-02-03 21:06:56 +01:00
Pablo Dobarro
ebd2aa789e Fix T85230: Face Set Boundary automasking not working with dyntopo
Dyntopo does not have Face Sets implemented yet, so the entire mesh is
considered a single Face Set. In that case, the check unique face set
function should always return true.

Reviewed By: JacquesLucke

Maniphest Tasks: T85230

Differential Revision: https://developer.blender.org/D10259
2021-02-03 21:05:48 +01:00