Commit Graph

107296 Commits

Author SHA1 Message Date
Brecht Van Lommel 45a47142fc Fix T89396: Cycles missing passes with multiple view layers and persistent data 2021-07-12 15:40:45 +02:00
Philipp Oeser 5f3f5db95d Cleanup: Clang format
Sorry, missed this in 53cf8e83b3.
2021-07-12 14:40:26 +02:00
Jacques Lucke 8e69409eed Fix T89775: geometry nodes logging crash during render
Under some circumstances (e.g. when rendering) the geometry
nodes logger is not used. This was missing a simple null check.
2021-07-12 14:29:28 +02:00
Julian Eisel 280dac323c Blenlib: Add BLI_assert_msg() for printing an extra string if the assert fails
It always bothered me that we'd do the `BLI_assert(... || !"message")` trick to
print a message alongside the assert, while it should be trivial to have a way
to pass an extra string as additional argument.

This adds `BLI_assert_msg()` with a second argument for a message. E.g.:
```
BLI_assert_msg(
    params->rename_id == NULL,
    "File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.");
```

On failure this will print like this:
```
0   Blender                             0x00000001140647a3 BLI_system_backtrace + 291
[...]
13  Blender                             0x00000001092647a6 main + 3814
14  libdyld.dylib                       0x00007fff203d8f5d start + 1
BLI_assert failed: source/blender/editors/space_file/file_ops.c:2352, file_directory_new_exec(), at 'params->rename_id == ((void*)0)'
  File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.
```

Reviewed by: Sybren Stüvel, Jacques Lucke, Sergey Sharybin, Campbell Barton

Differential Revision: https://developer.blender.org/D11827
2021-07-12 11:46:24 +02:00
Philipp Oeser c4f9bfcf5e Fix T89765: boolean modifier collection refcount issue
The 'collection' property is flagged PROP_ID_REFCOUNT, so the
modifiers foreachIDLink functions should walk with IDWALK_CB_USER
(instead of IDWALK_CB_NOP).

Otherwise the modifier wont be included as a user for the collection
(e.g. on file read); removing the collection from the modifier will
decrement usercount though (which in worst case scenario makes the
collection orphan and will result in data loss)

Maniphest Tasks: T89765

Differential Revision: https://developer.blender.org/D11877
2021-07-12 10:48:27 +02:00
Campbell Barton 2289e26fa3 Cleanup: correct spelling in comments, remove profanity 2021-07-11 15:31:36 +10:00
Campbell Barton 0f201049b4 Edit Mesh: tag the object data for updating instead of the object
When editing vertices with number buttons, tag the mesh, not the object.

This prevents the evaluated mesh being re-created for the object
and is correct as the mesh is being edited not the object.

Note that all tags for updating object geometry should be checked
to see if this change should be applied there too.

From a simple test on a high-poly mesh this gives around 1.3x
overall speedup.
2021-07-11 15:22:20 +10:00
YimingWu 49a363f0e0 LineArt: Fix edge type panel `use_cache` prop.
The name was mistakenly written as `use_cached_result`. Fixed.
2021-07-10 21:52:35 +08:00
YimingWu 77a28f34d5 LineArt: Fix modifier apply.
After cache implementation line art apply will not show strokes properly, now fixed.

# Conflicts:
#	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
2021-07-10 14:04:23 +08:00
Aaron Carlisle 62d9dabc7d UI: Clip: Fix checkbox wrongly greying out entire column
The Pattern and Search display options in the Clip Editor display settings
are independent and should not be grayed out since those options
remain relevant even with path display turned off.

Alternative solution were propoesed in D11630 and D11715
but each of those patches had downsides.
This solution is the simplest and does not break muscle memory.
2021-07-09 19:23:08 -04:00
Ray Molenkamp d5e91ae883 make.bat: Update detection order of MSVC
VS2019 is the preferred version to use these
days, look for it before looking for 2017
and 2022.
2021-07-09 15:17:05 -06:00
Philipp Oeser 53cf8e83b3 Fix channel packed images display in the Image/Node editor
Channel packed images should not have their RGB affected by alpha.
rendering in Cycles and Eevee was fine already, but displaying these was
not right in the Image and Node editors.

Not 100% sure what to do for the "Color and Alpha" mode, but I guess
this should stay like it was before (applying the alpha).

"Color", "R", "G", and "B" modes were changed to not have color be
affected by alpha though.

ref. T89034

Maniphest Tasks: T89034

Differential Revision: https://developer.blender.org/D11871
2021-07-09 22:00:04 +02:00
Johnny Matthews d7f88982a8 Geometry Nodes: fix direction mode in curve primitive line node
Differential Revision: https://developer.blender.org/D11872
2021-07-09 18:34:40 +02:00
Howard Trickey 4c716ced09 Fix a compiler warning on Windows for Exact Boolean.
For some reason, the Windows compiler didn't like the
static function being used in the parallel_reduece.
2021-07-09 09:29:33 -04:00
Jacques Lucke 09082f6e85 Fix: crash when using empty attribute search 2021-07-09 15:21:25 +02:00
Dalai Felinto c749c24682 Walk Navigation: Z axis correction
Fly navigation has always had this option. They is particularly useful
when users use "Trackball" as their orbit method.

For walk navigation this works as a one off option. Not as a toggle like
for fly navigation.

Differential Revision: https://developer.blender.org/D11863
2021-07-09 15:03:50 +02:00
Sybren A. Stüvel c04cceb40e Fix T89435: Reordering FCurves can cause crash or corruption
Correctly reset `prev` and `next` pointers of action group FCurves when
separating them into distinct `ListBase`s per `bActionGroup`.

These `NULL` pointers are necessary to temporarily demarcate the start &
end of the `bActionGroup::channels` list. Having them still point to
other FCurves caused ordering issues when moving curves towards the
start/end of a group.

This commit corrects the above issue and adds versioning code to rectify
any ordering issues that may have been caused. For this purpose the
`BKE_action_groups_reconstruct()` function is rewritten to avoid relying
on the `bAction::curves` list order or `prev` link integrity.

Differential Revision: https://developer.blender.org/D11811
2021-07-09 12:21:12 +03:00
Sybren A. Stüvel b69ab42982 Deps: upgrade OpenXR 1.0.14 → 1.0.17
Simple upgrade of OpenXR to 1.0.17. A version bump was enough, no
Blender code had to change.

Reviewed By: LazyDodo, mont29

Differential Revision: https://developer.blender.org/D11848
2021-07-09 11:06:40 +02:00
Sergey Sharybin 16099c00d0 Fix cycles crash when changing viewport display pass
It was possible that render buffers and scene kernel data will be out
of sync because reset and scene update happens in different locks.

This is similar issue we've fixed in the Cycles X branch, so backported
relevant changes from there.

This change removes what seems to be unused feature kernel.

Differential Revision: https://developer.blender.org/D11828
2021-07-09 10:43:47 +02:00
Sergey Sharybin 8dd941cac0 Tracking: Fix "Lock to Selection" option from header causing jump
This change makes the behavior consistent between shortcut and
option from space clip's header.

The only caveat is that the "Lock to Selection" is removed from the
Display popover. This is because it is rather hard to make operator
to render same as regular checkbox. However, shouldn't be a problem
because the setting in popover was redundant.

Differential Revision: https://developer.blender.org/D10423
2021-07-09 10:37:36 +02:00
Dalai Felinto 249a7e2307 Cleanup: Walk Navigation define remame
WALK_MODAL_TOGGLE > WALK_MODAL_GRAVITY_TOGGLE
2021-07-09 10:27:29 +02:00
Dalai Felinto 8225b610dd Fix typo in Fly mode tooltip
The bug was always around and was introduced with the original code
e2a7168e96 (2009).
2021-07-09 10:21:02 +02:00
Lukas Tönne 07faa3c5ac Nodes: Moved group interface panel code to python.
The node group interface panels were still implemented in C.
Now they ported over to python for easier maintenance.

Differential Revision: https://developer.blender.org/D11834
2021-07-09 07:57:29 +01:00
Philipp Oeser d0c5c67e94 Make Single User: support object data animation
In addition to _object_ animation, now _object data_ (mesh, curve, ...)
animation can now be made single user as well.

This came up in T89369 and while it is possible to do this via the
Outliner [where all actions have to be selected individually], this
seems to be more convenient to be done from the 3DView.

note: usercount of the action is checked now, if it single-user already,
no copy takes place (same thing could/should be done for
single_object_action_users as well).

note2: obdata is made single user as well (otherwise duplicated actions
will be assigned to the same shared obdata - which does not result in
unique animadata which is what we are after here)

ref. T89369

Maniphest Tasks: T89369

Differential Revision: https://developer.blender.org/D11683
2021-07-09 08:09:43 +02:00
Campbell Barton 0416aa767f Cleanup: use 'uint' for BLI_array 2021-07-09 13:37:52 +10:00
Campbell Barton 7592a5097c BLI_array: add BLI_array_deduplicate_ordered utility & tests 2021-07-09 13:35:54 +10:00
Campbell Barton ab70133db0 Cleanup: rename BKE_animdata_{add=>ensure}_id
Use the term `ensure` as existing data is used when present.
2021-07-09 11:53:16 +10:00
Jacques Lucke af8fb707da BLI: avoid calling deleted copy constructor in some compilers
Previously, this did not compile in VS 2017, because
`new T(initializer_())` would try to call the copy constructor of `T`.

Now, `initializer_` will construct the `T` inplace.
2021-07-08 19:54:09 +02:00
Pratik Borhade 4e5537d0ed Fix T89169: Rename Compositor Node "View Switch" to "Switch View" in search panel
Renaming compositor node in search panel "View Switch" to "Switch View"
for better consistency.

Reviewed By: dfelinto

Differential Revision: https://developer.blender.org/D11717
2021-07-08 14:59:26 +02:00
Julian Eisel 80d0b68290 GPencil: Support camera "Frame Selected" and object previews
Using the "Camera Fit Frame to Selected" operator didn't work for Grease Pencil
objects. The same issue caused grease pencil preview thumbnails to be useless
(e.g. when using "Mark Asset" on a Grease Pencil object).
Reason was that there was no logic to handle grease pencil data and its strokes
for the object display-point iterators used for the "Frame Selected" logic.

Addresses T89656.

Reviewed by: Antonio Vazquez, Campbell Barton

Differential Revision: https://developer.blender.org/D11833
2021-07-08 14:20:14 +02:00
Jacques Lucke 5d54f38949 Fix: instances are made real when they shouldn't be
The original assumption that the `modifyMesh` function is only
called when the modifier is applied was wrong. There are still a
couple of other places calling it through `BKE_modifier_modify_mesh`.

Now there is an extra check that makes sure instances are only
realized when the modifier is actually applied.
2021-07-08 13:11:21 +02:00
Julian Eisel c304807099 Fix compositor backdrop gizmo refresh problem when toggling sidebar
The backdrop image gizmo was not following the backdrop image, it
needs to be refreshed whenever the view changes. The region init
callback is executed whenever the region size changes, so that should be
a reliable place to do that.

Reported as part of T87591.
2021-07-08 13:08:10 +02:00
Sybren A. Stüvel 4c8a8950cf Cleanup: remove trailing spaces from `install_deps.sh`
No functional changes.
2021-07-08 11:38:48 +02:00
Philipp Oeser b6a35a8153 Outliner: use 'compacted' row for bones as well
In a collapsed hierarchy, some type of data are listed as one icon per
item (2.79 did this for all data),
others are 'compacted' as a single icon with a counter (also indicating
if the active item is down that collapsed hierarchy) from 2.80 on.

Not quite sure if {rB92dfc8f2673e} was meant to do this (if it was, this
was not working though because relevant code would only get executed for
object hierarchies it seems), so now this is done for bones as well.

Fixes T88413.

Maniphest Tasks: T88413

Differential Revision: https://developer.blender.org/D11404
2021-07-08 10:41:38 +02:00
Campbell Barton 7489427e4d Cleanup: spelling 2021-07-08 13:31:38 +10:00
Campbell Barton c3cb565250 CMake: add missing headers, sort file lists 2021-07-08 13:21:22 +10:00
Campbell Barton 8346417d09 Fix crash displaying the sequencer without a valid 'scene->ed'
Regression in 45d54ea67f
2021-07-08 10:15:03 +10:00
nutti 695e025c82 Docs: Fix minor incorrect syntax errors
This patch fixes the incorrect syntax in documentations.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D11822
2021-07-07 19:41:46 -04:00
Nicholas Rishel 51019fbfce Cleanup: Consolidate tablet walk mode rotate factors.
Walk rotate speed for tablets was being modified at runtime by scaling
the user preference mouse_speed by a constant factor; this consolidates
scaling into the the compile time tablet scale factor in walkApply.

No change in behavior.
2021-07-07 16:33:50 -07:00
Julian Eisel 139c3f791e Cleanup: Remove wrong File Browser comment
Accidentally included this in rB01e1944cd455, it came from a merge
conflict.
2021-07-07 19:49:28 +02:00
Julian Eisel 54fa5041e2 Cleanup: Correct comment in earlier commit (f4cb3ccd9c)
Comment was based on an older version of the patch.
2021-07-07 19:38:37 +02:00
Julian Eisel 2b41b2f05b Cleanup: Code-style correction in Ghost (Clang-format) 2021-07-07 19:26:47 +02:00
Julian Eisel f4cb3ccd9c Assets: Keep assets active after renaming, ensure they are scrolled into view
When renaming an ID somewhere in the UI after marking it as asset, it would
often get lost in the Asset Browser (scrolled out of view). It would also get
deactivated.
This patch makes sure that if an asset is active whose ID gets renamed, it is
kept active and visible. That is important for a fast, uninterrupted asset
creation workflow, where users often rename assets while working in the asset
browser.

Old code stored the new file-name to identify a file after re-reading the
file-list after the rename. For assets that doesn't work because there may be
multiple assets with the same name. Here the simple solution of just storing
the pointer to the renamed ID is chosen, rather than relying on the file-name
in this case. (Should be fine with undo, since the ID * reference is short
lived, it's not stored over possible undo steps. If it turns out to have
issues, I rather switch to a rename_id_uuid, but keep that separate from the
file->uid).

Reviewed by: Sybren Stüvel

Differential Revision: https://developer.blender.org/D11119
2021-07-07 19:24:06 +02:00
Ray Molenkamp fb98f22ddd MSVC: Fix build issue with TBB
TBB includes in windows.h which will by
default define min/max macro's by default,
which collide with stl's min/mac functions.

this change instructs windows.h not to
add the offending macros
2021-07-07 10:55:27 -06:00
Julian Eisel 6b0869039a File Browser: Select files and directories after renaming
(Note: This is an alternative version for D9994 by @Schiette. The commit
message is based on his description.)

Currently, when a new directory is created it is not selected.
Similarly, when renaming an existing file or directory, it does not
remain active/highlighted blue after renaming.

This change makes sure the file or directory is always selected after
renaming, even if the renaming failed or was cancelled.
This has some usability advantages:
 - Open the newly created directory without having to select it (ENTER).
 - If you make a naming mistake, you can immediately fix that (F2)
   without having to click it again.
 - If you create a directory and forget to name it, you can fix that
   (F2) without having to select it.
 - This is consistent with many common File Browsers.

Further, selecting the item even after renaming failed or was cancelled
helps keeping the file in focus, so the user doesn't have to look for it
(especially if the renaming just failed which the user may not notice).
In other words, it avoids disorienting the user.

Also see D11119 which requires this behavior.

We could also always select the file/directory on mouse press. This
would make some hacks unnecessary, but may have further implications. I
think eventually that's what we should do though.
2021-07-07 18:41:27 +02:00
Julian Eisel 13672f8b32 Cleanup: Move file deselection function to more appropriate file
`filesel.c` seems like the place that should contain file selection
functions. Previously it was in `file_ops.c` because that was the only
file that actually used it. But a followup commit needs it from a
different file.
2021-07-07 18:41:27 +02:00
Sergey Sharybin cffbfe5568 Fix crash accessing sequencer strips
Was caused by recent clange sequences_all iterator in RNA (D11793).
2021-07-07 14:22:52 +02:00
Christian Rauch ecbf838fee Cleanup: comment on source of button event codes 2021-07-07 13:21:57 +01:00
Jacques Lucke 0153e99780 Geometry Nodes: refactor logging during geometry nodes evaluation
Many ui features for geometry nodes need access to information generated
during evaluation:
* Node warnings.
* Attribute search.
* Viewer node.
* Socket inspection (not in master yet).

The way we logged the required information before had some disadvantages:
* Viewer node used a completely separate system from node warnings and
  attribute search.
* Most of the context of logged information is lost when e.g. the same node
  group is used multiple times.
* A global lock was needed every time something is logged.

This new implementation solves these problems:
* All four mentioned ui features use the same underlying logging system.
* All context information for logged values is kept intact.
* Every thread has its own local logger. The logged informatiton is combined
  in the end.

Differential Revision: https://developer.blender.org/D11785
2021-07-07 11:20:19 +02:00
Jacques Lucke 77834aff22 Fix T89397: animation in geometry nodes modifier does not update
The geometry nodes modifier uses id properties for the inputs to node groups.
That is because the set of properties changes depending on which geometry
node group is selected.

The animation was not updated correctly because the `ANIMATION_EVAL`
depsgraph node was not evaluated, because nothing depended on it in the
depsgraph. This patch makes sure that the proper link to the geometry
component is inserted.

Differential Revision: https://developer.blender.org/D11831
2021-07-07 10:56:45 +02:00