Commit Graph

122936 Commits

Author SHA1 Message Date
Ray molenkamp 17800e0c03 CMake/Win: use manifest for PLATFORM_BUNDLED_LIBRARIES
`PLATFORM_BUNDLED_LIBRARIES` was installing right next to the blender
executable rather than the `blender.shared` folder,
`PLATFORM_BUNDLED_LIBRARIES` wasn't used very much on windows, just
by the ONEAPI code which likely wasn't aware this plumbing was
still missing.

This diff adds support for using `PLATFORM_BUNDLED_LIBRARIES` on
windows in both debug and release configurations.

You can differentiate between a .dll being installed for debug/release
or all configurations, by prefixing the library with either `DEBUG`,
`RELEASE` or `All`, if no prefix is given `ALL` is assumed.

Pull Request: https://projects.blender.org/blender/blender/pulls/106348
2023-04-04 20:10:06 +02:00
Clément Foucault 4b15f2158f Cleanup: Cycles: LightTree: Fix warning about unused variables 2023-04-04 20:01:55 +02:00
Omar Emara 1ae54bb4fd Fix MSVC C1001 error after texture sampler refactor
This patch fixes the MSVC C1001 error that was introduced after
ff3b2226fb.

Pull Request: https://projects.blender.org/blender/blender/pulls/106554
2023-04-04 18:20:44 +02:00
Martijn Versteegh 412b6a8f65 Fix #106430: Index the right UVmap in BMesh
When accessing UVmaps from python in BMesh, the UVmap name/index was ignored
and the active UVmap always used. This fixes this by passing the layer index
to the underlying CustomData function.

Pull Request: https://projects.blender.org/blender/blender/pulls/106537
2023-04-04 18:10:11 +02:00
Hans Goudey 7adea7ee15 Cleanup: Removed DerivedMesh triangle cache
This was only used in a single place, multires baking, where it's simple
to just retrieve the looptris from the temporary `Mesh` that we already
create to simplify accessing normals. This allows removing a bunch of
complexity from `DerivedMesh`, to help progress towards its complete
removal at some point in the future.

Also use `Span` more instead of raw pointers in multires baking,
and pass around the spans instead of the low-resolution DerivedMesh.
2023-04-04 11:26:14 -04:00
Hans Goudey 85bd64ece4 Fix: Crash and broken multires baking
Caused by 16fbadde36. The first mistake was passing a pointer
to a poly to what was meant to be the pointer to the start of the array.
Use Span instead to avoid that confusion. The second was a logic error
in CCGDerivedMesh's lazy initialization of corner data. The data was
copied when the mesh is created so it wasn't initialized.
2023-04-04 11:16:04 -04:00
Hans Goudey 547f0d5dab Cleanup: Use const arguments for DerivedMesh functions 2023-04-04 11:11:54 -04:00
Weizhen Huang 87cbdcbe7c Refactor: move part of light tree logic from #LightManager to #LightTree 2023-04-04 16:24:21 +02:00
Weizhen Huang e58a05ca68 Refactor: renaming a few light-tree-related variables
primitives -> emitters, `index` -> `node_index`
2023-04-04 16:24:21 +02:00
Jeroen Bakker 6f60b09f51 Vulkan: Enable Step-by-Step Debugging in Renderdoc.
This PR adds debug information inside the spir-v assembly to enable
step-by-step debugging of Shaders using renderdoc. The debugging
information can be fairly large so are only generated when used
with the `--debug-gpu-renderdoc` feature.

During debugging shader optimizations are turned off.

Pull Request: https://projects.blender.org/blender/blender/pulls/106546
2023-04-04 15:58:41 +02:00
YimingWu f94599c095 Fix #106478: Missing xray check in snapping
Regression caused by 98bfa8d458

The `XRAY_ENABLED(v3d)` check was lost during a modification to
`transform_snap_context_project_view3d_mixed_impl` function.

This caused vertex snapping in solid shading to jump between visible
and occluded faces.

Pull Request: https://projects.blender.org/blender/blender/pulls/106495
2023-04-04 15:40:48 +02:00
Omar Emara ff3b2226fb GPU: Refactor texture samplers
This patch refactors the texture samples code by mainly splitting the
eGPUSamplerState enum into multiple smaller enums and packing them
inside a GPUSamplerState struct. This was done because many members of
the enum were mutually exclusive, which was worked around during setting
up the samplers in the various backends, and additionally made the API
confusing, like the GPU_texture_wrap_mode function, which had two
mutually exclusive parameters.

The new structure also improved and clarified the backend sampler cache,
reducing the cache size from 514 samplers to just 130 samplers, which
also slightly improved the initialization time. Further, the
GPU_SAMPLER_MAX signal value was naturally incorporated into the
structure using the GPU_SAMPLER_STATE_TYPE_INTERNAL type.

The only expected functional change is in the realtime compositor, which
now supports per-axis repetition control, utilizing new API functions
for that purpose.

This patch is loosely based on an older patch D14366 by Ethan Hall.

Pull Request: https://projects.blender.org/blender/blender/pulls/105642
2023-04-04 15:16:07 +02:00
illua1 d0604a1bb2 Fix #106530: Don't try to move unmovable node socket values
Missing checkings for unsupported cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/106545
2023-04-04 14:23:40 +02:00
Jeroen Bakker 96c8fcde0f Vulkan: Reduce Macro Unrolling In GLSL.
Related to #106535 where a similar fix was done for OpenGL. A small
cleanup that might reduce the complexity during GLSL shader compilation.

Pull Request: https://projects.blender.org/blender/blender/pulls/106538
2023-04-04 14:04:09 +02:00
Jeroen Bakker 09effd579b Renderdoc: Use Main Context Workaround.
Renderdoc requires all calls/updates to originate from the same
context. It also doesn't support multithreading. For now we
enable main context workaround.
2023-04-04 13:27:41 +02:00
Jeroen Bakker fc46d6408f GPU: Use --debug-gpu-renderdoc For Renderdoc Integration.
The renderdoc integration used to be behind the `--debug-gpu`
command line option. When using `--debug-gpu` outside renderdoc
error messages where displayed that aren't relevant.

This PR adds a specific command line option for the renderdoc
integration. This option will also enable `--debug-gpu`.

Pull Request: https://projects.blender.org/blender/blender/pulls/106541
2023-04-04 12:46:47 +02:00
Weizhen Huang d872240983 Fix #106528: light tree nodes could have a NaN axis
Caused by collinear vectors not detected due to numerical issue.
2023-04-04 12:40:28 +02:00
Jeroen Bakker d030d12d7b Vulkan: Fix Compilation Error on Windows Platforms.
Automatically conversion not working. Replacing `begin` with
`data` would solve this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/106539
2023-04-04 12:13:01 +02:00
Philipp Oeser 58c54b5859 Fix #106396: UV stitch crash with hidden faces
This was the case with hidden faces and `Sync Selection` turned ON.

Caused by 8f543a73ab.

Since 8f543a73ab, the UV element map
respects the hidden state of geometry, but stitching [which also
respected this on its own even prior to the culprit commit in its
calculation of connectivity] did this differently [it only skipped
hidden geo when UV_SYNC_SELECTION was OFF -- even though UVs would not
be visible which is probably the real error here, I believe there is
this principle that we "dont act on stuff we dont see"].

To fix this, also skip hidden geo (even with UV_SYNC_SELECTION = ON) in
the stitch calculation of connectivity, just as
`BM_uv_element_map_create` does it.

Should go into 3.3 LTS as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/106493
2023-04-04 12:10:30 +02:00
Campbell Barton f2f8884f95 CMake: reset WAYLAND_PROTOCOLS_DIR when it's missing the reference XML
Depending on newer API's could cause build failure for existing
builds using wayland-protocols outside of Blender's 'lib' directory.
Now the existence of the most recent XML file is checked on each CMake
execution, resetting the cache when not found so the protocols in
`../lib/linux_x86_64_glibc_228/` will be used instead.
2023-04-04 19:15:00 +10:00
Damien Picard cf9f3919a8 I18n: fix add-on extraction when UI code appears in __init__.py
The function which collects files to process in add-on extraction
returned only files that did not start with '_', in the case where the
add-on was a module in a directory. This excluded __init__.py, which
may very well contain UI code, so an exception is added for this case.

This change currently allows the extraction of 42 new messages.
2023-04-04 10:07:02 +02:00
Campbell Barton 648417bfff GHOST/Wayland: improve internal fractional scaling behavior
Logic for the recently included fractional scaling support [0] was
difficult to reason about as it depended on two different callbacks
one that listened to a preferred scale, another that tracked which
physical displays the window overlapped.
Checking if fractional scaling was in used depended on the order
the callbacks ran - which is undefined.

In practice - mixing non-fractional and fractional displays would
flicker when the window was moved between monitors.

Resolve this problem with the following changes:

- When the fractional-scale manager is supported,
  only respond to the scale from it's preferred_scale callback.
- When no fractional-scale manager is available,
  set the scale based on the scale of overlapping outputs.
- Add support for postponing the buffers commit call to prevent
  flickering when changing the windows scale.

Other changes:

- Use a lock before setting the pending frame state from
  wp_fractional_scale_handle_preferred_scale.
- Ensure pending actions that themselves trigger pending actions
  run in the time gwl_window_pending_actions_handle is called.
- Rename GWL_Window::scale -> GWL_WindowFrame::buffer_scale.

[0]: cde99075e8
2023-04-04 17:35:42 +10:00
Campbell Barton 95ffc4ba3a GHOST/Wayland: remove fractional-scale ifdef's
Depend on fractional-scale when searching for wayland-protocols

This will impact builders that don't use Blender's `../lib/` and
have wayland-protocols older than v1.31.
2023-04-04 17:26:37 +10:00
Campbell Barton d2ad00d0f5 Cleanup: remove unused RenderData::stereomode 2023-04-04 17:26:37 +10:00
Campbell Barton ececd71fb2 Cleanup: remove references to the Blender Game Engine Player 2023-04-04 17:26:37 +10:00
Iliya Katueshenock b5a7724262 Fix #105268: Avoid creating redundant dependencies for the lattice modifier
For some reason, lattice modifier always depend on self object transform.
This fix just move extra dependencies in to if case statement, also some
cleaning of this code area.

Pull Request: https://projects.blender.org/blender/blender/pulls/105293
2023-04-04 09:25:51 +02:00
Sergey Sharybin b1bf1db656 Fix `source_archive` ignoring addons
Caused by the changes in the submodules configuration.

Can no longer rely on the `git submodule` command to
show list of external references to be packed.

Needs to be backported to 3.5.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/106502
2023-04-04 09:14:58 +02:00
Philipp Oeser e952083652 Fix #105989: Outliner: Make Single User duplicates data
This happens even though there is only one user.

The Outliner only implements this `Make Single User` for worlds
(`singleuser_world_fn`) and actions (`singleuser_action_fn`) [it is
questionable if the whole functionality could be removed really, but
this is for another report] and it uses `id_single_user` to do so --
this function does not check if we even have more than one user though,
so data gets duplicated resulting in duplicate worlds or actions even if
they only have one user and shouldnt be touched.

Now let `id_single_user` check usercount and only act if we have more
than one real users.

Pull Request: https://projects.blender.org/blender/blender/pulls/105991
2023-04-04 09:12:37 +02:00
Harley Acheson 14b112ef82 Fix #106422: Mesh Data Attributes Using tip_ for iface_
pgettext_tip incorrectly imported as iface_ instead of importing
pgettext_iface. These leads to incorrectly translated attribute text
shown when the user elects to translate only tooltips.

Pull Request: https://projects.blender.org/blender/blender/pulls/106507
2023-04-03 20:55:22 +02:00
Richard Antalik 3e8f85c743 Fix: VSE Channels region unhides when changing font
Caused by filebrowser calling space `refresh` function. The intention of
refresh function was mainly to hide channels when view type is changed.
Unhiding channels when view is changed back seems logical, but this
causes issues when region is too thin, which results in hiding side
panel, which is more important.
2023-04-03 19:46:10 +02:00
illua1 9726e4a0ad Nodes: Move data-block default values with link drag search
When creating nodes by dragging a link, it can be convenient to
transfer values from input socket. For reference values, like images,
this may be necessary to avoid unnecessary data-block users. This
patch starts adding such a system. At this moment this only makes sense
for one node (Image Input), but this can be extended to work with other
reference types, different non-reference types and support auto-casting
(if a float is transferred to the Integer Input node).

See task: https://projects.blender.org/blender/blender/issues/102854
Original patch: https://archive.blender.org/developer/D16735

Pull Request: https://projects.blender.org/blender/blender/pulls/105972
2023-04-03 19:33:39 +02:00
Hans Goudey e7f395dd20 Nodes: Add dropdown to select group socket subtype
Previously the only way to control the subtype was to remove the group
input or output and create it again. This commit adds a dropdown to
change an existing socket, for supported socket types.

Based on a patch by Angus Stanton: https://developer.blender.org/D15715

It was necessary to fix the UI code slightly; the layout's context
wasn't being used in calls to an operator's enum items callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/105614
2023-04-03 18:23:30 +02:00
Brecht Van Lommel 4cb670e68f Fix #105148: Cycles Metal memory leak on AMD GPU
After NanoVDB support from 02c2970982, this line should not have been
removed.
2023-04-03 18:18:01 +02:00
Hans Goudey 7a1ec82af4 Cleanup: Remove poly normal writing
The potential optimization in the normal edit modifier when flipping
faces isn't worth the "API impurity" and complexity introduced by
adding poly normal editing as part of the API. This change simplifies
future changes to the ownership of poly normals with a shared cache,
which can prevent recomputing poly normals completely.
2023-04-03 12:11:21 -04:00
Welp e76f4d9f9a Mesh: Use more efficient update tag when flipping faces
Vertex positions and faces aren't changed, so most caches shouldn't
need to be tagged. This removes unnecessary re-computation of bounds,
triangulation, loose edges, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/106250
2023-04-03 18:01:16 +02:00
Richard Antalik da6dfc2b43 VSE: Clarify why frame range is drawn differently than in other editors. 2023-04-03 17:44:04 +02:00
Brecht Van Lommel 45f7e2b6ba Fix Snap package error on startup in older Linux version
With the new glibc requirement, the core version needs to be increased.
2023-04-03 17:32:35 +02:00
Brecht Van Lommel dbf1049d41 Cycles: bump version to 3.6.0 2023-04-03 17:32:35 +02:00
Brecht Van Lommel 861debcb10 Fix Cycles standalone and Hydra build issues in some configurations
Bring the build in sync with the Cycles standalone repo.
2023-04-03 17:32:35 +02:00
Alex Fuller 4f0092c1ff Refactor: add native Cycles Normalize option on lights for Hydra
Make it a native Cycles light option instead of counter-acting the inverse
area calculation in Hydra.

Differential Revision: https://developer.blender.org/D16838
2023-04-03 17:23:46 +02:00
Alex Fuller 945579c203 Fix Cycles build issue with USD 23.02
HdRenderDelegate got a change with the interface, adding gpuSupported. It
currently is just a dummy implementation without checking for anything
GPU-related.

Differential Revision: https://developer.blender.org/D17207
2023-04-03 17:23:46 +02:00
Alex Fuller cbf3bd0efc Fix Cycles missing geometry header in object header, causing crashes
The problem is that `set_geometry()` otherwise ends up implicitly
casting `Geometry*` to bool. In Blender this worked because the
geometry header was always included before the object header.

Differential Revision: https://developer.blender.org/D16737
2023-04-03 17:23:46 +02:00
Nate Rupsis 8833f5dbf9 Animation: Allow NLA strips to be horizontally shuffled
Allows NLA strips to horizontally translated over each other. If a strip is dropped when translating, it'll cause the strip to shuffle into place.

---

Abstracted large conditional branch in `recalcData_nla` into it's own `nlastrip_fix_overlapping` method for increased readability. No logical changes were made.

---
[Archived Phabricator Patch](https://archive.blender.org/developer/D10102)

Pull Request: https://projects.blender.org/blender/blender/pulls/105532
2023-04-03 17:10:37 +02:00
Hans Goudey 4bcd59d644 Cycles: Avoid overhead from RNA when extracting mesh data
Use raw Blender structs and mesh data rather than using the RNA API.
There isn't any benefit from using the RNA when Cycles is compiled
with Blender anyway, and a profile showed that the majority of time
was spent in Blender RNA API functions.

This gives a significant improvement in performance when ingesting
meshes. Here are some tests of the runtime of the `create_mesh`
function (in seconds):

|                           | Before | After |
| ------------------------- | ------ | ----- |
| Grid                      | 0.66   | 0.11  |
| Many realized cubes       | 2.60   | 0.48  |
| Large curve to mesh setup | 4.18   | 1.14  |

Also change to resizing the arrays and filling them by index rather
than appending. This makes the parallel aspect of the logic clearer,
and makes the loops easier to parallelize in the future, and makes
it easier to have a performance benefit when an attribute like
`sharp_face` doesn't exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/106275
2023-04-03 17:04:58 +02:00
Germano Cavalcante 1380ee74ff Overlay: use edge-connected polygons to calculate wireframe factor
Use the dot product of the normal of the two polygons connected to the
edge to calculate the edge factor.

This fixes #90641 and #102545 and ensures more predictable results for
boundary and non-manifold edges.

Co-authored-by: Germano Cavalcante <mano-wii>
Pull Request: https://projects.blender.org/blender/blender/pulls/105352
2023-04-03 16:22:41 +02:00
Germano Cavalcante d1fe11c79f DRW: remove edges hidden by Optimal Display in IBO creation
No functional changes.

Edges hidden by Optimal Display are hidden by edge factor Shader.
But there is not much advantage in doing this, as the number of edges
hidden by the Optimal Display is usually much higher than the number of
visible edges.

And the lines extractor does not include invisible edges due to other
factors.

So this change makes:
- Visibility test more consistent with what is actually seen.
- Smaller buffer for IBO sent to GPU
- consistency with GPU Subdivision that already considers Optimal Display
- Allows possible improvement in the "Edge Factor" extraction by making
it unnecessary to check the Optimal Display (except for optimization).

Co-authored-by: Germano Cavalcante <mano-wii>
Pull Request: https://projects.blender.org/blender/blender/pulls/106402
2023-04-03 15:59:41 +02:00
Damien Picard d1ec8a2ae5 I18n: translate popover descriptions
Popover menu buttons had their labels translated but not their
descriptions, although they were properly extracted.

This commit fixes that using the `TIP_()` macro.
2023-04-03 15:55:48 +02:00
Damien Picard da764ee357 I18n: translate viewport grid unit
This information is displayed in the top left of the 3D Viewport with
other text info. The units of the grid are already extracted, but they
were not translated in the drawing code.
2023-04-03 15:28:16 +02:00
Bastien Montagne e4cd7d2fed Updated translations from SVN trunk (r6419). 2023-04-03 12:58:50 +02:00
Bastien Montagne e05010b2f2 Cleanup: make format on new install_linux_packages py script.
Also some minor fixes to generator for version numbers of packages.
2023-04-03 12:00:13 +02:00