Commit Graph

126005 Commits

Author SHA1 Message Date
Clément Foucault
11e2ca4b70 GPU: Fix compilation warnings
Warnings caused by 1978b4fc929b9b2973d974739a8b05268a404a60
2023-07-11 11:08:06 +02:00
Clément Foucault
1978b4fc92 GHOST: Replace WITH_OPENGL build option
Replaces it by WITH_OPENGL_BACKEND and cleanup its usage.
Limits visibility of opengl enums and cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/109947
2023-07-11 09:17:31 +02:00
Jason Fielder
232d763af4 Fix #109389: Resolve Z-fighting artifacts in Metal
Resolves z-fighting artifact on Apple Silicon.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/109922
2023-07-11 09:07:21 +02:00
Jason Fielder
ac708cb33a Fix #106905: Increase OS version requirement for Metal on Intel
Certain feature requirements unsupported by older OS builds
caused failures when running Intel GPUs on older OS's.

This patch increases the minimum required OS version
to one which covers devices supporting all required features.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/109921
2023-07-11 09:03:47 +02:00
Campbell Barton
74c7615dba Cleanup: use function style casts for C++ 2023-07-11 15:15:09 +10:00
Campbell Barton
4333051f4d WM: pass the window manager & window to WM_report_banner_show
Avoid potential problems when the active window is known but not
assigned to `wm->winactive`, where the first window would be used
as a fallback. Instead, take a window argument, a fallback is still
used as a last resort (when NULL).
2023-07-11 14:42:24 +10:00
Campbell Barton
36b2291610 Cleanup: spelling in comments 2023-07-11 14:40:47 +10:00
Germano Cavalcante
7aa31c884d Mesh: Merge by Distance: Remove unnecessary array
The `groups_map` array (which indicates the group an element belongs
to) is only intended to reduce loops when creating groups, speeding up
that part of the code.

But on the downside, it requires more memory usage, and adds one more
step to access groups (`groups_offs[groups_map[i]]` instead of just
`groups_offs[i]`).

So removing that array decreases memory usage and speeds up access in
another part of the code.

The profile showed a +6% advantage when the Weld modifier affects large
portions of the mesh.

But it also showed a loss of around -0.6% in performance for cases
where the Weld modifier affects small parts of the mesh.

The biggest benefit is to save memory and speed up some cases.
2023-07-11 00:40:08 -03:00
Campbell Barton
bef652c432 Cleanup: prefer terms backup/restore over capture/restore
The term capture is associated with video/screen capture.
Prefer the term backup as it's clear that information is stored
to support restoring it later.
2023-07-11 13:23:36 +10:00
Campbell Barton
1ec1e783cc Cleanup: consistent naming for wmTimer API
Word ordering for wmTimer API wasn't consistent.

- Use "WM_event_timer_" / "WM_event_timers_" prefix.
- Rename "wm_window_timer" to "wm_window_timers_process"
  because it wasn't clear what the function did from its name.
- Rename "wm_window_process_events" to "wm_window_events_process"
  for consistency with "wm_window_timers_process".
2023-07-11 13:16:04 +10:00
Campbell Barton
6be0c90eab Fix #109953: Timers without an associated window leak memory on exit
Thanks to @mod_moder & @Harley for their investigation, see !109603.
2023-07-11 12:52:34 +10:00
Campbell Barton
8a73c36643 Fix #109952: Unknown engine warning only shown when loading from a popup
Displaying the warning on file load depended on `wm->winactive`
being set, and didn't work when loading a file from the file-open
window or when loading files using a command-line argument.

Resolve using the first window as a fallback.
This happens to resolve #109770, although not freeing timers on exit
is likely to be an issue under other circumstances.
2023-07-11 12:21:04 +10:00
Campbell Barton
6239246c9c Cleanup: quiet class-memaccess warning 2023-07-11 12:21:02 +10:00
Germano Cavalcante
e9aba52f42 Fix wrong usage of 'accumulate_counts_to_offsets'
Error in 1457c0c533.
2023-07-10 21:59:00 -03:00
Germano Cavalcante
1457c0c533 Cleanup: Tweaks to the Mesh Merge by Distance code
- Improve comments
- Rename variables
- Reduce indentation
- Use `const` types
- Use `OffsetIndices` API

Pull Request: https://projects.blender.org/blender/blender/pulls/109919
2023-07-11 01:59:25 +02:00
Ray Molenkamp
3046b0a19e CMake: Fix shader_builder build error
Problem introduced in 57ad866d81daff62c1035cfe7e1ae6257b0a91d5
as I didn't build with this option on.
2023-07-10 17:08:13 -06:00
Hans Goudey
6d74a7173e Cleanup: Remove unused function 2023-07-10 16:23:04 -04:00
Hans Goudey
5ca29d293b Fix: BLI: Assert in generic array move constructor
When assigning a default constructed virtual array,
an assert checking for a non-null type was triggered.
2023-07-10 16:22:55 -04:00
Ray Molenkamp
04235d0e55 Cleanup: CMake: Modernize bf_blenlib dependencies
Pretty straightforward

- Remove any blenlib paths from INC
- Add a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109934
2023-07-10 22:04:18 +02:00
Germano Cavalcante
093a4d63f3 Cleanup: Move some space_view3d files to C++
See: #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/109936
2023-07-10 21:48:38 +02:00
Hans Goudey
3d383d383f Cleanup: Use C++ Array types for Edit Mesh SoA cache
This helps const correctness since the data can't be changed from a
const EditMeshData struct, and simplifies memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/109821
2023-07-10 19:49:54 +02:00
Iliya Katueshenock
94914d12f3 Fix #109341: Try to store single value fields as single in simulation
Sampling nodes produce fields, but can be used for
single values. If this used in simulation, this will not work
correctly, not similar as other singles. Just compute these
fields as single to store in Simulation Output node.

Pull Request: https://projects.blender.org/blender/blender/pulls/109879
2023-07-10 19:11:06 +02:00
Ray Molenkamp
57ad866d81 Cleanup: CMake: Modernize bf_guardedalloc dependencies
Pretty straightforward

- Removes any guardedalloc paths from INC
- Adds a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109925
2023-07-10 18:44:19 +02:00
Iliya Katueshenock
fc58d92acb Fix #99569: Socket type drawing of custom type in view template
Socket type drawing of custom type in view template.

Pull Request: https://projects.blender.org/blender/blender/pulls/109871
2023-07-10 18:22:01 +02:00
Iliya Katueshenock
a8186e1542 Fix #109885: Check if BVH tree is null in correct place
The `BKE_bvhtree_from_pointcloud_get` function have requirements for
input point cloud argument and initialization of `BVHTreeFromPointCloud`
can be skipped. Due to `BVHTreeFromPointCloud` is not initialized by
default constructor, it can contains garbage data. To check if tree is
initialized field of `BVHTreeFromPointCloud`, return argument shouldn't
be ignored. `[[nodiscard]]` attributes is added.

Pull Request: https://projects.blender.org/blender/blender/pulls/109892
2023-07-10 18:12:41 +02:00
Hans Goudey
5c4694759b Cleanup: Return corner normal space by value 2023-07-10 12:04:33 -04:00
Hans Goudey
3fc45d6151 Cleanup: Use C++ types, references for custom normals
Also remove unnecessary namespace specification.
2023-07-10 12:04:33 -04:00
Hoshinova
41335edf22 Fix #109254: Voronoi distance output is clamped at 8
The Voronoi distance output is clamped at 8, which is apparent for distance
metrics like Minkowski with low exponents.

This patch fixes that by setting the initial distance of the search loop to
FLT_MAX instead of 8. And for the Smooth variant of F1, the "h" parameter is set
to 1 for the first iteration using a signal value, effectively ignoring the
initial distance and using the computed distance at the first iteration instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/109286
2023-07-10 17:42:24 +02:00
Clément Foucault
b65dfb26f9 EEVEE-Next: Shadow Tag: Fix uv calculation 2023-07-10 17:04:06 +02:00
Dalai Felinto
9e3bd8a2d0 Fix gitea inactive script duplicated results
Although we had only 190 developers, the script
was accusing a total of 365 developers (with 188 inactive).

There were two problems here:
* The gitea API was only using the `limit` paramater when an explicit
  page was passed.
* There was a bug with the get_next_page code, that would skip the last
  page.

I now made the page always an explicit argument passed to fetch_single.

With this fix we now get: 190 developers with 98 inactive.
2023-07-10 17:00:58 +02:00
Joseph Eagar
fc10d04187 Cleanup: remove unused variables 2023-07-10 07:35:55 -07:00
Sergey Sharybin
d579ac2b3f Refactor: Use ImBuf to store passes in RenderResult
Doing so avoids having duplicated logic for working with pixel
data which is being passed throughout the render pipeline.

Notable changes:

- ImBug can now store GPU texture.
  This is not very finished part of the API, which will be
  worked further to support tiling for very-high-res images.

- Implicit sharing is removed from the image buffer, as it is
  no longer needed.

There should be no functional changes on user level with this
change.

Ref #108618

Pull Request: https://projects.blender.org/blender/blender/pulls/109788
2023-07-10 16:33:32 +02:00
Hans Goudey
baf1c79668 Geometry Nodes: Remove assets loading warning from 3D view header
This isn't really helpful at this point, and is ugly/distracting when
starting Blender. It's not that bad if more menus show up with a
bit of a delay anyway.
2023-07-10 10:09:46 -04:00
Hans Goudey
80f105e924 Fix #109462: Incorrect "No Cache" simulation cache invalidation
The "No Cache" simulation nodes option effectively changes the cache
to work in a "realtime mode" where there are only two states, the
current and previous frame. Whenever the current frame doesn't
increase, the previous state should reset. This didn't happen
properly, and it was hard to verify because the code was shared
with the regular "cache on" mode.

Instead, separate the caching more in the code, using a different
struct to store the two "realtime" states. Also clarify that we
don't support animation of the "No Cache" option by disabling
support for that in RNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/109741
2023-07-10 16:02:31 +02:00
Bastien Montagne
fa29d28d73 Fix #109889: Trying to append/link from the current file does give proper error message.
Logic in FileBrowser and/or `BKE_blendfile_library_path_explode`
probably changed at some point, and the generic 'invalid filetype' error
message was reached before the path is compared to current blendfile path.
2023-07-10 15:58:36 +02:00
Jeroen Bakker
d1884e01c8 Cleanup: make format 2023-07-10 15:52:10 +02:00
Ray Molenkamp
7cebb61486 Cleanup: CMake: Modernize bf_dna dependencies
There's quite a few libraries that depend on dna_type_offsets.h
but had gotten to it by just adding the folder that contains it to
their includes INC section without declaring a dependency to
bf_dna in the LIB section.

which occasionally lead to the lib building before bf_dna and the
header being missing, while this generally gets fixed in CMake by
adding bf_dna to the LIB section of the lib, however until last
week all libraries in the LIB section were linked as INTERFACE so
adding it in there did not resolve the build issue.

To make things still build, we sprinkled add_dependencies wherever
we needed it to force a build order.

This diff :

Declares public include folders for the bf_dna target so there's
no more fudging the INC section required to get to them.

Removes all dna related paths from the INC section for all
libraries.

Adds an alias target bf:dna to signify it has been updated to
modern cmake

Declares a dependency on bf::dna for all libraries that require it

Removes (almost) all calls to add_dependencies for bf_dna

Future work:

Because of the manual dependency management that was done, there is
now some "clutter" with libs depending on bf_dna that realistically
don't. Example bf_intern_opencolorio itself has no dependency on
bf_dna at all, doesn't need it, doesn't use it. However the
dna include folder had been added to it in the past since bf_blenlib
uses dna headers in some of its public headers and
bf_intern_opencolorio does use those blenlib headers.

Given bf_blenlib now correctly declares the dependency on bf_dna
as public bf_intern_opencolorio will get the dna header directory
automatically from CMake, hence some cleanup could be done for
bf_intern_opencolorio

Because 99% of the changes in this diff have been automated, this diff
does not seek to address these issues as there is no easy way to
determine why a certain dependency is in place. A developer will have
to make a pass a this at some later point in time. As I'd rather not
mix automated and manual labour.

There are a few libraries that could not be automatically processed
(ie bf_blendthumb) that also will need this manual look-over.

Pull Request: https://projects.blender.org/blender/blender/pulls/109835
2023-07-10 15:07:37 +02:00
Germano Cavalcante
37d1d4cb07 Transform: Support navigation from NDOF devices
This commit implements the `VIEW3D_OT_ndof_orbit`,
`VIEW3D_OT_ndof_orbit_zoom`, `VIEW3D_OT_ndof_pan` and
`VIEW3D_OT_ndof_all` operators to the `ED_view3d_navigation_`
utility so that these operations can be used in the transform
operators.

Pull Request: https://projects.blender.org/blender/blender/pulls/109792
2023-07-10 14:57:40 +02:00
Germano Cavalcante
113004687d Refactor: Mesh Merge By Distance
- Deduplicate code;
- Support no customdata interpolation for edges;
- Reduce number of required elements in context arrays.

With 74772c6920, the merge by distance code for meshes now supports
optional interpolation of custom data for vertices.

As this can be advantageous for performance and memory, it seems
convenient to support the same for edges (and in the future polygons
and corners).

So this commit reworks the code that finds the edge groups to match the
same used for vertices and thus deduplicating and simplifying the code.

Conveniently the `edge_ctx_map` array is no longer needed and can be
removed to save memory.

However it was necessary to create another array (which is usually
smaller) called `double_edges` (to match `double_verts`).

---

**Results:**

The profiling result depends on some factors such as:
- interpolate or not interpolate customdata;
- affect a large or small portion of the mesh;

The best case is when the customdata **is not** interpolated and the operation affects **large** portions of the mesh:

| Before:    | After:     | Factor: |
| ---------- | ---------- | ------- |
| 1256.61 ms | 1073.218 ms| -14.44% |

The worst case is when the customdata **is not** interpolated and the operation affects **small** portions of the mesh:

| Before:   | After:    | Factor: |
| --------- | --------- | ------- |
| 1077.50 ms| 1086.7 ms| +0.85%  |

Pull Request: https://projects.blender.org/blender/blender/pulls/109836
2023-07-10 14:55:38 +02:00
Bastien Montagne
01ca00e073 I18N: Updated UI translations from SVN trunk (r6625). 2023-07-10 14:47:45 +02:00
Bastien Montagne
739146bf33 UI Translations and messages fixes. 2023-07-10 14:34:41 +02:00
Joseph Eagar
351034891e Sculpt: Cleanup duplicate code in clay strips brush
Clay strips was using it's own brush local matrix,
which wasn't quite compatible with texture matrices.
This could lead to brush textures not lining up with
the stroke dabs.

There was also a bug where the stroke was starting
20 pixels into the stroke, which is much higher than
necassary to derive the initial rake angle.

Notes:
* The clay strips brush now uses SCULPT_cube_tip_init
  to calculate the local brush matrix.
* SCULPT_cube_tip_init now accepts custom brush location
  and radius arguments.
* The mouse sample preroll used to calculate initial brush
  rotation angle is now smaller than the update interval.
* Clay strips now supports tip_scale_x, which has also
  been added to DNA defaults.
2023-07-10 05:01:58 -07:00
Iliya Katueshenock
c78b6e9954 Geometry Nodes: Improve Blur node face domain performance
Slight speed up of face topology building for blur node.
Avoid using increment and replacing by adding size.
Multi-threading for accumulating offsets. Early returns
in one place places. In a test with a large grid, the node
became 36% faster, with 13 out of 40 ms saved from
the topology building.

Pull Request: https://projects.blender.org/blender/blender/pulls/109764
2023-07-10 13:47:29 +02:00
Jeroen Bakker
ba82b9c47e Fix: Eevee-next Looses Reflective World Light When Switching Shading Modes
When switching shading between material preview and solid modes, the
world reflective light could become uninitialized. The reason was that
the world was only updated when they actually changed. When switching
it might not be the case that the world changed and the world probe
wasn't uploaded to the texture.

This fix will reduce the locations where this information was stored
(removing the `do_world_update` attribute in `ReflectionProbeModule`).
It also doesn't reset the `do_render` flag during syncing, but post-
pone it to the actual drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/109901
2023-07-10 13:40:47 +02:00
Jacques Lucke
ff4eaeef48 Cleanup: move MOD_nodes.h to C++
All files that use it are in C++ now.
2023-07-10 13:14:36 +02:00
Julian Eisel
d94edda4fd UI: Improve region resize edge detection for transparent regions
For overlapping regions, we currently offset the edge for resizing
regions a bit towards the contents. This makes sense for example in the
sidebar, where the region background is fully transparent by default,
and users expect the edge to be where the visible contents begin. This
was an issue in #104831 for two reasons:
- Although the region overlaps, we decided to make it fully opaque by
  default. The offset is still applied, making the edge detection feel
  broken.
- The offset would also be applied to header-like regions, where there
  is not much padding between the edge and the content. So the edge to
  resize the region would overlap buttons.

2 changes to address this:
- Only apply the offset if the region background is transparent-ish,
  with a rather arbitrary alpha threshold.
- Do not apply the offset for header-like regions.

Pull Request: https://projects.blender.org/blender/blender/pulls/109753
2023-07-10 12:53:41 +02:00
Damien Picard
2f5245b434 I18n: extract single message from multiview stereo
The "Single file with all the views" message was not extracted because
it is an enum item that was not exposed to the RNA, but only
selectable in some cases depending on the
`RNA_def_property_enum_funcs()`.

This commit changes the `RNA_def_property_enum_items()` so that this
enum item is exposed to the RNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/109876
2023-07-10 12:45:52 +02:00
Bastien Montagne
f07fee0188 UI Translations: Add bunch of nissing error messages from IO C++ code and modifiers.
Also fix some incorrect usages of `N_` macro instead of `TIP_` one
(these error messages typically need to get translated explicitely, not
only marked for extraction).
2023-07-10 12:45:28 +02:00
Brecht Van Lommel
f2705dd913 Fix #109683: Cycles and Eevee missing AOVs when no closure connected
No reason to skip these, and this will be useful for faster shader node
preview rendering based on AOVs.

Pull Request: https://projects.blender.org/blender/blender/pulls/109709
2023-07-10 12:41:44 +02:00
Almaz-Shinbay
bfae400ea5 Outliner: Port edit bone elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for edit bone elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/109793
2023-07-10 12:37:15 +02:00