Commit Graph

101640 Commits

Author SHA1 Message Date
Hans Goudey
e4e23bdd73 Cleanup: Sculpt: Remove unnecessary visibility flushing
Face set code modifies visibility of faces, then flushes those changes
to vertex and edge visibility. However, then it did an extra flush back
from vertices to faces and edges, which shouldn't be necessary.
2023-08-01 21:25:38 -04:00
Hans Goudey
12258d4931 Cleanup: Sculpt: Remove unused function to set vert visibility
Unused after ef5f307031. More recently, visibility
is just set at the face level and synced to vertices with generic
Mesh API functions.
2023-08-01 21:20:25 -04:00
Hans Goudey
7114d2efa6 Cleanup: Sculpt: Use utility functions for setting face visibility 2023-08-01 21:15:29 -04:00
Hans Goudey
620a5ebe4a Mesh: Parallelize edit selection and visibility interpolation
Each of the four algorithms is different, and not all of them will
parallelize linearly, but for large meshes these "flushing" operations
begin to become noticeable compared to other multithreaded code.
For example, flushing visibility to vertices and edges after a change
to faces became 3.75x faster, from 90 to 24 ms.

Also avoid duplicating selection interpolation logic, use the attribute
API instead.
2023-08-01 20:51:11 -04:00
Hans Goudey
b54bca9f08 Cleanup: Reduce indentation in pbvh clipping 2023-08-01 18:19:13 -04:00
Hans Goudey
8104d6e95c Cleanup: Simplify some parallel iteration over PBVH nodes
Use `parallel_for` instead of the older task API. A lot of sculpt code
still uses `SculptThreadedTaskData`, so this is just a start.
2023-08-01 18:14:43 -04:00
Hans Goudey
02e0d7717b Cleanup: Remove unused variable in pbvh draw code 2023-08-01 17:30:10 -04:00
Hans Goudey
6806b1c93d Cleanup: Remove unused simulation data-block defaults
Data-block was removed in f3f05daf11.
2023-08-01 15:08:30 -04:00
Kaspian Jakobsson
5a9128af25 Fix #109679: incorrect handling of negative Z normal maps after recent fix
Implement clamped scaling on the Z-axis, so that strength zero means the
normal map has no effect.

Ref #109763
2023-08-01 20:23:12 +02:00
Charlie Jolly
5b80d9bbaf Compositor: Improve link drag search
Add link drag search for Math operations
Add link drag search for Mix operations

Pull Request: https://projects.blender.org/blender/blender/pulls/110575
2023-08-01 20:03:32 +02:00
Hans Goudey
40de15d521 Mesh: Move flip faces function to blenkernel
The aim is to replace the `BKE_mesh_faces_flip` functions with
this newer C++ function using the attribute API. But that is must
be called by RNA, so move this to blenkernel to avoid a circular
dependency between the geometry module and RNA.
2023-08-01 13:08:59 -04:00
Julian Eisel
9048bf6ffd Cleanup: Use enumerator instead of magic number in outliner function
This enum type was introduced a while ago. Better to use it as it
instead of a fixed value with unclear meaning.
2023-08-01 19:04:15 +02:00
Julian Eisel
49adf49bae Fix outliner library override data storage (undefined behavior)
The Library Overrides view of the Outliner was casting a
`TreeElementOverridesData` pointer to an `ID` pointer, which would be
undefined behavior. Make sure it uses the actual ID referenced by the
`TreeElementOverridesData`.
2023-08-01 19:03:36 +02:00
Falk David
162fc23887 GPv3: Use add_new and remove_contained in core
Instead of the default `add` and `remove` functions for the frames map,
use `add_new` and `remove_contained` for when it is known that a value
is or isn't in the map already. This should be slightly more efficient
(and just better practice overall).
2023-08-01 17:56:20 +02:00
Clément Foucault
1e7f27ec55 Fix Realtime Compositor: Broken keying node on MacOS
This was caused by `mod` not being available to integer
types. It isn't part of the GLSL stadard officially.
In this particular case, it is not needed. so replace it
with the `%` operator.
2023-08-01 17:48:57 +02:00
Falk David
de8ce4e34b GPv3: Add user count to drawings
Adds a user count to drawings to track how many frames use the drawing.
If the user count hits `0` the drawing should be deleted.

Also adds a function to delete a frame in a layer. This will
decrement the user count of the drawing and delete it if there are no
users left. This is consistent with the way GPv2 worked.

Pull Request: https://projects.blender.org/blender/blender/pulls/110579
2023-08-01 17:04:39 +02:00
Ray Molenkamp
b4e4030bd6 Cleanup: Format 2023-08-01 08:46:26 -06:00
Anthony
ef00b42982 Fix: failure to open on Windows ARM64 and WSL
This is done by forcing the Mesa D3D12 driver (which both use to render
Blender) to report that it is OpenGL 4.3 compatible.

It mostly is, other than a few texture extensions that are not yet
implemented. Blender (currently) does not use those.

There is a discussion pending with the viewport/evee team on those
extentions

Pull Request: https://projects.blender.org/blender/blender/pulls/110582
2023-08-01 16:36:39 +02:00
Julian Eisel
ebfa6b9f04 Cleanup: Add asserts for Outliner tree element creation
Such asserts are used for other tree element types already, and should
be used in these cases as well. Helps avoiding potential errors.
2023-08-01 16:20:07 +02:00
Sergey Sharybin
fddcbf2d40 Fix missing subversion bump in the previous commit
Pull Request: https://projects.blender.org/blender/blender/pulls/110687
2023-08-01 15:02:27 +02:00
Sergey Sharybin
0a964cf0e1 Color management: Improve non-color managed versioning
Support configurations where there is no dedicated None display
and try to use Raw view of the default display.

This allows to preserve compatibility with old files and the new
upcoming AgX configuration.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110581
2023-08-01 14:58:19 +02:00
Campbell Barton
d260e7f1ce Build: attempt to resolve a linking error on WIN32 2023-08-01 22:56:03 +10:00
Hans Goudey
65591b2c8c Refactor: Retrieve node operator asset with property
In order to more reliably pass the asset to the operator, use a string
property with the full asset path instead of using a context pointer.
This is required to support the quick favorites menu, shortcuts, and
to draw operator inputs in the redo panel. In all of those situations
the original context isn't available. This also feels safer, since we
rely less on storing pointers to data with a less-defined lifetime.

Pull Request: https://projects.blender.org/blender/blender/pulls/110018
2023-08-01 14:54:58 +02:00
Sergey Sharybin
63e2832057 Color management: Remove old name-based exceptions
Historically, the OCIO based color management implementation in Blender
had exceptions to treat specific configurations differently. It was a
compatibility with the legacy "No color management" option.

With time and more development in the area there are better ways of
achieving this goal, if needed.

This commit removes the named-based exception, which also solves confusion
about why certain similar configurations (from OCIO stand point) give
different results. As well as allows to create a cleaner plate for an
upcoming additions in the OCIO configuration such as AgX.

Quite simple and technical change which constant-folds the check for
whether the scene color management enabled or not with "true" value.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110580
2023-08-01 14:39:29 +02:00
Jacques Lucke
09b6eac5c4 Fix #110471: Normal Edit modifier screws up UVs
The issue was that `CustomData_swap` modifies all layers, but does not ensure
that the layers are actually mutable. This resulted in it modifying shared layers.
Now it ensures that the layers are mutable first (which copies the layers if they
are shared).

Longer term, it would be good to remove `CustomData_swap` since it's not a
good API performance wise, but that is outside of the scope of this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/110678
2023-08-01 14:27:16 +02:00
Falk David
8df5968603 GPv3: Add remove_frame function to layers
This core function removes a frame at a specific `start_frame_number`.
It also handles both implicit holds and fixed duration frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/110679
2023-08-01 14:09:12 +02:00
Jacques Lucke
cd74ba6413 Fix #109460: vertex weight slider not working correctly
#109460 was caused by the introduction of implicit sharing for custom
data layers (7eee378eccc8f87e17). Due to implicit sharing, the vertex
weight layer is now shared between the original and evaluated object in
object/weight paint mode, but not in edit mode because of bmesh. For
that reason, the original data has to be copied to be able to edit it, which
causes its pointer to change. `uiDefButF` can't deal with the situation when
the pointer changes on every redraw.

The solution is to just use an intermediate variable that is passed to the
`uiBut` and to update the vertex weight only when the intermediate value has
changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/109665
2023-08-01 13:24:24 +02:00
Campbell Barton
b9d785d0a8 Cleanup: replace NULL with nullptr in freestyle, makesrna & other files 2023-08-01 21:15:52 +10:00
Jacques Lucke
c774cc0cc0 Fix #110041: gizmo stuck in place when playing back animation
The new notifier triggers `WM_gizmomap_tag_refresh` in
`view3d_main_region_listener` which makes sure that gizmos
are updated when playback ends.
2023-08-01 12:53:12 +02:00
Julian Eisel
f671cf0786 Cleanup: Remove unnecessary struct keywords in internal Outliner header
This header is compiled in C++ now which allows us to remove the
`struct` keyword in many places, reducing visual noise.
2023-08-01 12:34:08 +02:00
Julian Eisel
3d6aed39b9 Cleanup: C++ cleanup for File Browser headers recently converted to C++
C++ Conversion Background: #103343

Generally these changes reduce visual noise in header files.
2023-08-01 12:29:39 +02:00
Julian Eisel
7bbf2f6754 Cleanup: Compile internal File/Asset Browser headers in C++
C++ Conversion Background: #103343
2023-08-01 12:21:56 +02:00
Julian Eisel
26b9ad8f0d Cleanup: Use const in previously added Outliner code 2023-08-01 12:12:33 +02:00
Julian Eisel
96c167e545 Outliner: Add context member for active data-block
The active data-block can now be queried via an `"id"` context member,
just like UI buttons representing a data-block and the Asset Browser do
it already. This is useful for scripts that need this information to
implement own operators. Requested by the Blender Studio for their
pipeline tooling.
2023-08-01 12:10:40 +02:00
Julian Eisel
159c82903c Cleanup: Correct copyright year in asset catalog UI file
Contents of this file were developed in 2021, not 2007.
2023-08-01 11:58:01 +02:00
Julian Eisel
9d1b89c513 Cleanup: Move file context callback to own file
We often separate this callback out to a separate file, it's a coherent
unit that can live on its own. Good to keep files focused and rather
small.
2023-08-01 11:56:22 +02:00
Campbell Barton
c319d0977f RNA: use const array arguments, order array length afterwards
Use const arguments for array input arguments as there
is no reason for them to be modified.

Using non-const arguments meant some functions
(uiTemplateNodeSocket for e.g.) couldn't use 'const' qualifier so the
generated type signature would match.

Also use suffix "_num" instead of "_len" for array lengths, ordering
these arguments after the array (in keeping with Blender's conventions).
2023-08-01 18:46:31 +10:00
Campbell Barton
c0f87d04c7 Cleanup: use const array arguments 2023-08-01 15:46:26 +10:00
Campbell Barton
0ee424ce33 Cleanup: add missing DNA_simulation_defaults.h to CMake's listing 2023-08-01 14:25:38 +10:00
Iliya Katueshenock
803589ca5a Fix #110485: Mesh to curve node incorrect implicit sharing crash
Regression caused by 301f13191b.
To share attribute arrays, domain sizes should be the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/110487
2023-08-01 03:53:01 +02:00
Richard Antalik
61ee554e3f Fix #110333: Sound strip length not correct when opening old file
Commit `c9be925f7d` fixed files for studio, that were saved in incorrect
state. This also attempted to fix unaffected files.
In affected files `seq->startofs` did overflow. Sound strips are not
expected to have negative `startofs` and therefore fix in `c9be925f7d`
can be limited to broken files by checking `startofs` value.
2023-07-31 22:29:17 +02:00
Richard Antalik
76817e5951 Fix #110205: Separate images not working correctly.
Strip was removed from `seqbase` prior to calling
`SEQ_edit_remove_flagged_sequences()` which resulted in strip not being
actually removed, and it could be seen in timeline while being active.
2023-07-31 21:16:29 +02:00
Bastien Montagne
d7281b142d Cleanup: Add missing struct to some definitions in liboverride BKE header. 2023-07-31 18:02:08 +02:00
Hans Goudey
c126708d69 Fix #110001: Edit mesh overlay text uses final positions instead of cage
Caused by 91b27ab637
2023-07-31 11:18:40 -04:00
Damien Picard
00aca1cfb3 I18n: translate curve template color tabs
The curve UI template can display several curves, typically Combined,
Red, Green, and Blue. Each is displayed by clicking a shortened button
C, R, G, B. The equivalent exists for Hue, Saturation, Value.

These single-lettered buttons can be translated using the already
extracted color letters.

R, G, B, H, S, and V all use the default translation context to refer
to the color already, so they do not need an extra context. C however
is already used for the letter in the context of vector
comparisons (as in A, B, C), so we add a Color context to disambiguate
it.

Pull Request: https://projects.blender.org/blender/blender/pulls/110491
2023-07-31 16:44:11 +02:00
Germano Cavalcante
7897979477 Fix compilation error introduced in last commit
Commit aa1f1167ec was incomplete and introduced unrelated changes.
2023-07-31 11:38:51 -03:00
Germano Cavalcante
c6fb80cb9b Transform: use transform Pivot for AutoDepth during navigation
To avoid the small jumps during the Pan operation, a feature was
implemented in the `ED_view3d_navigation_do` utility that replaces the
point used for AutoDepth.

As a result, the depth of the pivot point is now used during the
transform.

Also, to ensure minimal disruption to non-AutoDepth users, this feature
is enabled only when "Auto Depth" is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/109451
2023-07-31 16:06:37 +02:00
Germano Cavalcante
5ed14e9269 Transform: use screen mouse offset position for navigation
In the 3D View, after navigating, the initial cursor position was
updated based on the relative position of the cursor in 3D space.

Now the initial relative position is maintained but moved closer to or
further from the 2d center based on zoom.
2023-07-31 11:03:45 -03:00
Bastien Montagne
d59188e9cf Refactor: Add context structure to RNA/liboverride apply code.
Similar to ded695bc73.

Note that the third 'storage' codepath is not affected currently, this
is almost dead code actually, might rather consider removal of it
altogether.

No behavioral nor performance changes are expected with this commit.
2023-07-31 15:32:12 +02:00
Hans Goudey
95b2c252fb Fix: Remove static assert causing build error on macOS 2023-07-31 09:31:15 -04:00