107734 Commits

Author SHA1 Message Date
Campbell Barton
26f1a5e2c8 Fix T90417: font loading creates duplicate ID names
Also repair any errors in existing files.

Error from e0dd3fe5872ba37ff188e292b80b46fcf8df413c.
2021-08-04 13:02:59 +10:00
Campbell Barton
5950b3ab73 Cleanup: de-duplicate ID renaming utility for versioning 2021-08-04 12:43:07 +10:00
Campbell Barton
71dc134f89 Icons: add license headers to utilities 2021-08-04 11:45:43 +10:00
Campbell Barton
7389fd9a35 Icons: resolve various issues for generating icons
- INKSCAPE_BIN environment variable was ignored by
  alert_icons_update & prvicons_update.
- `make icons` wasn't regenerating alert icons.
- Updating SVG icons failed using blender built with ASAN.
2021-08-04 11:35:05 +10:00
Campbell Barton
8a1c1279b3 Icons: update alert icon script
Missed from c549d736cff0d5013f05fb5240ef07671c5aa5ce.
2021-08-04 11:03:23 +10:00
Campbell Barton
0d2589d08c Cleanup: spelling 2021-08-04 10:03:07 +10:00
Germano Cavalcante
fb87d236ed Fix calculation of 'projmat_dimensions'
`r_left`, `r_right`, `r_bottom` and `r_top` were ignoring `clip_near` value
when in perspective view.

Also rename `projmat` to `winmat` in these cases.
2021-08-03 17:35:35 -03:00
Ankit Meel
18d900caca macOS: Fix OpenMP dynamic loader error. 2021-08-04 01:22:27 +05:30
Julian Eisel
41357d556f Fix broken logic in Windows directory query function
Mistake in a5bbdd6998ab
2021-08-03 19:37:34 +02:00
Germano Cavalcante
39e914cee7 Fix select engine buffer having wrong vertex size
The theme used was wrong and the vertex size is twice as set in the theme.
2021-08-03 13:37:55 -03:00
Bastien Montagne
57281b73c4 Install_deps: Always re-create shortcuts to installed lib paths.
For some reasons looks like those shortcuts could get out of sync, which
created weird hard to understand building errors.

So for sake of simplicity and security, just re-create them all the
time, just like we update ld paths.
2021-08-03 17:22:48 +02:00
Ankit Meel
652fbc2005 macOS: Portable builds with dynamic libraries.
For Blender.app: dropping libomp.dylib next to Blender executable is
enough for it getting picked up since `@executable_path` is an rpath.

For non-distributed binaries datatoc, makesdna, tests etc, code for
copying libomp.dylib to build folder is removed and replaced by
CMake's rpath option for *build* tree.

For bpy.so, the post build rpath change has also been replaced by CMake
rpath option for *install* tree.

Since -id has been changed in D11748, remove the
`install_name_tool -change ...` command.

Any dylib can just be dropped at `MAC_BLENDER_TARGET_DYLIBS_DIR`
hereafter. Appending dylib path to `CMAKE_BUILD_RPATH` will be needed
for datatoc etc if linked against one (instead of copying the
dylibs around).

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D11997
2021-08-03 20:49:40 +05:30
Sybren A. Stüvel
a25a1f39aa Cleanup: interface, reduce indentation of copy_to_selected_button()
Reduce cognitive complexity of `copy_to_selected_button()` by flipping
conditions, returning early, and using `continue`.

No functional changes.
2021-08-03 17:12:08 +02:00
Germano Cavalcante
4e1a1821e0 Fix T90313: Align to Transform Orientation Axis Property Doesn't Work
`Orientation Axis` is a property incompatible with `Align` mode and
should not be visible.
2021-08-03 11:29:36 -03:00
Julian Eisel
391af6bea2 Cleanup: Replace int with bool for pointcache function
Was using an int for boolean return value.
2021-08-03 15:51:25 +02:00
Campbell Barton
7724251af8 WM: don't store selection properties typically set in the key-map
While this was already the case for the most part
some selection operators stored common settings for reuse such as
"toggle", "extend" & "deselect".

Disabling storing these settings for later execution
as it means failure to set these options in the key-map re-uses
the value of the shortcut that was last called.

Skip saving these settings since this is a case where reusing them
isn't helpful.

Resolves T90275.
2021-08-03 23:33:40 +10:00
Campbell Barton
d3dd735fea UI: building without Python again
Also quiet some warnings.
2021-08-03 22:45:37 +10:00
Jeroen Bakker
cec103d5a9 Silenced clang-tidy warnings. 2021-08-03 13:56:46 +02:00
Sybren A. Stüvel
0342fb5d20 Fix T90387: division by zero when trying to invert scale
Fix division by zero when `BKE_bone_parent_transform_invert()` inverts a
scale vector with zero components.

Zero values in the to-be-inverted vector are now simply skipped, i.e.
remain zero after inversion. This at least ensures that
`invert_v3_safe(invert_v3_safe(vector))` results in the same vector.

This commit does NOT fix the conceptual problem that an inversion of a
potentially non-invertible vector is relied upon. It just avoids the
division by zero.
2021-08-03 13:43:42 +02:00
Philipp Oeser
dbd34a5acb Fix T90364: buttons (partially) behind animchannel search block search
When channels are scrolled to be (partially) behind the search bar,
their widget buttons would still be interactive, preventing the seach
buttons to be usable.

We have to make sure the events are consumed from the search and dont
reach other UI blocks.
We can do so by flagging the block `UI_BLOCK_CLIP_EVENTS` -- but also
have to make sure the bounds are calculated correctly (otherwise the
check relating `UI_BLOCK_CLIP_EVENTS` in `ui_but_find_mouse_over_ex` wont
trigger properly.

Maniphest Tasks: T90364

Differential Revision: https://developer.blender.org/D12103
2021-08-03 13:20:50 +02:00
Philipp Oeser
b35a96e195 Fix T90346: particle force field self effect amount off by one
When calculating the particle step in `get_effector_tot`, we have to
round up (otherwise we might get an extra round in the for-loop in
`BKE_effectors_apply` for certain cases).

Example from the report:
- 10.000 particles, Effector Amount 3
- was rounding the step down to 3333
- going into the for-loop for 0, 3333, 6666 and 9999 (4 times)
- now rounding the step up to 3334
- going into the for-loop for 0, 3334 and 6668 (3 times as desired)

Maniphest Tasks: T90346

Differential Revision: https://developer.blender.org/D12113
2021-08-03 13:07:46 +02:00
Bastien Montagne
20d5d7b8ec Blender Readfile: Fix annoying useless Object reading error messages.
Extend the 'reading error' container to produce the generic short
message in the popup directly visible by the user, and move all detailed
info the `INFO` reports that only show up in the console and Info
editor.
2021-08-03 12:54:05 +02:00
Sybren A. Stüvel
c6f64d46ed Cleanup: USD importer, consistent naming of function parameter
Rename function parameter `flags` to `read_flag` in the declaration, to
be consistent with the definition.

No functional changes.
2021-08-03 12:44:16 +02:00
Michael Kowalski
ea54cbe1b4 USD: add USD importer
This is an initial implementation of a USD importer.

This work is comprised of Tangent Animation's open source USD importer,
combined with features @makowalski had implemented.

The design is very similar to the approach taken in the Alembic
importer. The core functionality resides in a collection of "reader"
classes, each of which is responsible for converting an instance of a
USD prim to the corresponding Blender Object representation.

The flow of control for the conversion can be followed in the
`import_startjob()` and `import_endjob()` functions in `usd_capi.cc`.
The `USDStageReader` class is responsible for traversing the USD stage
and instantiating the appropriate readers.

Reviewed By: sybren, HooglyBoogly

Differential Revision: https://developer.blender.org/D10700
2021-08-03 12:33:36 +02:00
Julian Eisel
28b9dd7b1f Cleanup: Remove redundant checks in File Browser UI script
Was already checking these preconditions in the poll method.
2021-08-03 12:25:38 +02:00
Julian Eisel
c0900a64ce Fix T90341: Crash opening 2.4 file with File Browser editor open
The file selection parameters (e.g. `context.space_data.params`) are
expected to be unset in certain cases. Reading 2.4 files seems to be one
of them. Hence, code using it should check it's set first. Also added an
assert to a File Browser UI template printing a message when the
parameters are unset, to help debugging the issue.
2021-08-03 12:25:38 +02:00
Jacques Lucke
b1a607ce04 Cleanup: deduplicate type conversion logic 2021-08-03 10:38:37 +02:00
Campbell Barton
f8abc3fb2f Fix T85436: Separate by loose parts doesn't show new objects
Only the "changed" state from the last edit-object was used,
this meant the operator would not perform the necessary update
with multi-object edit-mode.

Use "changed" & "changed_multi" naming convention.
2021-08-03 18:13:06 +10:00
Campbell Barton
d6e97a53ab Correct task ID in 00b57136e4167ef5a303b1215574bb52a22e9194 2021-08-03 18:13:06 +10:00
Falk David
b54e741a8b UI: Add light count to viewport statistics
Even though lights were part of `SceneStats`, they were not used when
rBfd10ac9acaa0 was committed.

This patch adds the light count back into the statistics. When a light is
the active object, it will display the total number of lights in the
scene, as well as how many lights are currently selected.

{F10141354}

Reviewed By: #user_interface, Severin, Blendify, harley

Maniphest Tasks: T88512

Differential Revision: https://developer.blender.org/D11387
2021-08-03 09:42:53 +02:00
Campbell Barton
00b57136e4 Revert "Fix spin-gizmo not allowing click events to select vertices"
This reverts commit 0b903755a9908344e9fcb4a33b4f0340abeb9386.

This caused T86030, left-mouse selection override clicking,
which is used for creating a full revolution.
2021-08-03 16:34:26 +10:00
Jeroen Bakker
6f50969406 Cleanup: Hide implementation details for ED_keyframe_keylist.
For T78995 we want to change the data structure of keylists to
improve performance. (Probably a Vector with bin-search capabilities).

This patch hides the internal structure of the keylists behind `AnimKeylist`
structure. This allows us to change the internals without 'breaking' where it is
being used.

The change adds functions to create, free, find and walk over the
keylist.

Reviewed By: sybren

Maniphest Tasks: T78995

Differential Revision: https://developer.blender.org/D11974
2021-08-03 08:10:21 +02:00
Jeroen Bakker
ebd55b4acd T90372: Assets: When dropping material use active material slot.
Currently when dropping an asset the first material slot is always updated.
This patch changes that logic to update the active material slot.

In future the behavior will be updated to use the material slot of the face under the cursor.
That requires better feedback tot he user.

Reviewed By: Severin

Maniphest Tasks: T90372

Differential Revision: https://developer.blender.org/D12056
2021-08-03 08:08:20 +02:00
Miguel G
a53feb0aff Fix T89691: Solidify modifier simple/complex inconsistency
Maintain the sign when clamping non zero offset.

Reviewed By: campbellbarton, weasel

Ref D11832
2021-08-03 16:00:32 +10:00
Campbell Barton
c1a477b497 Cleanup: use C++ comments or 'if 0' for commented code 2021-08-03 15:27:20 +10:00
Campbell Barton
1973fd89df Fix crash adding custom normals
Caused by error converting this file to C++
eccdced972f42a451d0c73dfb7ce19a43c120d7f.
2021-08-03 15:01:39 +10:00
Campbell Barton
04c75c5ce7 Edit Mesh: Correct normal calculation for "Set From Faces"
Setting normals from faces wasn't weighting the faces contribution
by the corner angle, giving lop-sided results in some cases.

This removes the epsilon check for CLNORS_VALID_VEC_LEN,
in favor of matching the behavior of vertex normals exactly.
2021-08-03 12:22:11 +10:00
Aaron Carlisle
223f048138 Fix annotations placement option in the Movie Clip editor
In rB6ee14c966d05362228511756c4906e043b87e346 the enum items were renamed/removed, this change was not propagated to this setting
2021-08-02 20:15:11 -04:00
Hans Goudey
efd7c95bb2 Cleanup: Remove duplicate special case check 2021-08-02 15:45:25 -04:00
Hans Goudey
a4813379f9 Fix T90042: Spline tangent calculation assert with coincident points 2021-08-02 15:43:37 -04:00
Hans Goudey
4f6f445120 Cleanup: Make spline settings copy function public
It will be useful in the spline type conversion node. Theoretically it
could become protected again if that conversion moves out of a node,
which might be a nice improvement after an initial version.
2021-08-02 14:21:19 -04:00
Hans Goudey
8b93265c19 Mesh: Tag normals dirty instead of calculating
Because mesh vertex and face normals are just derived data, they can
be calculated lazily instead of eagerly. Often normal calculation is
a relatively expensive task, and the calculation is often redundant
if the mesh is deformed afterwards anyway.

Instead, normals should be calculated only when they are needed. This
commit moves in that direction by adding a new function to tag a mesh's
normals dirty and replacing normal calculation with it in some places.

Differential Revision: https://developer.blender.org/D12107
2021-08-02 13:47:32 -04:00
Richard Antalik
a2203a27d9 Fix T90356: Frame selected includes active strip
Don't include active strip in this operator.

This was confusing due to name of operator and inconsistent with other
editors.
2021-08-02 18:51:00 +02:00
Hans Goudey
67d56eb71e Cleanup: Remove unused/unecessary OpenVDB C API
This commit uses OpenVDB more directly for the voxel remesher, without
the extra indirection of copying to a Blender API. This makes the code
simpler, shorter, and easier to understand (though I didn't observe any
performance improvement).

This also removes the rest of the unused and undocumented OpenVDB C API,
which was written when Blender's code didn't really use C++, and doesn't
serve a purpose anymore. Those features will be implemented as nodes in
the future anyway (see D12100).

Differential Revision: https://developer.blender.org/D12097
2021-08-02 12:26:28 -04:00
Philipp Oeser
77187718e4 Fix T78469: Output Metadata: Strip Name no longer accessible
Caused by rB7fc60bff14a6.

This has actually been reported and closed, but that was clearly a
misunderstanding (above commit changed a checkbox to be an enum, but a
second checkbox was simply removed)

Maniphest Tasks: T78469

Differential Revision: https://developer.blender.org/D12084
2021-08-02 17:26:50 +02:00
Brecht Van Lommel
eccd8af828 Revert "GHOST/X11: enable EGL"
This is causing issues for some users launching Blender, because EGL indirectly
requires GLVND, which is not installed by default on e.g. Ubuntu.

This reverts commit 0b18a618b88b22663e05eca0f4d976875710e7cc.

Fixes T90374

Ref D12034
2021-08-02 17:19:17 +02:00
Philipp Oeser
1062649b5e Fix T87041: Driver Editor not updated in realtime
Caused by {rBbbb2e0614fc3}

Since above commit only the playhead is updated as an overlay in
animation playback (was moved out of drawing of the main region for
perfomance reasons).
The driver value "debug" visualization is very useful to have during
playback though but was left in main region drawing as part of
`draw_fcurve` (thus does not update in realtime anymore).

Moving `graph_draw_driver_debug` into the overlay is not feasible
because it requires animation filtering which has significant overhead
which needs to be avoided in the overlay which is redrawn on every UI
interaction.

Now tag the whole main region for updates in the Driver Editor during
playback instead (which will make the Drivers Editor as slow during
playback as before rBbbb2e0614fc3 -- but with realtime updates of the
debug visualization).

Maniphest Tasks: T87041

Differential Revision: https://developer.blender.org/D12003
2021-08-02 17:11:58 +02:00
Julian Eisel
3ff5d8f719 Asset Browser: Proper context menu for assets
Add a context menu dedicated to asset operations to the Asset Browser.
There are two separate context menus to keep things separated well and
avoid confusing if-else logic (similar to D12057 & D12059). Their polls
make sure they are displayed for the right contexts only.

Also (to be committed as followup cleanup): Remove now unused special
handling for assets in file delete operator.

Differential Revision: https://developer.blender.org/D12062
2021-08-02 17:00:20 +02:00
Julian Eisel
ceb049133c Asset Browser: Don't show inapplicable filter and display settings
So far the Asset Browser just showed the same popups and settings as the
File Browser. Not all of them made sense for the Asset Browser though.

* Don't show inapplicable recursion toggle.
* Don't show sorting options, which don't work with assets anyway.
* Don't show the Filter popover, there are currently no applicable items
  in there.

Just like in D12057, I decided to add separate classes for the Asset
Browser case.

Differential Revision: https://developer.blender.org/D12059
2021-08-02 17:00:20 +02:00
Julian Eisel
d8bf332f86 Asset Browser: Adjust header pulldowns to be Asset Browser specific
So far the Asset Browser just showed the same menus as the File Browser.
Not all of their entries made sense for the Asset Browser though. I
decided to just give them entirely different classes to avoid confusing
if-else checks everywhere. I think the code duplication this adds is a
minor issue, it's better to keep things seperated clearly IMO.

* View menu: Add "Asset Details" toggle for the sidebar region.
* View menu: Remove recursion sub-menu
* View menu: Remove "File Path" region toggle, which doesn't apply for
  the Asset Browser.

Differential Revision: https://developer.blender.org/D12057
2021-08-02 17:00:20 +02:00