Commit Graph

102133 Commits

Author SHA1 Message Date
Campbell Barton
24ef5e097a Cleanup: balance doxy sections 2023-08-23 14:54:46 +10:00
Campbell Barton
c52965e9c7 Cleanup: simplify struct declarations 2023-08-23 13:45:19 +10:00
Campbell Barton
f66fa32ada Cleanup: spelling in comments 2023-08-23 13:30:55 +10:00
Harley Acheson
6e20beba22 UI: Statistics Overlay Improvements
Miscellaneous improvements to the Statistics 3DView Overlay. Shows
internal details for selected objects while in Object Mode, including
triangles. Removes the useless "0" shown in the stats while in Sculpt
mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/104663
2023-08-23 01:13:53 +02:00
Bastien Montagne
709ec52c7d Core: foreach_id: Add a new callback flag to skip processing at readfile time.
In readfile context, some ID pointers have to be ignored: typically the
'owner_id' pointers of embedded data.

Currently unused, but required for replacing `blend_read_lib`/
`blend_read_expand` by `foreach_id` (#105666).
2023-08-22 22:17:04 +02:00
Bastien Montagne
710b47fe7c Tweak SpaceNode foreach_id callback handling of nodetree ID pointer.
The fact that this pointer may be either to a regular ID, or an embedded
one, without any way to tell it withour accessing the nodetree data,
makes it tricky to handle properly when such 'other ID' access is not
allowed. Here there can still be assumptions and heuristics based on
other data, but this remains fragile and really sub-optimal code.

Should not have any behavioral change in current code, but required for
replacing `blend_read_lib`/`blend_read_expand` by `foreach_id`
(#105666).
2023-08-22 22:17:04 +02:00
Hans Goudey
1857df8d5b Cleanup: Use FunctionRef for PBVH filtering callback
Call functions directly in lambdas rather than passing their
arguments in a separate void * argument. This can be changed
more in the future to move callback arguments out of smaller
structs.
2023-08-22 15:06:42 -04:00
Leon Schittek
899d723da8 Fix: Display nodelinks consistently across different UI scales
Adjust the width, dash length and amount of anti-aliasing of node links
so they look the same independent of the UI scaling.

Adding another parameter to the shader exceeded the limit of 16
attributes. Therefore the parameters to describe the dashes (length,
factor, alpha) are passed in together as a vector.

Ref  #102919

Pull Request: https://projects.blender.org/blender/blender/pulls/111270
2023-08-22 19:24:07 +02:00
Hans Goudey
42bf06a57d Fix #111255: Sculpt mode crash for mesh with no faces 2023-08-22 12:29:36 -04:00
Bastien Montagne
7a0a406ff8 Core: foreach_id: add optional support for deprecated ID pointers.
This commit adds a new option flag to the lib_query foreach_id code,
which will make deprecated ID pointers to be processed as well.

NOTE: Currently there is no report to the callbakcs about the fact that
it is processing a deprecated ID. This can be easily added later if it
becomes necessary.

Part of implementing #105134: Removal of readfile's lib_link & expand code.
2023-08-22 17:47:57 +02:00
Bastien Montagne
b075c84ba3 Fix (unreported) invalid memory access in new 'newer blendfile version' code.
When choosing the new 'overwrite' option when trying to save a blendfile
from a newer version of Blender, it would cause invalid (use-after-free)
memory access.

Issue caused by the main commit (a1d7ec7139) of the new blendfile
compatibility handling. No idea how it was not detected earlier.

Many thanks to @weizhen for spotting the issue and doing some initial
investigation on it.
2023-08-22 17:26:37 +02:00
Amelie Fondevilla
6cfda322a6 Fix: GPv3: Stroke Eraser does not work with one-point strokes.
The stroke mode of the eraser only tests distance with segments of the strokes, so it does not take into account strokes that only have one point, and thus no segment. This patch fixes the issue by testing if the point is inside the eraser in the case of a one-point stroke.

Pull Request: https://projects.blender.org/blender/blender/pulls/111387
2023-08-22 17:04:51 +02:00
Clément Foucault
acd6dd96b7 Camera: Move panoramic projection settings to DNA
This is in prevision of EEVEE panoramic projection support.

EEVEE-Next is planned to add support for these parameters.
Not having these parameters in Blender DNA will make Cycles
and EEVEE not share the same parameters and will be confusing
for the user.

We handle forward compatibility by still writing the parameters
as ID properties as previous cycles versions expect.

Since this change will break the API compatibility it is crucial
to make it for the 4.0 release.

Related Task #109639

Pull Request: https://projects.blender.org/blender/blender/pulls/111310
2023-08-22 15:49:34 +02:00
Jeroen Bakker
47b431d3b6 Fix: Use correct byte size for GPU_DEPTH_COMPONENT24
Every depth component has a trailing byte for alignment.
So it should be 4 bytes, not 3 bytes.
2023-08-22 14:41:55 +02:00
Hans Goudey
fccab83bc8 Cleanup: Small cleanups to BKE_cloth.hh header
- Use C++ math vector type
- Remove struct and typedef keywords
2023-08-22 07:48:53 -04:00
Hans Goudey
914b1e2a75 Cleanup: Remove unnecessary parantheses in node declaration 2023-08-22 07:48:53 -04:00
Hans Goudey
55d6d5b335 Cleanup: Move BKE_cloth.h to C++ 2023-08-22 07:48:53 -04:00
Jeroen Bakker
d9ae608c87 Fix: Crash when using Vulkan backend.
Command buffer was not availble at the time dummy buffers are
initialized. Resulting in undefined behavior.
2023-08-22 13:46:48 +02:00
Jeroen Bakker
4ebd7d84d1 Vulkan: Bind Dummy Vertex Attributes
Batches don't always provide all required resources for a shader.
This can happen when the resource is defined in the shader, but
not used in a specific variant. The definition is still there and
needs to be filled.

This PR adds a dummy buffer to fill the missing attributes.
It also fixes an issue when using vertex attributes that
uses multiple binding locations (mat4).

Pull Request: https://projects.blender.org/blender/blender/pulls/111350
2023-08-22 13:35:01 +02:00
Zijun Zhou
a9053f7efb Color management: Add AgX view transform and make it default
On a user level this view transform provides much better handling of colors in
the over-exposed areas.

With this configuration the following display devices are available, including
AgX view transform for them:
* sRGB
* Display P3
* Rec.1886
* Rec.2020

NOTE: There is no Filmic view transform available for the newly added display
devices.

AgX also brings an implementation of False Colors view transform, which replaces
Filmic-based, and is available for all display devices.

The backward compatibility is preserved. The new files will default to AgX view
transform, which makes it non-forward compatible.

More technical details is available in the original PR #106355.
Please note that the PR has been split into more incremental changes when
was landing.

Pull Request: https://projects.blender.org/blender/blender/pulls/111099
2023-08-22 12:53:15 +02:00
Bastien Montagne
fa3dd4bdb5 I18N: Add back wrongly removed translation marker in recent cleanup.
7d9214d30f was a tad over enthousiastic in that case. ;)

Thanks to @mod_moder for noticing this!
2023-08-22 11:30:32 +02:00
Jeroen Bakker
2af2a11651 Vulkan: Use Correct Image Aspects
Depending on the usage of an image/image view different image aspect
requirements need to be used. When changing the layout of an image
all aspects needs to be included. When using it as a sampler or
framebuffer attachment only one aspect can be used.

This change also remove duplicated code when creating image views.

Pull Request: https://projects.blender.org/blender/blender/pulls/111349
2023-08-22 11:00:43 +02:00
Philipp Oeser
8bae4427ed Fix #111238: Arrow keys in some menus work in the opposite direction
Since menus are created flipped (from event handling point of view), the
root layout block needs to be flagged `UI_BLOCK_IS_FLIP`.
This was missing for a couple of `uiMenuCreateFunc`, namely:
- creating worspaces menu
- modifiers extra ops
- constraints extra ops
- GP modifiers extra ops
- GP Shader FX extra ops

Same fix as f51de2246c.

Not crtitcal, but could go into LTS I guess.

Pull Request: https://projects.blender.org/blender/blender/pulls/111341
2023-08-22 09:35:10 +02:00
Campbell Barton
7d688edbd3 Fix tool-tip memory leak
Error in [0] duplicated the tool-tip string twice.

[0]: f0467b4615
2023-08-22 17:22:03 +10:00
Campbell Barton
e611ef4312 Cleanup: use term even_xy for window relative coordinates, not mval
The term `mval` is reserved for region-relative coordinates
(see wmEvent::mval).
2023-08-22 13:57:58 +10:00
Campbell Barton
8df5205028 Fix RNA path resolving failing to lookup empty string properties
An empty string is a valid ID property name, when set, RNA's
internal lookup function (rna_path_token_in_brackets), considered
the path invalid.

Now quoted tokens are allowed to be empty.

This fixes Python exceptions being thrown in the custom property editor
with empty custom property names.
2023-08-22 13:31:26 +10:00
Jesse Yurkovich
f30ac938de Cleanup: Reduce unnecessary mesh position copying
Continuation of #103789 to remove/reduce the copying of mesh position
data.

Pull Request: https://projects.blender.org/blender/blender/pulls/111313
2023-08-22 03:51:53 +02:00
Harley Acheson
d45f47a809 Cleanup: Make format
Formatting changes resulting from "make format"
2023-08-21 15:52:36 -07:00
Guillermo Venegas
4f6785774a UI: Fix scrollbar highlighting outside of regions
Remove scrollbar influence when the mouse cursor is outside
of that region.

Pull Request: https://projects.blender.org/blender/blender/pulls/105973
2023-08-22 00:47:11 +02:00
Germano Cavalcante
c02f2f4947 Fix #109454: Snapping from Tools doesn't work if Depth option is not Surface
Regression introduced in 69d6222481.

In that commit the `Depth` option of the placement started to override
the snap toggle. So only the `Suface` value had snap.

This commit also changes the behavior when triggering Placement.
Previously, snapping was forcefully enabled (in the case of `Surface`)
and snapping elements other than Face were used.

Now snap is only enabled if toggle is enabled.
2023-08-21 15:24:47 -03:00
Jesse Yurkovich
baa8f663a2 Fix (unreported) nullptr access in BKE_fcurve_handles_recalc_ex
Don't access fields of the potentially null `FCurve` struct before it's
been validated.

Pull Request: https://projects.blender.org/blender/blender/pulls/111315
2023-08-21 20:15:22 +02:00
Germano Cavalcante
5da64ff596 Fix #111355: Crash when calling operator 'TEXT_OT_save'
Crash occurs when calling with `EXEC_DEFAULT` context.

In this case `text->filepath` might be `nullptr` and cause a crash.

Fix by raising a Python error message in this case.
2023-08-21 15:10:42 -03:00
Richard Antalik
9269afda59 Fix VSE strip text crashing on assert
Rectangle of text drawn on strip could be inverted, which triggered
assert in `UI_view2d_view_to_region_rcti_clip()`.

This was because scrollbar width was added to left side of rectangle.
Since now scrollers are drawn on right side, this offset is replaced
with same offset as is used for strip handles. Both sides of rectangle
are clamped to same range, so it will not get inverted.
2023-08-21 18:26:09 +02:00
Habib Gahbiche
7d9214d30f Cleanup: i18n: remove extraction macro from some geometry nodes
Followup to #107258. Change was missed because development of
Kuwahara filter started before #107258 landed.

Pull Request: https://projects.blender.org/blender/blender/pulls/111151
2023-08-21 16:48:24 +02:00
Germano Cavalcante
f1c6d61854 Fix #111342: Auto Perspective locks viewport into camera
In 384c2e1f36 it was assumed that `VIEWOPS_FLAG_PERSP_ENSURE` only
takes effect if Auto Perspective is enabled in preferences.

But that option is still required in camera view mode.

Therefore always set `VIEWOPS_FLAG_PERSP_ENSURE` if a navigation mode
requires it.

And add a comment explaining the reason.
2023-08-21 11:19:02 -03:00
Miguel Pozo
f57a8f07c0 Fix: EEVEE-Next: World Volume compilation error
Add missing model matrix.
2023-08-21 15:48:48 +02:00
Lukas Tönne
ea3d85b9d7 Node panels: RNA for node group interfaces
Part 2/3 of #109135, #110272

Defines the RNA API for the new node tree interfaces.

The bulk of the RNA definition lives in `rna_node_tree_interface.cc`. The legacy socket interfaces remain in place and will be removed later.

Since the socket items share the `bNodeSocketValueXXX` structs with the `bNodeSocket` types they also use the same RNA. The `rna_def_node_socket_interface_subtypes` function is exposed so that when defining the interface RNA it can use the same code as the regular socket RNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/110952
2023-08-21 15:40:19 +02:00
Bastien Montagne
f052b18a65 Always clear 'fake user' flag from linked data.
Using this flag from linked data is always a double-edge sword, in one
end some user have been relying on it to keep around data that is not
really used as ID (like e.g. text data-blocks, node trees, see
e.g.  #103687, #105687). On the other end, it often causes over-keeping
of linked data reference in production files.

From now on, when an unused linked data is to be kept around, users
should create an ID property to reference it.

Implements #106321.

Pull Request: https://projects.blender.org/blender/blender/pulls/111042
2023-08-21 15:33:25 +02:00
Alaska
7f65080ab4 Fix #111277: NaN in Vector Displacement leading to render errors
Fixes NaN in Vector Displacement node caused by the normalization of
0, 0, 0 vectors.

This fixes both visual rendering issues and an "illegal address" error
on the GPU. The "illegal address" error came from the Light Tree
Sampling code not handling the NaN normals well, leading to weird code
paths being taken, eventually leading to a kernel_assert and a
user facing illegal address error.

Pull Request: https://projects.blender.org/blender/blender/pulls/111294
2023-08-21 15:22:03 +02:00
Jeroen Bakker
785e03b13f Cleanup: Reduce VKDebug Messenger Complexity
Reduces the complexity of VKDebug messenger_callback.
2023-08-21 15:03:33 +02:00
Bastien Montagne
b3c7f3c8a9 UI: Add initial UI support for ID pointers custom properties.
Customprops to IDs are supported since years through code, but were
never exposed directly in the UI of customporperties.

This commit mainly:
* Adds a new `DATA_BLOCK` type to UI customprops types.
* Exposes the existing `id_type` settings to python API.

Pull Request: https://projects.blender.org/blender/blender/pulls/110458
2023-08-21 14:14:26 +02:00
Amelie Fondevilla
3dc93d6e38 GPv3: Display layer groups in grease pencil dopesheet
This patch adds a new type of channel for grease pencil layer groups, which works as an expandable summary channel of layers inside the group.

Pull Request: https://projects.blender.org/blender/blender/pulls/111015
2023-08-21 10:51:00 +02:00
Jeroen Bakker
9df5f2c495 Vulkan: Indirect Drawing
This PR implements indirect drawing for the Vulkan backend. Indirect
drawing is a requirement for workbench-next.

NOTE: that this is one of multiple changes needed to get to the same
support level. With this patch only objects at the center of the world
are drawn correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/111334
2023-08-21 08:55:55 +02:00
Campbell Barton
eee33ce2df Cleanup: replace strcpy with BLI_strncpy 2023-08-21 11:09:18 +10:00
Campbell Barton
1c7adc61ae Cleanup: de-duplicate comments & expand on why UV's are clipped 2023-08-21 10:36:41 +10:00
Campbell Barton
33a05725be Cleanup: spelling in comments 2023-08-21 10:05:45 +10:00
Clément Foucault
65f91bd53a Fix: DRW: Broken debug decimal display
This is a temporary fix. A better fix
that display the non-scientific notation
would be better.
2023-08-20 17:52:48 +02:00
Clément Foucault
b4b5977aed DRW: Guard debug lib using defines
This allows adding debug calls to library
sources and not trigger an error for
all shaders that reference the lib.
The particular shader that need to use
it can set `drw_debug_print_enable` and
`drw_debug_draw_enable` in their main file
and it will trigger the injection of the
debug functions.
2023-08-20 17:52:48 +02:00
Hans Goudey
39a40d6f84 Cleanup: Subdiv: Replace "stack or buffer" storage with C++ classes
Blender's C++ data structures have configurable inline buffers used to
avoid allocation when the needed size is small. Use them in multires
code instead of an uglier C solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/111070
2023-08-20 00:25:45 +02:00
Harley Acheson
b25b13a90b Fix #111278: UI Text Extension of Selection
Recent refactors could cause movement of selection endpoints when
extending (holding shift). This ensures that only the cursor side moves
during selection extension.

Pull Request: https://projects.blender.org/blender/blender/pulls/111288
2023-08-19 19:19:57 +02:00