Commit Graph

109606 Commits

Author SHA1 Message Date
Pablo Vazquez 0a63297a88 Nodes: Fix missing variable 2021-10-21 21:22:43 +02:00
Pablo Vazquez 9b1b4b9e32 Node Editor: Introduce color overlay and dashed wires theme setting
This patch includes code from D9891 and D12754, so credit goes to Juanfran and Dalai.
I updated the patches to work with `master` and with the new overlay toggle.

The reason to include both changes as part of one patch is that the dimmed dashed lines work much better together with colored wires.

Theme setting for dash opacity:
{F11370574, size=full}

{F11286177, size=full, autoplay, loop}

{F11149912, size=full}

For adding the overlay I used `SpaceImageOverlay` as reference, although I'm not familiar with this code so there might be mistakes.

Reviewed By: #user_interface, HooglyBoogly

Differential Revision: https://developer.blender.org/D12886
2021-10-21 21:00:38 +02:00
Hans Goudey 1d96a48267 Geometry Nodes: Attribute search in the modifier
This adds attribute search to the geometry nodes modifier
for the input and output attributes. The "New" search item
is only shown for the output attributes.

Some of the attribute search code is extracted to a new file
in the interface code, to avoid some code duplication.

The UI code required two fixes so that the search would work
for dynamic length strings (IDProperties do not have a fixed size).

Since this does changes to the UI layout of the modifier, I also
addressed T91485 here.

Differential Revisiion: https://developer.blender.org/D12788
2021-10-21 13:54:48 -05:00
Harley Acheson 65490e6270 Fix T92371: Move AZONE_REGION When Overlapped
Overlapped regions have transparent backgrounds, so when placing
AZONE_REGION we need to move them in to the content edge.

See D12956 for details and examples.

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

Reviewed by Hans Goudey
2021-10-21 11:17:38 -07:00
Hans Goudey 3858bf5c6f Cleanup: Use common define for menu separator arrow 2021-10-21 12:52:08 -05:00
Hans Goudey 7b9319adf9 Geometry Nodes: Update bounding box to work on individual instances
This commit makes the bounding box node work on each unique geometry
(including instances) individually instead of making one large bounding
box for everything. This makes the node much faster, and is often the
desired result anyway. For the old behavior, a realize instances node
can be used in front of this node (versioning adds it automatically).

The min and max outputs now only output the values from the realized
geometry.

Differential Revision: https://developer.blender.org/D12951
2021-10-21 11:51:56 -05:00
Alexander Gavrilov deb7ec312a Suppress the unused parameter warning from D9551.
The parameter is only used in an assert.
2021-10-21 19:27:30 +03:00
Julian Eisel 594c857f65 Fix tooltip disabled hint not using correct context from the button
To display the "disabled hint" (text explaining why a button is disabled) in a
tooltip, it would run the operator poll callback, which could then set a poll
message. But the context for the poll check wasn't the one from the button, so
the poll may give a different result (and disabled hint) than the check of the
button itself did.
Make sure it uses the exact context from the button.
2021-10-21 16:36:35 +02:00
Sybren A. Stüvel 16c79d3b82 Asset Catalogs: add test for backslashed catalog paths
No functional changes necessary, test already succeeds.
2021-10-21 16:23:56 +02:00
Hans Goudey ff46afb4dd Fix: Curve trim crash on splines with no edges 2021-10-21 09:16:58 -05:00
Sybren A. Stüvel 4b48b1079d Asset Catalogs: refresh simple name when renaming catalog
When renaming an asset catalog, also update its simple name.

Catalogs will most likely be created from within Blender, so via the
catalog tree in the asset browser. Here catalogs are always named
"Catalog" until the user renames them, which was reflected in all simple
names being "Catalog".
2021-10-21 16:06:14 +02:00
Sybren A. Stüvel 5ccec8ec6b Asset Catalogs: treat first-loaded catalog as main catalog
When there are multiple catalogs with the same path (so different UUIDs
all mapped to the same catalog path), treat the first-loaded one as the
main catalog for that path, and the rest as aliases.

This ensures that the UUID of a catalog (as chosen in the tree UI and thus
interacted with by users) is stable, regardless of whether by some coincidence
later another catalog with the same UUID is created.
2021-10-21 15:53:16 +02:00
Sybren A. Stüvel 9a1fce698b Cleanup: rename & restructure `AssetCatalogPathCmp`
Rename `AssetCatalogPathCmp` to `AssetCatalogLessThan`:
- it compares more than paths (so no more `Path` in the name), and
- performs a less-than operation (so no more `Cmp` in the name).

Also restructure its code to make an extra upcoming comparison easier to
add.

No functional changes.
2021-10-21 15:53:16 +02:00
Jacques Lucke 090be2775e Geometry Nodes: fix force-computing multiple non-output sockets
There were some issues when multiple inputs of the same node
were forced to be computed (e.g. for the spreadsheet), but none
of the node outputs (if existant) were used. Essentially the node
was marked as "finished" too early in this case.

This fix is necessary for the improved viewer node (T92167).
2021-10-21 15:50:04 +02:00
Jacques Lucke 6600ae3aa7 Nodes: add utility to find NodeRef for node
In the future `NodeTreeRef` could have a lazy initialized map,
but for now this is good enough.
2021-10-21 15:50:04 +02:00
Brecht Van Lommel df00463764 Cycles: add shadow path compaction for GPU rendering
Similar to main path compaction that happens before adding work tiles, this
compacts shadow paths before launching kernels that may add shadow paths.

Only do it when more than 50% of space is wasted.

It's not a clear win in all scenes, some are up to 1.5% slower. Likely caused
by different order of scheduling kernels having an unpredictable performance
impact. Still feels like compaction is just the right thing to avoid cases
where a few shadow paths can hold up a lot of main paths.

Differential Revision: https://developer.blender.org/D12944
2021-10-21 15:38:03 +02:00
Ray Molenkamp fd560ef2af Windows: Fix finding python for build helpers
It was still looking for the 3.7 folder
rather than 3.9
2021-10-21 07:36:21 -06:00
Bastien Montagne 7681326acd IDManagement: Assign current Main's lib to newly created IDs.
This is mainly for doversion code, when it needs to create new IDs those
should be considered as part of the same library as the current Main's
one.

No practical changes are expected here, this is more of a general
consistency fix, and a pre-requisite for {T92333}.
2021-10-21 15:22:35 +02:00
Sebastian Parborg 10fb5cc58d Fix T92355: Quadriflow crashes with zero length edges
Add a check for zero length edges to the manifold check as quadriflow
doesn't handle meshes with these.
2021-10-21 15:15:29 +02:00
Philipp Oeser 91b4c1841a Fix T92272: Rigid Body Copy to Selected "Margin" crash
Caused by {rB43167a2c251b}

Code from above commit called RNA updates with a NULL scene.
This was already commented (and mostly handled) in rB5949d598bc33, but
the reported case was missing in that commit.

This fixes the crash in a similar manner as rB5949d598bc33.

Maniphest Tasks: T92272

Differential Revision: https://developer.blender.org/D12953
2021-10-21 14:40:04 +02:00
Philipp Oeser ab0195c78f Fix T92169: "View Selected" on Custom Boneshape with transform wrong
Since the introduction in rBfc5bf09fd88c, `BKE_pose_minmax` was not
taking these custom transforms into account (making "View Selected"
ignoring these as well and focusing on the bone instead).

Now consider these transforms in `BKE_pose_minmax`.

Maniphest Tasks: T92169

Differential Revision: https://developer.blender.org/D12942
2021-10-21 14:39:42 +02:00
Sybren A. Stüvel a5917175d8 Deps: Python, bundle zstandard package
This package allows Python scripts to handle compressed blend files (see
rB2ea66af742bc). This is for example needed by Blender Asset Tracer to
send files to a Flamenco render farm.

This change includes a new `WITH_PYTHON_INSTALL_ZSTANDARD` build-time
option, to control whether to actually install the package. For this the
already-existing approach for Requests was copied.

Reviewed By: LazyDodo, mont29, brecht

Differential Revision: https://developer.blender.org/D12777
2021-10-21 13:46:33 +02:00
Sybren A. Stüvel 417ce7ffc1 Deps: Python, bump bundled packages to their latest versions
certifi : 2020.12.5 → 2021.10.8
chardet : 4.0.0     → charset-normalizer 2.0.6
cython  : 0.29.21   → 0.29.24
idna    : 2.10      → 3.2
numpy   : 1.19.5    → 1.21.2 (which makes it possible to remove our patch)
requests: 2.25.1    → 2.26.0
urllib3 : 1.26.3    → 1.26.7

Nowadays `requests` no longer depends on `chardet` but on
`charset-normalizer`. That project describes itself as:

> A library that helps you read text from an unknown charset encoding.
> Motivated by chardet, I'm trying to resolve the issue by taking a new
> approach. All IANA character set names for which the Python core library
> provides codecs are supported.

Reviewed By: LazyDodo, mont29, brecht

Differential Revision: https://developer.blender.org/D12777
2021-10-21 13:46:28 +02:00
Sybren A. Stüvel f81f56751a Deps: Bump Python 3.9.2 → 3.9.7
Bump Python from 3.9.2 to 3.9.7, which is the latest 3.9 release at this
moment.

Updates to bundled Python packages will follow in a separate commit.

Reviewed By: LazyDodo, mont29, brecht

Differential Revision: https://developer.blender.org/D12777
2021-10-21 13:46:16 +02:00
Brecht Van Lommel 39810b3f51 Cleanup: make HIP and CUDA code more consistent
Ref D12834
2021-10-21 13:08:10 +02:00
Yevgeny Makarov 6ef8c9e646 Fix T65532: can't assign a key on Italian apple keyboards.
Apple's international keyboards have an additional `kVK_ISO_Section`
key. With some (Italian, Spanish) keyboard layouts, this is `\`, `[` keys
which Blender keymap can use.

Right now this key is explicitly set as `Unknown`.

Note that `kVK_ANSI_Grave` is located in a different location.

Differential Revision: https://developer.blender.org/D12905
2021-10-21 13:07:05 +02:00
Brecht Van Lommel f6af3d9197 Build: remove cmake messages about disabled tests when feature is disabled
No need to report this, it just adds noise to the cmake config. The messages
that we need to keep are the ones about disabling tests when the test file or
idiff are missing.
2021-10-21 13:06:57 +02:00
Bastien Montagne 641a5be50e IDManagement: Add option to clear asset data when making ID local.
When appending an asset from the asset browser, its asset data needs to
be cleared.

However, linking an asset (or regular append from the file browser)
should not clear such data. In linking case, it would be there again
after a blend file reload anyway.

So this commit introduces a new `BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR`
option.

NOTE: in case the appended ID needs to be copied from its linked data
(instead of making the later directly local), asset data is lost anyway
since it is never copied with the ID currently.

Ref. {T91749} and D11768.
2021-10-21 12:55:15 +02:00
Sergey Sharybin 17a96051cf Re-bundle Libmv to ensure it is in sync with the repo 2021-10-21 12:39:28 +02:00
Dalai Felinto 84bb6d7c02 UI: Header / Tool Settings: Show tool icon when tools are collapsed
Show the scaled down tool icon when the tool region is collapsed. Show a
blank space when the tool region is visible.

* Minimize the UI flickering when changing the active tool.
* Show the active tool when the tool region is collapsed.
* Smaler header footprint (the tool name is not visible).

This is a follow up for T91536.

Differential Revision: https://developer.blender.org/D12939
2021-10-21 12:12:05 +02:00
Jacques Lucke e79e86018e Fix T92387: crash in legacy point distribute node
This was caused by rB40c3b8836b7a36303ea9c78b0932758cbf277f93.
The same fix exists in the Distribute Points on Faces node.
2021-10-21 12:07:03 +02:00
Bastien Montagne 2eb2e861a3 Install_deps: Rename `_VERSION_MAX` to `_VERSION_MEX` variables.
We define the minimum exclusive number for our supported dependencies
versions, and not the maximum inclusive number.

Thanks to @sybren for raising this point and finding the 'mex' math
term.
2021-10-21 11:58:06 +02:00
Richard Antalik 8d2cabcb97 Cleanup: VSE code docstring 2021-10-21 11:28:12 +02:00
Campbell Barton 98e1c6e935 Cleanup: clang-format 2021-10-21 18:27:46 +11:00
Campbell Barton f0f1198867 Cleanup: unused functuion warnings 2021-10-21 17:14:33 +11:00
Campbell Barton cfbac9032b Docs: note why BLI_string_join_arrayN needs to nil terminate 2021-10-21 17:10:19 +11:00
Campbell Barton 5faa333e78 Cleanup: match cursor hide option with naming for the 3D viewport 2021-10-21 17:01:15 +11:00
Campbell Barton d71c423c28 Cleanup: Use array as a parameter for event x/y functions
This change simplifies the parameter list for these functions
and reduces the chance of typos mixing up array indices.

Missed in rB69102786047dccdcbaee0df6307a8c3364d28fe0.
2021-10-21 16:57:53 +11:00
Campbell Barton 3a2b7f35f4 LibLink: ensure objects are selectable when "Select" is enabled
Appended objects could be hidden, making any further operations
potentially skip the newly added objects.

Now FILE_AUTOSELECT asserts when newly added options aren't selectable.
2021-10-21 16:57:53 +11:00
Campbell Barton 063c4e467d Cleanup: de-duplicate function to instantiate objects
De-duplicates wm_append_loose_data_instantiate_object_base_instance_init
and object_base_instance_init.

Add BLO_object_instantiate_object_base_instance_init which also adds to
a collection since all callers did this.
2021-10-21 16:57:53 +11:00
Campbell Barton 2a047fadc0 Fix type error in 5297bf318e 2021-10-21 16:57:53 +11:00
Richard Antalik 33d6d7c6e3 VSE: Add 2D cursor overlay option
Since 2D cursor will be used rarely in VSE and it is adding visual
noise, it will be hidden by default.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12933
2021-10-21 07:49:12 +02:00
Aaron Carlisle ec31f31749 Cleanup: Remove dead code 2021-10-21 01:01:31 -04:00
Aaron Carlisle 5297bf318e Cleanup: Use array as a parameter for event x/y functions
This change simplifies the parameter list for these functions
and reduces the chance of typos mixing up array indices.

Missed in rB69102786047dccdcbaee0df6307a8c3364d28fe0
2021-10-21 00:56:31 -04:00
Campbell Barton 035dcdad90 Cleanup: use underscore separators for event struct members
Improve readability using underscores for separators, e.g.
prev_click_time instead of prevclicktime.
2021-10-21 13:24:17 +11:00
Aaron Carlisle 6910278604 Cleanup: Use array as a parameter for event x/y functions
This change simplifies the parameter list for these functions
and reduces the chance of typos mixing up array indices.

Reviewed By: campbellbarton

Ref D12950
2021-10-21 13:15:41 +11:00
Germano Cavalcante 2905b493fe Fix failing 'script_validate_keymap' after recent changes
Properties with `_funcs_runtime` are always saved when exporting keymaps.

This is an error since changing one changes all others.

For now, work around the problem by setting the `PROP_IDPROPERTY` flag.
2021-10-20 20:49:59 -03:00
Germano Cavalcante 15e71f3d97 Cleanup: Set default snap cursor values during build time 2021-10-20 20:49:59 -03:00
Hans Goudey 6b761c59d2 Fix: Empty id attribute on curve control points
No virtual array should be returned instead of returning an empty span.
2021-10-20 17:45:14 -05:00
Hans Goudey 3f8b45d8d1 Fix: Builtin curve attributes unavailable
After the addition of the `id` attribute in rB40c3b8836b7a, the `exists`
function assumed that all attributes were stored in the custom data.
2021-10-20 16:54:04 -05:00