Commit Graph

97605 Commits

Author SHA1 Message Date
Jacques Lucke 4a5389816b Clang-Tidy: enable readability-named-parameter 2020-07-03 17:07:13 +02:00
Bastien Montagne fac2e63bc0 Fix utterly broken code regarding GPUtextures of MovieClip in readfile.c
Treat those as pure runtime code, reset to NULL by reading code, for
now.

Think those could be handled like Image gputextures (i.e. considered
runtime cache and preserved across undo steps), but probably not
critical for now.
2020-07-03 17:01:21 +02:00
Bastien Montagne 1bdabd7b4f Move MovieClip to new undo cache management system. 2020-07-03 17:01:21 +02:00
Jacques Lucke 1019c9f582 Clang-Tidy: enable bugprone-too-small-loop-variable 2020-07-03 16:54:08 +02:00
Jacques Lucke 883f9dd6e5 Clang-Tidy: enable bugprone-assert-side-effect
Looks like we have no assertions with side effects.
2020-07-03 16:48:16 +02:00
Sergey Sharybin 9739fc4d1b Clang-Tidy: More fixed of redundant check before delete
For some reason got unnoticed in the original cleanup pass.
2020-07-03 16:47:59 +02:00
Jacques Lucke 14fd91e7e8 Clang-Tidy: enable bugprone-argument-comment
It was called `inverted` in the header.
2020-07-03 16:39:06 +02:00
Hans Goudey f4fdb8efc5 Cleanup: Remove redundant logic 2020-07-03 10:38:49 -04:00
Hans Goudey f66aafa391 Fix memory leak when dragging shaderfx 2020-07-03 10:37:58 -04:00
Sergey Sharybin f891d4e2ad Clang-Tidy: Fix readability-delete-null-pointer warnings
Also enable it in the configuration.
2020-07-03 16:32:51 +02:00
Hans Goudey 53d41e1a6f UI: Use sliders and [0, 1] ranges in ocean modifier
The ocean modifier has two properties that use a [0, 10] hard min and
hard max. The values act as factors though, so it makes more sense to
use sliders and a 0 to 1 range.

This commit also bumps the file subversion to avoid repeatedly applying
the change to the properties' range.

Differential Revision: https://developer.blender.org/D8186
2020-07-03 10:28:13 -04:00
Sybren A. Stüvel 2a39b34a09 Cleanup: Editors/Sculpt/Paint, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/sculpt_paint` module.

No functional changes.
2020-07-03 16:15:01 +02:00
Sybren A. Stüvel fd5b093f84 Cleanup: Editors/Screen, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/screen` module.

No functional changes.
2020-07-03 16:15:01 +02:00
Sybren A. Stüvel 4283da83cc Cleanup: Explicit return in each `else if` block in `ed_screen_context()`
The `ed_screen_context()` function is approximately 700 lines long, and
its main structure is a huge chain of `else if` statements. Some of the
bodies did not return, but rather fell through and relied on the `return
-1;` at the bottom of the function. This means that in order to truly
understand what is going on in one of those `else if` blocks, it could
be required to scroll past all the following `else if` blocks,
double-checking that they all had an `else`, and then see what happens
below.

By adding explicit `return -1;` everywhere this happened, this is all
avoided, increasing local understandability of the code. Furthermore, it
makes the upcoming cleanup with the Clang-Tidy rule
`readability-else-after-return` a lot easier to do.

No functional changes.
2020-07-03 16:15:01 +02:00
Sybren A. Stüvel de7c9f41e6 Cleanup: Editors/Object, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/object` module.

No functional changes.
2020-07-03 16:15:01 +02:00
Sybren A. Stüvel 19483125f8 Cleanup: Editors/Mesh, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/mesh` module.

No functional changes.
2020-07-03 16:15:00 +02:00
Sybren A. Stüvel 7d0a0b8a6d Cleanup: Editors/Armature, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/armature` module.

No functional changes.
2020-07-03 16:15:00 +02:00
Sybren A. Stüvel f82e52ebc8 Cleanup: Editors/Animation, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/animation` module.

No functional changes.
2020-07-03 16:15:00 +02:00
Pablo Dobarro 17ba566018 Fix Pose Brush crashing after disabling connected only in FK mode
This function was returning the ik_chain before disabling the
fake_neighbors, so when the brush was used again with fake neighbors
disabled after rebuilding the PBVH and free them, they were still
enabled in the SculptSession, causing a the crash.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8195
2020-07-03 16:13:49 +02:00
Bastien Montagne 3a59c184b9 Move Scene's cache management during undo to new system. 2020-07-03 16:10:33 +02:00
Hans Goudey a33756d783 Cleanup: Unused variables in non-debug build 2020-07-03 10:09:19 -04:00
Hans Goudey 6a58e15548 Cleanup: Remove obsolete code in interface_panel.c
Some code delt with panel merging in earlier versions of Blender,
which is no longer needed. Other code delt with controls that aren't
used anymore, and in some cases have region-level equivalents.

There's a surprising amount of this unused code in this file, so removing it
will be helpful for the future.

Differential Revision: https://developer.blender.org/D7938
2020-07-03 10:03:16 -04:00
Jacques Lucke 88d358902f Clang-Tidy: Enable readability-redundant-string-cstr 2020-07-03 15:55:09 +02:00
Antonio Vazquez 405e6c6cc9 Fix T78555: GPencil bake animation operator loose frame setting
The values were reset for each run
2020-07-03 15:53:44 +02:00
Hans Goudey 19ff145e66 Clang-Tidy: Enable readability-redundant-control-flow 2020-07-03 09:41:55 -04:00
Sergey Sharybin ffef562bf7 Disable clang-tidy for code-generated RNA files
This needs some extra care, which is probably easier once the initial
pass over integration is done.
2020-07-03 15:33:27 +02:00
Bastien Montagne c9975088a9 Move volume to new cache management system for undo. 2020-07-03 15:28:09 +02:00
Jacques Lucke 1e255ce031 Fix T72214: Fluids: noise does not work with negative frame numbers
The issue is duplicated code. There are two functions that zero-fill
the frame number. They worked the same for positive frames numbers, but
behaved differently for negative ones.

On frame `-100`, `BLI_path_frame` outputs `-0100` and
`fluid_cache_get_framenr_formatted_$ID$` outputted `-100`.

I changed the behavior of the latter, because we depend on the behavior
of the former for much longer already.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8107
2020-07-03 15:27:02 +02:00
Jacques Lucke 2633683b52 Clang-tidy: enable readability-container-size-empty warning
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8197
2020-07-03 14:59:27 +02:00
Jacques Lucke 93da09d717 Cleanup: add const in various places 2020-07-03 14:53:06 +02:00
Sybren A. Stüvel 9dce2c9d14 Cleanup: Editors/GPencil, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/gpencil` module.

No functional changes.
2020-07-03 14:48:38 +02:00
Sybren A. Stüvel 20869065b8 Cleanup: BMesh, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/bmesh` module.

No functional changes.
2020-07-03 14:48:37 +02:00
Sybren A. Stüvel f3b8792b96 Cleanup: Interface, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/interface` module.

No functional changes.
2020-07-03 14:48:37 +02:00
Sybren A. Stüvel 86e7648f0e Cleanup: Mark overriding function with `override` keyword
No functional changes.
2020-07-03 14:48:37 +02:00
Jacques Lucke 7704e6a678 Cleanup: bring operator overloads closer together 2020-07-03 14:31:26 +02:00
Jacques Lucke 395b294b61 Cleanup: use nested namespaces 2020-07-03 14:25:20 +02:00
Jacques Lucke 5fbf70b0d0 Cleanup: use trailing underscore for non-public data members 2020-07-03 14:20:42 +02:00
Jacques Lucke d64803f63b Cleanup: Use trailing underscore for non-public data members
This makes the code conform better with our style guide.
2020-07-03 14:16:02 +02:00
Germano Cavalcante e797c4f28f Fix T78570: Vert/Edge slide doesn't adjust UVs 2020-07-03 09:01:32 -03:00
Antonio Vazquez dfbb13b593 GPencil: Cleanup more comments (cont) 2020-07-03 13:52:04 +02:00
Sergey Sharybin 6fea8ec183 Clang-Tidy: Enable redundant static qualifier warning
This change enables readability-static-definition-in-anonymous-namespace
warning in .clang-tidy configuration.
2020-07-03 12:58:13 +02:00
Bastien Montagne aab41401f9 Move bSound cache handling during undo to new system. 2020-07-03 12:56:21 +02:00
Bastien Montagne ae5529c848 Cleanup: do not use magic values for enums... 2020-07-03 12:56:21 +02:00
Bastien Montagne 8e0f8bb3e1 New undo cache management: Add Image IDs.
Some notes:
* `Image.cache` acts as some kind of 'main' cache, when it is NULL
  (could not be restored), other caches should also be cleared. Oddly
  enough, previous code was not clearing **all** caches, could not find
  any reason for that behavior, so new code does a full clear.
* `imamap` is still used for Node previews from scenes' compositor,
  however this is actually fully disabled in `direct_link_node()`.
* For render slots we cannot use offsetof as third part of the cache
  key, so we are using a hash of the slot's name instead.

As far as I can tell, this fixes T76989: Visual glitches when undo after
reload multiple images by script (in Material Preview).
2020-07-03 12:56:21 +02:00
Bastien Montagne 5fa6bd8a8d Readfile/Undo: initial refactor of cache preservation code.
Main goal here is to have better specificity using cache keys, to avoid
same memroy address being re-used messing up with cache pointers
restoration after undo had to re-read a data-block.

Once all caches handling are ported  to this new system, it should fix
random issues like the one reported in T76989.

Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
Bastien Montagne 6cb796e98e IDTypeInfo: add new callback to loop over all cache pointers of an ID.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
Bastien Montagne 5dda6cefb6 Add key structure and hashing utils for ID caches.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
Antonio Vazquez a06d95987e GPencil: Cleanup more comments (cont) 2020-07-03 12:55:47 +02:00
Antonio Vazquez 972d1700cd GPencil: Cleanup more comments (cont) 2020-07-03 12:55:47 +02:00
Brecht Van Lommel 4ccd96f1a4 Cycles: rename viewport denoise Fastest option to Automatic and extend tooltip 2020-07-03 12:36:17 +02:00