Commit Graph

126654 Commits

Author SHA1 Message Date
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
Campbell Barton dddf07c2ce Tools: update 'check_cmake' check to skip PUBLIC/PRIVATE prefixes 2023-08-01 14:24:46 +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
Campbell Barton 8d4c847052 Fix #110627: crash on start with Wayland
Older versions of Wayland would crash on startup because of the
requested zwp_pointer_gestures_v1 version.

Resolve by supporting older versions.
2023-07-31 22:59:54 +10:00
Damien Picard fe62eebba4 UI: Rename Distort socket in the Lens Distortion compositing node
The "Distort" socket in the Lens Distortion node should be a noun
instead of a verb, same as "Dispersion" just below. The name was
introduced at the same time as the node itself, in 2a2453d3e2.

Versioning was added to update existing nodes. The Python API
is affected though, if the socket was looked up with the old name.

Pull Request: https://projects.blender.org/blender/blender/pulls/108234
2023-07-31 14:49:01 +02:00
Hans Goudey f10965dcb8 Sculpt: Improve PBVH draw performance for meshes
Reduce overhead of copying attribute data into GPU buffers when the
PBVH is active. The existing lambda with a FunctionRef callback had
a significant overhead. While that was reduced by 25917f0165
already, even making the `foreach_faces` lambda into a template gave
significant overhead compared to simpler loops. Instead, separate
value conversion and iteration over visible triangles in a way that the
compiler is able to optimize more easily.

According to the GPU module, it's also better to use raw data access
than `GPU_vertbuf_raw_step`, since the data format strides aren't
meant to vary by platform, and the runtime stride can have a
noticeable performance impact.

Also avoid recalculating face normals, since they're already used to
calculate vertex normals anyway (since ac02f94caf).

I tested the runtime of the initial data-upload after entering sculpt
mode with a 16 million vertex mesh. Before, that took 1350 ms, after
it took 680 ms, which is almost a 2x improvement. In my tests, the
performance improvement was only observable for the initial data
upload, theoretically it is a more general change though.

It's possible that a similar optimization could be applied to multires
or dynamic topology sculpting, but that can be looked at later too.

Pull Request: https://projects.blender.org/blender/blender/pulls/110621
2023-07-31 14:40:41 +02:00
Clément Foucault 92be22ff4b Fix: EEVEE-Next: Broken world diffuse irradiance 2023-07-31 14:28:55 +02:00
Caleb-Cleavinger 20091a2b9e Fix #110096: Crash Crash on calling curve pen operator
Changed poll function to `ED_operator_editcurve` to prevent
crashing when accessed from the developer menu in modes other
than edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/110619
2023-07-31 14:06:18 +02:00
Amelie Fondevilla 6f8ff2846f GPv3: Add API function to get active frame
Adds the Layer method `frame_at` which finds the frame that is active at a given frame number.

Pull Request: https://projects.blender.org/blender/blender/pulls/110583
2023-07-31 12:23:31 +02:00
Campbell Barton 79e7449a52 Cleanup: remove unused declarations 2023-07-31 20:01:40 +10:00
Campbell Barton 6d2326dabf Cleanup: use function style casts 2023-07-31 19:57:32 +10:00
Campbell Barton 90e123c746 Tools: fix code_clean cleaning generated files
When a relative build directory was passed in, code-clean wasn't
filtering out generated sources and would clean them too.
2023-07-31 19:57:27 +10:00
Sergey Sharybin c2dfa1a066 Fix crash in GPU compositor when viewer size changes
This change fixes crash which happens when a viewer node is used for
backdrop, and the scene render size is modified. After the modification
the render size and the texture size gets out of sync since the texture
was never adapting for the size change.

Pull Request: https://projects.blender.org/blender/blender/pulls/110590
2023-07-31 11:17:14 +02:00
Alaska 462dbe9929 Fix `NaN` in Cycles light tree `bone.axis`
Fix `NaN` in the light tree `bcone.axis` that can occur when
normalizing direction vectors of 0 length.

Pull Request: https://projects.blender.org/blender/blender/pulls/110374
2023-07-31 10:56:15 +02:00
Chris Blackbourn fc2ee7d912 Cleanup: improve uv packing inline comments 2023-07-31 16:49:38 +08:00
Alaska 18575e411b Cleanup: Cycles `device_update_lights`
Rearrange and remove some unnecessary lines of code
to improve readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/110377
2023-07-31 10:46:31 +02:00
Alaska 1261272da7 Cleanup: Simplify get `centroid` in Cycles light tree builder
`scene->lights[object_id` is already available as `lamp`.

Pull Request: https://projects.blender.org/blender/blender/pulls/110376
2023-07-31 10:40:40 +02:00
Chao Li b40e8242ca GPv3 : Select circle/lasso grease pencil frames
Adapt the `ACTION_OT_select_circle` and `ACTION_OT_select_lasso` operators to take into account grease pencil layer channels. These operators both call `region_select_action_keys` which subsequently calls `region_select_elem` function. In the last function, grease pencil layer needs to be taken into consideration. This resolves #110521

Pull Request: https://projects.blender.org/blender/blender/pulls/110558
2023-07-31 10:35:36 +02:00
Campbell Barton 52acf6a6ec Cleanup: correct file names in comments after C -> C++ renaming
Use back-tick quotes to differentiate these from plain text.
2023-07-31 13:02:30 +10:00
Chris Blackbourn a35ad5899f Fix #110626: restore abf uv unwrap logic
Regression from 8ace65e3c6.
2023-07-31 10:40:38 +08:00
Campbell Barton 74a222f0e0 Cleanup: rename BMEditMesh 'editData' to 'em'
Avoid confusion with EditMeshData, often accessed via
`mesh->runtime->edit_data`.
2023-07-31 10:20:26 +10:00
Campbell Barton 724755879e Cleanup: spelling in comments, use doxygen doc-strings 2023-07-31 10:18:09 +10:00
Campbell Barton d5fc5c5a04 Cleanup: quite MSVC warning in datatoc_icon.cc 2023-07-31 10:00:23 +10:00
Campbell Barton f324cbf2a6 Cleanup: use doxygen docs for datatoc_icon 2023-07-31 10:00:23 +10:00
Bastien Montagne a14c747fe8 Fix (unreported) minor bug in RNA/Liboverride apply code.
The wrong RNA pointers were passed (passing the root ones instead of the
ones actually owning the rna-path-resolved property).

This was likely a harmless mistake, since it only affected RNA
collections of IDs, afaik we currently don't have many (if any) of these
in non-ID RNA structures. The children collections and objects in a
Collection data-block RNA structure e.g. were not affected.

But the potential consequence of that bug would have been missing
automatic detection of some needed liboverride resyncs.
2023-07-30 17:51:01 +02:00