Commit Graph

101604 Commits

Author SHA1 Message Date
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
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
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
Chris Blackbourn
fc2ee7d912 Cleanup: improve uv packing inline comments 2023-07-31 16:49:38 +08: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
Campbell Barton
fd0977284b Cleanup: simplify typedefs
Also remove unused `buffer_struct`.
2023-07-30 16:14:09 +10:00
Hans Goudey
79cb56e1f1 Cleanup: Remove check for null object when building PBVH
In the two callers of `BKE_sculpt_object_pbvh_ensure`,
the object is already expected to be non-null.
2023-07-29 23:47:13 -04:00
Hans Goudey
c4ac4ecc4c Mesh: Extract loose edges and vertices in two threads
The process of calculating the caches for loose edges and loose vertices
and extracting their indices are independent and both single threaded.
If the CPU isn't doing anything else, using two threads can half the
total time for both. For example, this saves 40-50ms opening a file
with a 16 million face mesh.
2023-07-29 23:47:13 -04:00
Hans Goudey
38fc111fc9 Cleanup: Clarify string usage in PBVH draw
Use StringRef where possible to avoid copying strings, avoid
redundant string returns, and use std::string for attribute
request names now that all the relevant code is C++.
2023-07-29 23:47:13 -04:00
Hans Goudey
e749599f95 Cleanup: Remove using keyword for std::string in pbvh draw
Typically it's considered questionable to add `using` for `std` types
and functions. With just a few more characters, the type is always
familiar.
2023-07-29 23:47:13 -04:00
Jacques Lucke
830fb684c3 Fix: failing mesh boolean test in debug build due to unnormalized normal
This was accidentally changed in f557222a7b.
2023-07-29 12:03:07 +02:00
Campbell Barton
916f6a7bf3 UI: add weight paint gradient menu items for discoverability 2023-07-29 16:33:14 +10:00
Campbell Barton
cfffd813c1 Cleanup: use typed enum for UI_ITEM_* flags
Using an int lead to confusion with other flags often used with buttons.
For e.g. these flags could be easily confused with uiItem::flag.
2023-07-29 15:32:45 +10:00
Campbell Barton
acbf16d91a Cleanup: correct invalid flag types
- wmOperatorCallContext was used to store UI_ITEM_* flags.
- Collada export use passed invalid UI_ITEM_* flag as an argument.
2023-07-29 14:52:47 +10:00
Campbell Barton
98f848dc4b Cleanup: use typed flag for uiItem::flag 2023-07-29 14:48:13 +10:00
Campbell Barton
ed01e16aa6 Cleanup: quiet uninitialized warnings 2023-07-29 13:47:57 +10:00
Campbell Barton
2bc89982dc Cleanup: remove unused variable 2023-07-29 13:47:53 +10:00
Germano Cavalcante
22206a1592 Fix #110571: Property option 'TEXTEDIT_UPDATE' no longer updates
The `ENUM_OPERATORS` utility was used in `PropertyFlag` in d154ebfa83.

In that commit, it was set with a maximum value lower than
`PROP_TEXTEDIT_UPDATE`.

Consequently, when `bpy_props.c` was converted to C++ in 6fcecb7e46,
the cast to `PropertyFlag` caused the value of `PROP_TEXTEDIT_UPDATE`
to be cleared.

The solution is to set the maximum value to `PROP_TEXTEDIT_UPDATE`
instead of `PROP_NO_DEG_UPDATE`.
2023-07-28 17:51:54 -03:00
Jacques Lucke
860196d5a1 Geometry Nodes: extract bake items from simulation baking
The goal is to reuse the same bake items for simulation and normal baking (#110137).
Previously, the bake data was tied to a simulation state which made it harder to reuse.

Now the code for the following things can be reused easily:
- Convert geometry node socket values into bake items and back.
- Serialize and deserialize bake items.

Pull Request: https://projects.blender.org/blender/blender/pulls/110577
2023-07-28 18:30:32 +02:00
Bastien Montagne
ef26e5d313 Cleanup: Rename 'override' variables and parameters to 'liboverride'.
`override` is a reserved keyword in C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/110534
2023-07-28 16:37:06 +02:00
Bastien Montagne
ded695bc73 LibOverride/RNA Diffing refactor.
Use a context structure for both parameters and results of the rna
diffing functions, instead of 10+ individual parameters.

Also switch to C++ features like `std::string` and `std::optional`
instead of handling manually buffers and allocated C-style strings.

This commit also makes some minor cleanups, add some documentation, and
removes a few small parts of code that have been detected as
redundant/useless.

No behavioral nor performance changes are expected with this commit.
2023-07-28 16:36:31 +02:00
Falk David
187545109a Cleanup: GPv3 drawings API
This cleans up the API a bit to make things more readable.
No functional changes.
2023-07-28 16:32:42 +02:00
Amelie Fondevilla
f7130d98c4 GPv3: Select frames by column
Implementation of column-based operators : "Columns on selected keys", "Column on current frame", and "Columns on selected markers" for grease pencil frames in the dopesheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/110523
2023-07-28 16:18:40 +02:00
Julian Eisel
088d7a0bdd UI: Activate view item on right click on nested button too
No user visible change expected.

Right-clicking a view item is supposed to activate it and display the
context menu. However, nested buttons could "swallow" the right click
event. Ensure the view item is still activated.
2023-07-28 15:31:52 +02:00