Commit Graph

122883 Commits

Author SHA1 Message Date
Jeroen Bakker
4aed240b02 CMake: Disable Options Depending on OpenEXR Dependecies
OpenEXR has some dependecies that other other modules in Blender
requires. When disabling OpenEXR these dependecies could not match
and building blender would fail.

This PR disables the next options when `WITH_IMAGE_OPENEXR=Off`

- `WITH_OPENVDB`
- `WITH_ALEMBIC`
- `WITH_VULKAN_BACKEND`
- `WITH_CYCLES_OSL`

Additionally windows stores the IMath libraries in `IMATH_LIBRARIES`
Linux and Mac stored the IMath libraries in `IMATH_LIBRARY`. This
change will also adds `IMATH_LIBRARIES` variable to all platforms.

Pull Request: https://projects.blender.org/blender/blender/pulls/106209
2023-04-03 09:50:50 +02:00
Jason Fielder
8954df63ef Fix #106431: Resolve Metal workload dependency
Splitting workload dependency chains such that they
only exist within the context of a single frame.
Dependencies are required to ensure sequential
command buffer submissions execute in order,
but the additional dependencies between frames
could incur GPU timeouts, if a signal was delayed.

This could be triggered by both CPU/GPU cycles
texture updates and Viewport Compositor operations.

Should also resolve #106401

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/106443
2023-04-03 08:53:42 +02:00
Jason Fielder
682cb6ecd3 Metal: Optimize SSR shader for Apple Silicon
Reduce register spill to global memory in raytrace_resolve
function. Results in a 20% uplift for this particular shader on
Apple Silicon GPUs. Contributing to 3-5% uplift for scenes
which have SSR enabled. This is achieved via reducing
memory pressure using a packed data type for the sampling
kernel.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/106231
2023-04-03 08:37:24 +02:00
YimingWu
dc63f75837 Fix #106414: Handle mat==None case in GPencil Change Active Material operator
Some material slots could be empty, the operator could encounter a python
exception. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/106418
2023-04-02 17:08:50 +02:00
Bastien Montagne
45104ddd14 Cleanup: Remove code asserted as unreachable,
This piece of code has been assserted as unreachable for 3 years now,
time to clean it up.
2023-04-01 20:17:26 +02:00
Bastien Montagne
8a364ef72c Fix (unreported) misisng handling of XR data object pointer in foreach_id.
Very sadge to see this kind of mistakes still exist in 2023 code...

While in theory this commit could be backported to (LTS) releases, would
rather only do it if/when proven it actually fixes user-facing issues.
Fixing such issues so deep in ID management code can have completely
unexpected side effects.
2023-04-01 20:10:48 +02:00
Clément Foucault
7592ec35d3 GPU: Fix compilation with option WITH_GPU_BUILDTIME_SHADER_BUILDER
Breakage caused by 84c93f3a069356fb93b09677e4defe9ccf113606
2023-04-01 17:16:54 +02:00
Clément Foucault
e652d0002b GPU: FrameBuffer: Fix empty framebuffer update
The framebuffer default size was only set during the first bind. This
is because the `dirty_attachments_ tag` wasn't set and thus the
framebuffer size was never passed down to the GL.

Split to `default_size_set()` to not affect other code paths that use
`size_set()`.
2023-04-01 13:24:48 +02:00
Clément Foucault
897a735151 BLI: Rotation: Add CartesianBasis transform_point and invert 2023-04-01 13:24:35 +02:00
Chris Blackbourn
957ac41237 Fix #78396: Pack UVs to original bounding box
Adds the ability to pack UVs back into the original bounding box.

Choose UV Editor > Menu > UV > Pack Islands

Then change "Pack To" to "Original bounding box"
2023-04-01 21:13:58 +13:00
Chris Blackbourn
531f99ffbd UV: simplify uv packing api and simplify uv packing
Fix #invert_m2_m2 with repeated arguments.

Change UV Packing to use {pivot, half_diagonal} representation.
2023-04-01 11:35:07 +13:00
Germano Cavalcante
6778460e53 Fix #106323: Snap to Face Nearest not working
Face Nearest only works with individual projection, so always set the
`SCE_SNAP_PROJECT` flag in this case.

Also gray out the `Project Individual Elements` option in the UI if
`Face Nearest` is enabled.

And change the description to indicate that `Project Individual Elements`
is always enabled with the `Face Nearest` option.

(I feel a better design for this option needs to be considered).
2023-03-31 17:30:26 -03:00
Germano Cavalcante
f898c22349 Fix #106363: snap toggle affecting operators not set to 'Affect'
Regression due 88e2542398.

Although the "Non-Affect" operators continue to use incremental,
this snapping should not be enabled by default.
2023-03-31 16:32:53 -03:00
Hans Goudey
389025bee2 Cleanup: Use consistent type in function definition 2023-03-31 14:24:23 -04:00
Hans Goudey
1a956ce196 Cleanup: Mode most of MOD_nodes.cc to the blender namespace
Avoid introducing another `::modifiers` namespace for now, since it's
not clear if we'll want that long term. This just avoids a bunch of
boilerplate and makes things easier to read.
2023-03-31 13:19:37 -04:00
Hans Goudey
60cac27ccc Cleanup: Use helper function to create AttributeFieldInput 2023-03-31 13:00:51 -04:00
Hans Goudey
1113a25d1f Cleanup: Make geometry nodes execution functions more reusable
Use the node group and the properties as arguments instead of
the modifier. This may help to allow reusing the functions outside
of the modifier execution context.
2023-03-31 12:53:21 -04:00
Nate Rupsis
7d548b5735 Refactor: Cleaning up NLA Draws Non_solo boolean option
Refactor: Clean up boolean logic naming in nla_draw to be more readable.
Pull Request: https://projects.blender.org/blender/blender/pulls/106119
2023-03-31 17:49:26 +02:00
Christoph Lendenfeld
0187943a3d Animation: Weight Paint select more/less for faces
This adds the select more/less operators to the weight paint mode face selection.

Just like in edit mode, press `CTRL`+`Numpad Plus/Minus` to use them.
They have also been added to the `Select` menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/105607
2023-03-31 14:53:00 +02:00
Christoph Lendenfeld
0d1a0cb453 Animation: Weight Paint select more/less for vertices
This adds the select more/less operators to the weight paint mode vertex selection.

Just like in edit mode, press CTRL+Numpad Plus/Minus to use them.
They have also been added to the Select menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/105633
2023-03-31 14:47:57 +02:00
Hans Goudey
0face8bd22 Fix #105912: Texture paint removes evaluated mesh attributes
When retrieving the evaluated mesh to paint on, it can be reevalauted,
where a smaller set of attributes are requested than for regular
evaluated meshes. That reevaluation should be completely removed
(see #106186), but a simple fix in the meantime is to manually
request that data.
2023-03-31 08:15:58 -04:00
Christoph Lendenfeld
7775fecb14 Animation: Graph Editor - grey out area outside of normalization range
When normalization is enabled in the Graph Editor,
the area outside the -1/1 range on the y axis isn't meaningful.
To visually represent that this patch greys out that area
just as it does with anything outside the current frame range.

Pull Request: https://projects.blender.org/blender/blender/pulls/106302
2023-03-31 13:54:32 +02:00
Jacques Lucke
324ba509b5 Fix: don't access 4th element of float3
The issue here is that `float3` implicitely casts to `float *`
which is then passed into the `float4` constructor.
2023-03-31 11:41:05 +02:00
Thomas Dinges
ca0ec55d59 Update license document. 2023-03-31 11:39:39 +02:00
Aras Pranckevicius
b73ae802fb Fix OBJ test expectations after fast_float.h update 2023-03-31 11:36:25 +03:00
Aras Pranckevicius
e1426e6319 Externals/IO: update fast_float.h to latest version
fast_float.h currently is only used by OBJ, STL and PLY I/O importers.
Update it to the latest release from upstream (from 3.4.0 2020 Nov to
4.0.0 2023 Mar).

No behavior changes, but they have optimized the performance a bit.
Importing a 6-level subdivided Suzanne OBJ file (330MB) goes from 3.5sec
down to 3.2sec on Win10, Ryzen 5950X, VS2022 build.
2023-03-31 11:03:13 +03:00
Campbell Barton
cde99075e8 GHOST/Wayland: add fractional-scale interface support
Previously, fractional scaling was detected but set an integer buffer
scale which the compositor would down-scale causing blurry output.

Now the fractional scaling interface is used when available to set the
DPI and set the internal buffers size & viewport transformation to
ensure 1:1 pixels from Blender to the Wayland output.

Tested to work with multiple monitors with mixed
fractional/non-fractional scale.

Note that this change causes a regression for when fractional scaling
is set on a compositor without support for fractional-scale-v1.
Supporting fractional scaling in both cases is possible but overly
complicated. This case already wasn't working so well - with blurry
output due to image scaling, now the DPI wont be accurate in this case
although Blender is still usable.
2023-03-31 13:03:50 +11:00
Campbell Barton
75127f9b09 Build: upgrade wayland protocols to 1.31
Needed for fractional-scale-v1 protocol.
2023-03-31 13:02:54 +11:00
Campbell Barton
a9d15ee8a0 Cleanup: pass rect as a constant pointer 2023-03-31 13:02:53 +11:00
Hans Goudey
498287bca0 Cleanup: Geometry Nodes: Split modifier property update function
It's a bit easier to follow this way, and we can make better use of
const. It's also more reusable in case we have to use it elsewhere
too (for node group operators?).
2023-03-30 18:51:33 -04:00
Hans Goudey
3d5ba79050 Cleanup: Use const arguments for IDProperty functions 2023-03-30 18:51:33 -04:00
Chris Blackbourn
ed0e4f4043 UV: refactor uv packing, reduce usage of #BoxPack
No functional changes.
2023-03-31 10:09:48 +13:00
Hans Goudey
cbb813886c Geometry Nodes: Simplify retrieval of node dependencies
Use checks for certain node types with better algorithmic complexity.
They should perform better in some edge case with a lot of nodes or
node group nesting. They're now a bit more similar to each other too.
2023-03-30 16:30:23 -04:00
Brecht Van Lommel
76e0ca6b91 Build: suppress CMake warnings about newer Boost versions
This is the only package that warns about this type of thing, and gets in the
way of actual warnigns on build logs. This requires CMake 3.19+ to take effect,
older versions still show the warnings.
2023-03-30 22:29:14 +02:00
Chris Blackbourn
40f050aadc UV: simplify packing usage of #BoxPack
No functional changes.
2023-03-31 09:02:01 +13:00
Jason Fielder
f6e89233a3 Workbench: Optimize texture usage flags
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/106229
2023-03-30 21:49:41 +02:00
Jason Fielder
ec94b1da58 Metal: Optimize texture usage in glutil
Ensure compression is enabled by using shader_read
flag only. Also ensure that MTLTexture contents
remain in optimal layout for reading after any
data modifications.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/106234
2023-03-30 21:45:45 +02:00
Brecht Van Lommel
1658b8ab46 Fix Cycles Metal failing when run in parallel, always run serial
The command buffer fails to execute, the cause is unknown. It does not
appear to be related to the binary archive cache as disabling that does
not prevent the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/106328
2023-03-30 19:46:49 +02:00
Sergey Sharybin
55d642ba2f Fix non-deterministic behavior of mask compositor node
The issue was caused by uninitialized offset used for the scale
variable.

Follow the rest of the usages of the operation which initialize
it explicitly. This makes it very safe and easy fix to backport
to any LTS or corrective release.

Ideally should probably initialize all members in the class
itself, to avoid such situations in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/106325
2023-03-30 18:57:22 +02:00
Jacques Lucke
a145d1563a Cleanup: move flip faces code from nodes to geometry module 2023-03-30 18:44:11 +02:00
Jacques Lucke
55d473ee40 Cleanup: use better default name for unknown parameter
The `<` and `>` don't work well when the name is inserted into a .dot graph.
2023-03-30 18:44:11 +02:00
Lukas Tönne
bdc3f1581d Fix #106261: When geometry output is viewed the cycling operator picks wrong sockets.
The cycling method for the viewer connection starts searching from the next socket
after the last current connection. If a geometry socket is is the last connected
output this caused the method to jump to the next socket after the geometry,
potentially skipping over valid data sockets that are not viewed yet.

The solution is to ignore the geometry sockets in the cycling entirely and only
consider data sockets (i.e. non-geometry sockets).

Pull Request: https://projects.blender.org/blender/blender/pulls/106318
2023-03-30 16:56:56 +02:00
Bastien Montagne
8785862ee4 Replace install-deps bash script by a python one, and only handle distro packages.
This tool now only supports installing packages, it won't build any
dependency anymore. This implies that on most distributions, it wont
make a complete Blender build possible, some features will likely be
misisng.

By default, it only install basic dev environment to enable building
Blender with the precompiled libraries (which is the recommended way).

Passing the `--all` option will make it try to install all known
dependencies from distro packages. This is a development option,
regular Blender build should be done with the precompiled libraries.

Tested on Debian Testing, Arch, Fedora and Suse Tumbleweed.

With the new design, it should be fairly trivial to add more
distributions if desired, and maintenance should also be way simpler.

NOTE: side effect is that a working python3 interpreter is expected on
system running this script. In practice this should not be an issue,
since Python3 is installed by default in almost all regular desktop
linux installations.
2023-03-30 16:30:45 +02:00
Christoph Lendenfeld
be733c240e Animation: Insert Keyframe only on active FCurve
The insert key operator allowed to insert a keyframe on all selected FCurves
and on the Active FCurve at cursor value.
But it didn't allow to insert a keyframe only on the active FCurve.

This patch adds that. It is available in the redo panel and under Key->Insert Keyframes (which can also be called with the I hotkey)

Pull Request: https://projects.blender.org/blender/blender/pulls/106307
2023-03-30 16:29:50 +02:00
Sergey Sharybin
12b001ebce Fix OBJ tests using release folder
This change aimed to solve the following issues:

- Possible threading issue of two tests writing to the same
  file, depending on how the ctest is invoked

- Test using the release directory, and potentially leaving
  temp file behind on test failure, breaking code sign on
  macOS.

Pull Request: https://projects.blender.org/blender/blender/pulls/106311
2023-03-30 15:55:01 +02:00
Sergey Sharybin
8f1925c2f6 Cleanup: make format 2023-03-30 15:28:21 +02:00
Hans Goudey
f9b9430982 Fix: Crash when loading 3.4 autosave file
The MVert to float3 vertex position conversion was skipped using
the wrong case, mesh->mvert wasn't always set when writing
apparently.
2023-03-30 08:37:05 -04:00
Hans Goudey
80319035e6 Fix: Debug assert extracting multiple UV maps in edit mode 2023-03-30 08:24:29 -04:00
Philipp Oeser
7eda8e5367 Fix: unnecessary edge pan updates
Found together with a fix for #106043.

Edge panning (in Node Editors, Outliner and VSE) does unnecessary
updates when the view has not changed at all. This includes adding
`MOUSEMOVE` events (even if you dont move the mouse at all).

Adding `MOUSEMOVE` events results in the transform system constantly running (even if you dont move the mouse) which we certainly want to avoid.

Rectify this by only calling these updates when the view changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/106301
2023-03-30 14:08:57 +02:00
Philipp Oeser
2a6f177e8e Fix #106043: Moving frame node jittering while cursor is still
The fix for #105363 (6d3ce8273a) made the transform system respect
(Frame) nodes `offsetx`/`offsety`.

Now Node Editors run the transform system even if the mouse is still (due to edge panning -- unnecessarily, see PR #106301 for fixing this). And due to the way `frame_node_prepare_for_draw` recalculates these offsets (based on
on updated positions and `node.runtime->totr` [which in turn gets rounded in `node_update_basis` -- so subpixel precision is lost there, see [1]]), this can lead to slight imprecisions/noise/jitter during transform (if we use float offsets, see the PR for more info).

So to counter this, use rounded offsets now [which will keep the whole circle stable].

NOTE: PR #106301 would fix this already for having the cursor still, but this patch still improves slight jitter when moving, so will commit separately.

[1] comment from `node_update_basis`
> /* Round the node origin because text contents are always pixel-aligned. */

Pull Request: https://projects.blender.org/blender/blender/pulls/106096
2023-03-30 14:02:45 +02:00