Commit Graph

127175 Commits

Author SHA1 Message Date
Weikang Qiu 5dd9e57878 Cleanup: Refactor Switch View node to use dynamic declarations
See [#108728](https://projects.blender.org/blender/blender/issues/108728).

Use new API (`declare_dynamic`) for the node, avoid modifying sockets directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/110042
2023-08-23 16:35:36 +02:00
Miguel Pozo 8d8f03be9c Cleanup: Draw: Clarify comment 2023-08-23 16:10:38 +02:00
Weizhen Huang c076202e23 Fix illegal address error in Cycles Light Tree when no emitter is selected
ensure that `sample_reservoir()` chooses index -1 when the weights are invalid,
and returns `false` from `light_tree_sample()`.

Previous attempt: 206ab6437b

Pull Request: https://projects.blender.org/blender/blender/pulls/111428
2023-08-23 16:09:06 +02:00
Sergey Sharybin cf8ea05e71 CMake: Rename compositor tests option to WITH_COMPOSITOR_REALTIME_TESTS
It follows the naming convention of other unit-test variables.

Pull Request: https://projects.blender.org/blender/blender/pulls/111437
2023-08-23 16:03:12 +02:00
Miguel Pozo 89dc2e1649 Fix: EEVEE-Next: Object Info > Random 2023-08-23 16:01:31 +02:00
Miguel Pozo 45f3426559 Fix: UserDef_Experimental padding
Fix compiler error after 85b02b893a
2023-08-23 15:33:02 +02:00
Miguel Pozo 85b02b893a Workbench-Next: Enabled by default
Replace Workbench with Workbench Next.
The old Workbench code is still there for now,
but it should be unreachable.

Pull Request: https://projects.blender.org/blender/blender/pulls/111403
2023-08-23 15:09:37 +02:00
Iliya Katueshenock d732478574 Cleanup: Geometry Nodes: Unnecessary components to check
Only point cloud and mesh is supported. All other components
is unnecessary to check and return.

Pull Request: https://projects.blender.org/blender/blender/pulls/110439
2023-08-23 14:53:57 +02:00
Amelie Fondevilla 1193f2d7ec GPv3: Refactor code for the hard eraser
This patch refactors most of the code of the hard eraser, both for readability purpose, and to prepare the integration of the soft mode of the eraser.
The refactoring includes :
 - the use of specific structures and enum types `SegmentCircleIntersection`, `PointCircleSide`, and `PointTransferData` to handle the data more easily,
 - improve readability of the intersections functions (better naming, and more accurate and generic comments),
 - definition of a more generic `compute_topology_change` function that handles point insertion, removal, and curve splitting for curves geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/111390
2023-08-23 14:13:50 +02:00
Weizhen Huang 3cd14df7d8 Revert "Fix illegal address error in Cycles Light Tree when no emitter is selected"
This reverts commit 206ab6437b.

Seems that the illegal address error should be covered elsewhere, but it's not directly
clear where. Revert the commit for further investigation.
2023-08-23 12:42:57 +02:00
Sergey Sharybin beaf4854b1 Fix #110328: Clay Strip symmetry does not mirror rotation
Caused by 351034891e

This change is a partial revert of the change.

The SCULPT_cube_tip_init() does not deal with the symmetry passes.

Additionally, the commit changed the way how the Z component of
the matrix was constructed: displaced vs. non-displaced area
coordinate.

While the code duplication is often to be avoided, sometimes it is
more clear than a centralized place with a lot of arguments passed
to a function. We can have a pass of de-duplication later on, and
make a better decision, but for now restore user level behavior to
what it is expected to be.

Pull Request: https://projects.blender.org/blender/blender/pulls/111425
2023-08-23 12:21:44 +02:00
Julian Eisel 7bb693581f UI: Move asset shelf out of experimental
This makes the asset shelf available as a standard, non-experimental
feature. Currently no script makes use of it, so it will still not be
available. However the pose library will be updated to use this for its
UI instead.

Initially the asset shelf was committed as experimental feature, even
though it seemed ready for non-experimental. After double checking with
some people (Dalai and Brecht) we decided to go ahead with this.

There are still some futher changes planned, see #107881.
2023-08-23 12:15:33 +02:00
Alaska 206ab6437b Fix illegal address error in Cycles Light Tree when no emitter is selected
Discovered during an investigation into #111277
in rare situations (E.G. When normals are NaN), an emitter
won't be selected as part of `light_tree_cluster_select_emitter()`
and as a result of that, an `emitter_index` of `-1` is passed to
`kernel_data_fetch(light_tree_emitters, emitter_index)` resulting in
an "illegal address" error on some devices.

Pull Request: https://projects.blender.org/blender/blender/pulls/111292
2023-08-23 11:54:20 +02:00
Bastien Montagne 7c4f5b7dc6 Temp 'Fix' broken compilation from abab47a805.
Proper actual fix is obviously needed, but at least now Blender builds
again with oneAPI enabled...
2023-08-23 10:39:21 +02:00
Philipp Oeser b4c380acb4 Fix #109427: Shortcut missing in animation editors channel context menu
Specifying the correct operator context (`INVOKE_REGION_CHANNELS` in
this case) is mandatory, otherwise looking up the shortcut in
`wm_keymap_item_find_props` will fetch the wrong region
(`RGN_TYPE_WINDOW` not `RGN_TYPE_CHANNELS`) and thus wont find the keymap
item in that region keymap.

This was already done for the other menus, not for the context menu
though.

Pull Request: https://projects.blender.org/blender/blender/pulls/111376
2023-08-23 09:40:27 +02:00
Philipp Oeser e2a35debde Fix #94129: Unable to remove added keying set from context menu
Mistake in (7-year-old) f6c09eadf0.

The operator was just cancelled if the right button was found, instead
it should only cancel if the button is _not_ found.

Pull Request: https://projects.blender.org/blender/blender/pulls/111373
2023-08-23 09:39:38 +02:00
Lukas Tönne 26e2f07dad Fix #111381: Crash when inserting a node onto a link inside a frame
`discover_tree_zones` requires the node topology cache, make sure it is available before calling.

Pull Request: https://projects.blender.org/blender/blender/pulls/111383
2023-08-23 08:51:05 +02:00
Campbell Barton 0f0a2d9038 Correct error printing NDOF rotation 2023-08-23 15:36:34 +10:00
Campbell Barton 3405e14446 GHOST: handle all event types in GHOST_EventPrinter::processEvent
- Adjust switch statement to warn when members aren't accounted for.
- Print NDOF button/motion data.
2023-08-23 15:31:21 +10:00
Campbell Barton 3aa0715d65 Cleanup: remove calls to snprintf
Use BLI_snprintf/SNPRINTF to ensure the strings are null terminated.
2023-08-23 15:04:12 +10:00
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
Nikita Sirgienko abab47a805 Cycles: oneAPI: Refactoring of local size choice logic 2023-08-22 19:04:16 +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
Zijun Zhou 23fc8126be Color management: Shrink Filmic LUT size down without noticeable difference
This PR shrinks the Filmic LUT's size down without causing noticeable
difference, making the overall LUT package size smaller. There should be no
functional change on the user end.

Pull Request: https://projects.blender.org/blender/blender/pulls/111380
2023-08-22 15:30:12 +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 f58d596c36 GHOST/Wayland: print the exception message on failure
When GHOST_SystemWayland can't be created, print the run-time error
unless X11 is available as a fallback.
2023-08-22 16:08:55 +10:00
Julien Kaspar 920271da42 Keymap: Left and Right Click consistency improvements
Fix some remaining consistency issues for selection shortcuts for both
left and right click select.

Based on design of #105298

Grease Pencil:

Instead of using `Alt Select` shortcuts for selecting whole strokes,
these are now following existing standards with `L` and `Shift L` from
select linked pick operations.

`Alt Select` keys are instead used for selecting individual components
in modes that use brushes just like [0].

Regular selection like `Select` and `Shift Select` are now always mapped
to ensure that all keymap configurations are able to select individual
components in every mode.
This does not cause conflicting behavior with brushes.

Lasso Select shortcuts on `Ctrl Alt` and `Shift Ctrl Alt` have been
removed. These were duplicates and are not needed.

Mesh Sculpt Mode:

Mesh sculpt mode uses correct lasso masking shortcuts in both right and
left click select. These are now the same as lasso selection shortcuts
in other modes.

Ref !110960.

[0]: fb54d3f865
2023-08-22 15:47:07 +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 6a169cfe73 Cleanup: use rna_idprop_quote_path utility function in rna_prop_ui 2023-08-22 13:34:25 +10:00