119118 Commits

Author SHA1 Message Date
Aaron Carlisle
eb8155ebcd PyDoc: Make rst files more readable
This commit reduces the amount of white space generated and keeps parameter documentation of a single line.

This makes the resulting rst files easier to read in the case of debugging.

This was useful while looking into T97464
2022-11-03 23:36:12 -04:00
Campbell Barton
c5dde1c345 Cleanup: quiet unused argument warning 2022-11-04 13:59:03 +11:00
Campbell Barton
3d72c37f7a Fix T101686: WPaint + Pose select fails with GPU depth-picking disabled
Regression in [0], however the primary purpose of that code was to
cycle away from the active object (behavior which was intentionally
removed, see: T96752).

This broke weight-paint + pose-selection (Ctrl-LMB)
when the GPU depth picking preference was disabled.
Causing selection to pick the mesh object instead of the pose bones.
This de-selected the armature, making the pose bones unselectable
instead of selecting the pose bone as intended.

Adding the old code back (restricting it to weight-paint mode)
fixes the bug but reintroduces fairly involved logic unnecessarily.

Instead, prioritize bone selecting when in weight-paint & pose mode
(previously this was only done in pose-mode).

[0]: b1908f2e0b23988627772f6a6d968d8351dca6d7
2022-11-04 13:58:57 +11:00
Clément Foucault
1452b44352 DRW: PointCloud: Fix memset writting non-trivial type std::mutex
This issue might have produced crashes in some cases similar to
rBafd30e5e3a77.
2022-11-03 19:34:58 +01:00
Clément Foucault
5081de736a Cleanup: DRW: Fix unused parameters warning 2022-11-03 19:34:58 +01:00
Clément Foucault
44dd158803 DRW: Command: Fix custom group test being always true 2022-11-03 19:34:58 +01:00
Nate Rupsis
838d20b990 make float value explicit 2022-11-03 12:18:53 -05:00
Nate Rupsis
0e0b3d6e1a adding defaults for NLA Action scale and repeat
Differential Revision: https://developer.blender.org/D16379
2022-11-03 12:18:53 -05:00
Sergey Sharybin
2c0c431399 Fix T102221: Entering editmode invalidates the driver associated with that mesh
The regression is caused by D13824 0f89bcdbebf5.

This fix follows the code from Sybren (D7785) to make object-mode
drivers from shapekey value to work. This intuitively makes sense
since the D13824 made the edit mode evaluation and ownership follow
the object mode more closely.

Differential Revision: https://developer.blender.org/D16380
2022-11-03 16:52:11 +01:00
Brecht Van Lommel
e449bf350c Fix Wayland warning on startup when running X11
On Ubuntu 20.04 running X11, there was this message on every Blender startup:
Unable to find 'wl_proxy_marshal_flags' in 'libwayland-client.so.0'.

The reason is that we build against Wayland protocols 1.21, which in turns requires
Wayland on the distribution to be 1.21+, which is not the case on Ubuntu 20.04.

This simply silences the warning. An improvement would be to explain the user that
their Wayland version is too old when neither X11 or Wayland can be found. Though
that's not trivial and a situation with old Wayland and no XWayland seems unlikely
to happen in practice.

Differential Revision: https://developer.blender.org/D16266
2022-11-03 15:46:44 +01:00
Sergey Sharybin
09b9e1e95e Fix T102225: Crash opening menus
Seems to be introduced by 99e5024e97f.

The crash is caused by the difference in the expected alignment
of the `uiPopupMenu` which is 16 bytes and the actual alignment
returned by the `MEM_mallocN()` which is 8 bytes due to the memory
head.

Now made it so that `MEM_new()` can be used for types with any
alignment.

Differential Revision: https://developer.blender.org/D16375
2022-11-03 14:32:04 +01:00
Thomas Dinges
666135c32a Blender 3.4 - Beta
* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.2 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake
2022-11-03 10:08:10 +01:00
Campbell Barton
d5ce854fb1 CMake: workaround unsupported cmake_path(IS_PREFIX ..) in v3.20
Add a macro that implements something similar to cmake_path's IS_PREFIX
which isn't supported in older versions of CMake.

This caused the build-bot to fail.
2022-11-03 16:57:38 +11:00
Campbell Barton
65e4d169ba BLI_path: skip "/./" and "/." in BLI_path_name_at_index
This avoids having to run BLI_path_normalize before calling
BLI_path_name_at_index.
2022-11-03 15:33:08 +11:00
Aaron Carlisle
31d43cb0e7 Update RNA to User manual mappings 2022-11-03 00:32:22 -04:00
Campbell Barton
50c72069b4 Cleanup: replace BLI_join_path with BLI_join_string
There is no need to use path joining logic here.
2022-11-03 14:38:15 +11:00
Campbell Barton
92b2f4d249 BLI_string: C++ support for string joining macros
C++ doesn't support taking the temporary address of a temporary array,
use inline functions instead.

Also change array joining functions to return the length of the string
instead of returning the pointer (matching BLI_path_join).
2022-11-03 14:32:50 +11:00
Aaron Carlisle
5ba045af7b PyDocs: Upgrade Theme to 1.1.0
Updates to kbd and breadcrumbs along with some fixes to API docs that should'nt affect us.
2022-11-02 22:37:39 -04:00
Aaron Carlisle
ea94d5723f PyDocs: Upgrade Sphinx to 5.3.0
Trivial changes, should not affect us in anyway.
2022-11-02 22:35:42 -04:00
Aaron Carlisle
bb0b04f43a UI: Bevel: Specify the width type as "Width Type" in the status bar.
Part of T102224
2022-11-02 22:14:19 -04:00
Campbell Barton
6377d00a61 Cleanup: cmake comment line length 2022-11-03 12:11:08 +11:00
Campbell Barton
b320597697 Tests: don't create byte-code cache when calling Python from SVN
Creating `__pycache__` directories in SVN's lib/ directory can cause
updating SVN to fail. Add the -B flag when TEST_PYTHON_EXE from LIBDIR
is used so so Python doesn't generate this cache.
2022-11-03 11:51:52 +11:00
Erik Abrahamsson
bad55d56bc Mesh: Parallelize remesh reprojections
In high poly meshes the reprojections after remesh can become slow.
This parallelizes reprojection of face sets, paint mask and vertex paint.
It also adds flags to disable dependency graph updates on
setting remesh options to remove UI lag.

Profiling of remeshing a 3.4M poly mesh (in sculpt mode):
Before: 19.6s
After: 8.7s

Differential Revision: https://developer.blender.org/D15638
2022-11-02 23:23:20 +01:00
Julian Eisel
a38b98478a Fix empty menu title in some menus (e.g. Text Editor context menu) 2022-11-02 18:01:18 +01:00
Julian Eisel
15fe7f3d93 Fix arrow key menu navigation using wrong direction
Steps to reproduce were:
* Right click in 3D View (context menu) press up or down arrow.

Or:
* Ctrl+Shift+O (Open Recent menu) press up or down arrow.
2022-11-02 17:57:36 +01:00
Brecht Van Lommel
31746e1baa Fix memory leak with Freestyle renders after recent changes
Render stored a shallow copy of the scene view layers and views for thread
safety, without proper functions to free it. But with the CoW depsgraph this
scene is already a copy of the original and an additional copy is not needed.

Refactor to use the scene view layers and some other settings directly instead
of making a copy.
2022-11-02 17:16:50 +01:00
Sergey Sharybin
07ef428c6c Cycles: Add regression test for util_md5_string 2022-11-02 16:30:13 +01:00
Sergey Sharybin
38c7fd36ff Refactor: Rename Object->imat to Object->world_to_object
The goal is to improve clarity and readability, without
introducing big design changes.

Follows the recent obmat to object_to_world refactor: the
similar naming is used, and it is a run-time only rename,
meaning, there is no affect on .blend files.

This patch does not touch the redundant inversions. Those
can be removed in almost (if not all) cases, but it would
be the best to do it as a separate change.

Differential Revision: https://developer.blender.org/D16367
2022-11-02 15:42:23 +01:00
Hans Goudey
0fc958a174 Fix: Crash adding rest positions to empty mesh
The position attribute might not exist when the mesh is empty, which may
be another problem, but there is no need to count on it here.
2022-11-02 13:59:31 +01:00
Omar Emara
bc8b15f1a5 Realtime Compositor: Move shaders to compositor module
This patch moves the GLSL shaders and their infos to the compositor
module as decided by the EEVEE & Viewport module. This is a non
functional change.

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

Reviewed By: Clement Foucault
2022-11-02 13:55:23 +02:00
Omar Emara
c394f510a5 Realtime Compositor: Make vectors four dimensional
Currently, the realtime compositor treat vector types as 3D vectors,
which is true for most operations. However, some operations deal with
vector types as 4D vectors that encode two 2D vectors or one 3D vector
with the last component ignored. So this patch expands vector types to
include a fourth component that is only sometimes used.

Since we already stored vectors in RGBA textures, the necessary changes
are straightforward and are mostly concerned with adjusting the Result
class.

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

Reviewed By: Clement Foucault
2022-11-02 13:48:20 +02:00
Csaba Boncsér
14e4c96b64 Nodes: Reuse input sockets when creating new node groups
**Problem**
Currently multiple input sockets are created when a new node group is
made from selected nodes. Some of these are linked from the same source.
It is not convenient to sort out and remove multiple input sockets that
represent the same input. These inputs usually have meaningless names
like 'value', 'x', etc.

**Solution**
Create common input sockets for each link starting from the same input.
Move links inside the new group's node tree and reroute it to connect
the common input socket to the original nodes. This is done by building
up a mapping between the incoming link sources to the input interfaces
created for them. The input interfaces are reused by the rest of the
links having the same source.

This patch also changes the way the input sockets get their names.
Output socket names of the group nodes usually are specific and are
given consciously. Use the output socket names from group nodes instead
of the inputs where the links point to.

Differential Revision: https://developer.blender.org/D15802
2022-11-02 12:34:22 +01:00
Hans Goudey
5f7ca5462d Geometry Nodes: Add index and value inputs to sample curve node
As described in T92474 and T91650, this patch adds two features to the
sample curve node. First is an index input, to allow choosing the curve
to sample for each point. Second is a custom field input, which is
evaluated on the control points of the curve and then sampled like the
other outputs. There is an "All Curves" option for the old behavior
which takes the length of all curves into account.

For invalid curve indices, the node outputs zeros (default values).
Invalid lengths and factors are clamped.

There have been various discussions about splitting the node up more,
but this is an intuitive combination of options and will work well
enough for current use cases. The node could still be generalized more
in the future.

Keep in mind that the source field is evaluated on curve control points,
not the evaluated points used for sampling. This is necessary so that
fields like "Index" work as expected.

Differential Revision: https://developer.blender.org/D16147
2022-11-02 12:34:22 +01:00
Julian Eisel
460c9d3d92 Fix use-after-free in asset library storage destruction
Would only appear when more than 4 asset libraries were loaded, because
small buffer optimization would hide the issue.
2022-11-02 11:56:50 +01:00
Campbell Barton
638bf05a23 Fix BLI_path_parent_dir returning success with a single period as input
While relatively harmless, BLI_path_parent_dir wasn't returning failure
when passed in "./" which wouldn't succeed.

Instead of adding a ".." and normalizing, normalize the path and remove
the last directly. This is simpler than inspecting the resulting path
to see if normalize removed it or not.

Add additional tests which failed previously.
2022-11-02 17:17:28 +11:00
Campbell Barton
7f1e98839a Tests: enable path tests for WIN32
Tests for BLI_path_normalize, BLI_path_parent_dir & BLI_path_rel
were disabled on WIN32 because of complications with slash direction.

Enable these tests using character replacement to manipulate test data.
2022-11-02 16:15:48 +11:00
Campbell Barton
52664437fb Cleanup: use doxy sections for path tests 2022-11-02 14:28:00 +11:00
Campbell Barton
db43aa7729 Fix T102201: File selector shows "\" before folder names on WIN32
Regression in [0] on WIN32 caused joining paths {"//", "path"} to
result in "//\path".
This made the file selector show paths with a "\" prefix.

Add an exception for WIN32 where an initial path of forward slashes
is joined without a back-slash.

[0]: 8f7ab1bf46d5e8610b167180b7631ff62e718a08
2022-11-02 14:11:46 +11:00
Campbell Barton
5a90bbf716 Cleanup: format 2022-11-02 11:20:06 +11:00
Campbell Barton
889b3385b5 Cleanup: spelling in comments 2022-11-02 10:18:19 +11:00
Campbell Barton
cc6f41f8a5 Fix BLI_path_parent_dir failing on paths ending with ".."
The check for BLI_path_normalize having succeeded only checked for a
trailing "../" which isn't correct. This caused going up a directory
in the file selector to do nothing on directories ending with "..".

This also caused an empty path to expand into "../" because
BLI_path_extension_check didn't account for this case.

Resolve using BLI_path_name_at_index which extracts the last component
of the path without having to match the the surrounding slashes.
2022-11-02 07:21:10 +11:00
Campbell Barton
12f4ac1706 Fix BLI_path_normalize failing with "." and ".." in the path
The logic to go up a directory (using "..") ran before stripping "/./"
from the path. This caused "/a/b/./../" to result in "/a/b/"
instead of "/a/". Now redundant characters are removed before before
checking for ".." in paths.

Include test to ensure this works as expected.
2022-11-02 07:21:10 +11:00
Campbell Barton
513dfa179f Tests: add BLI_path_parent_dir tests, split BLI_path_normalize tests
Also enable a test that was disabled with a fix FIXME comment but works.
2022-11-02 07:21:10 +11:00
Ray Molenkamp
f8699881d6 CMake/MSVC: Disable ASAN for developer builds
ASAN is more often broken than working depending on the MSVC version
you have. As it is causing too many support incidents of people that
unknowingly turned ASAN on by running `make developer` and running
into issues starting blender due to the broken ASAN support in MSVC.

This commit changes the default not enable it for MSVC in the
developer profile. Devs that still want to enable it can do so though
turning WITH_COMPILER_ASAN on in their CMakeCache.txt or by running
`make developer asan`
2022-11-01 12:46:15 -06:00
Brecht Van Lommel
f66236a827 Fix T102018: find HIP library also in system library paths on Linux
Previously it would use a hardcoded location where the AMD driver installs it,
but Linux distributions may use other locations. Now look for both cases.
2022-11-01 18:36:45 +01:00
Julian Eisel
518d7dbebb UI/Nodes: Update node add menu as assets get loaded
Adds a listener to the node add menu so that it refreshes as assets get
loaded asynchronously.

Followup to cf985180551d, also see 99e5024e97f1 and the previous commit.
2022-11-01 17:43:55 +01:00
Julian Eisel
78a7d5cfcc UI: Support C defined menu types to listen to notifiers
Needed to dynamically load assets as menu items, see cf985180551d and
99e5024e97f1. The next commit will add the listener for the node add menu.
2022-11-01 17:43:38 +01:00
Michael Kowalski
bcc2656299 USD IO: replace deprecated primvars API.
Updated the code to use the UsdGeomPrimvarsAPI class to read
and write mesh primvars instead of the now deprecated primvars
accessors in UsdGeomImageable.  This will be required to build
with USD 22.11 in the future, where the deprecated functions
have been removed.
2022-11-01 11:55:58 -04:00
Julian Eisel
99e5024e97 UI: Support refreshing menu popups
This allows us to asynchronously load items into the menu, see
cf985180551d. All menus spawned from Python using the `wm.call_menu`
operator will be affected by this. We could avoid that and only refresh
the menu we need to, but it's worth trying to get this to work as a
general menu feature.

This is a slightly risky change, so keeping an eye open for bugs.
2022-11-01 16:45:31 +01:00
Hans Goudey
cf98518055 Nodes: Add node group assets in add menu
This patch builds on the work from bdb57541475f to add node group
assets directly in the node editor add menu. Assets are added after
separators to distinguish them, but otherwise they look like any other
node. The catalog trees from all configured libraries are used to build
the menu hierarchy. Only catalogs with matching asset types are used
though.

There are a few limitations of this initial version. For now this only
supports geometry nodes. Support for other built-in node systems just
requires some refactoring of the corresponding add menu though. Lazy
loading will be added in a followup commit. For now there is a label
the first time the menu is opened.

Like the search menu integration, re-saving asset library files in 3.4
is required, if it hasn't been done already.

Implementation wise, there is a some ugly code here. A lot of that is
because the asset system isn't complete. The RNA API doesn't work well
yet, and the system isn't built to interact with multiple libraries at
once. It's also ugly because of the way we combine automatic menu
generation with builtin menus. As noted in a code comment, these two
systems could be merged completely so that the menus for builtin nodes
are also generated in the same way.

Differential Revision: https://developer.blender.org/D16135
2022-11-01 16:09:58 +01:00