Commit Graph

100091 Commits

Author SHA1 Message Date
Campbell Barton
87ff8ee09a Cleanup: disambiguate the term 'path'
Use filepath or dirpath, unless the contents might be either,
in that case note that the contents could be both.
Use `rna_path*` in some cases too.
2023-06-05 10:57:34 +10:00
Lukas Stockner
888bdc1419 Cycles: Remove MultiGGX code, replace with albedo scaling
While the multiscattering GGX code is cool and solves the darkening problem at higher roughnesses, it's also currently buggy, hard to maintain and often impractical to use due to the higher noise and render time.

In practice, though, having the exact correct directional distribution is not that important as long as the overall albedo is correct and we a) don't get the darkening effect and b) do get the saturation effect at higher roughnesses.

This can simply be achieved by adding a second lobe (https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_slides_v2.pdf) or scaling the single-scattering GGX lobe (https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf). Both approaches require the same precomputation and produce outputs of comparable quality, so I went for the simple albedo scaling since it's easier to implement and more efficient.

Overall, the results are pretty good: All scenarios that I tested (Glossy BSDF, Glass BSDF, Principled BSDF with metallic or transmissive = 1) pass the white furnace test (a material with pure-white color in front of a pure-white background should be indistinguishable from the background if it preserves energy), and the overall albedo for non-white materials matches that produced by the real multi-scattering code (with the expected saturation increase as the roughness increases).

In order to produce the precomputed tables, the PR also includes a utility that computes them. This is not built by default, since there's no reason for a user to run it (it only makes sense for documentation/reproducibility purposes and when making changes to the microfacet models).

Pull Request: https://projects.blender.org/blender/blender/pulls/107958
2023-06-05 02:20:57 +02:00
Chris Blackbourn
608fdc9c58 Merge branch 'blender-v3.6-release' 2023-06-05 12:17:09 +12:00
Chris Blackbourn
de4fb0e570 UV: Add optimal uv packings using precomputed layouts
Produce optimal layouts for `n` squares, where n == 11, 18, 19 and 26.

With thanks:
* Walter Trump
* Pertti Hamalainen
* Robert Wainwright
* Erich Friedman
2023-06-05 12:06:30 +12:00
Campbell Barton
85e5d3325c Cleanup: replace 'sz' abbreviation with 'size' 2023-06-04 19:56:19 +10:00
Campbell Barton
e82ca9b5ff Cleanup: rename ParticleSettings.child_nbr to child_percent
The old name was only kept to avoid breaking compatibility.
2023-06-04 19:52:10 +10:00
Campbell Barton
32a5dad2b2 Cleanup: use 'num' suffix for sizes in DNA instead of 'size'
Avoid ambiguity with the term size.
2023-06-04 19:48:14 +10:00
Campbell Barton
784e13170e Cleanup: function style casts, use nullptr, printf & size macros 2023-06-04 19:27:38 +10:00
Campbell Barton
e27bcb6e3e Cleanup: remove redundant struct qualifier 2023-06-04 19:27:38 +10:00
Campbell Barton
493a1dd7c8 Cleanup: remove NULL literals in C++ (including comments & strings) 2023-06-04 18:35:12 +10:00
Campbell Barton
68256a1da7 Cleanup: remove unused argument 2023-06-04 14:55:20 +10:00
Hans Goudey
ab6860f3de Geometry Nodes: Improve delete geometry performance with vertex groups
In the "All" mode, handle vertex group data separately from other
attributes, which allows copying all vertex groups at once. In a file
with 172 vertex groups, the node became about 12 times faster, from
25.8 to 2.2 ms. With fewer vertex groups the change will be smaller.

Theoretically a similar optimization would work elsewhere, but ideally
we would have a more generalized concept of sparsely stored attributes
first. In the meantime this is a simple way to improve some common
rigging use cases.
2023-06-03 10:21:43 -04:00
Germano Cavalcante
a4043286d9 Fix compilation error on Linux
```
error: conflicting types for ‘transform_mode_snap_source_init’;
have ‘void(TransInfo *, struct wmOperator *)
```
2023-06-03 08:46:30 -03:00
Leon Schittek
1e81d35138 Node Editor: Don't change size of resize area for frame nodes with zoom
Change the active area along the perimeter of frame nodes to have a more
consistent width independently of the zoom level so frame nodes can more
easily be grabbed and resized when zoomed out.

Pull Request: https://projects.blender.org/blender/blender/pulls/108359
2023-06-03 12:45:12 +02:00
Leon Schittek
cd611f7fb8 Merge branch 'blender-v3.6-release' 2023-06-03 12:37:56 +02:00
Leon Schittek
2ce5fc4a3e Fix #108336: Treat node sockets with muted links as linked
Prevent make links operator from creating links to sockets that are
already linked to a muted link.

The `SOCK_IS_LINKED` flag is used to check if there already is a link
connecting to the socket but when the link is muted, the flag wasn't set
leading to issues in parts of the code that used the flag to check
for any type of connected link.
This commit now also sets `SOCK_IS_LINKED` when links are muted and
adds an additional check in places where different behavior is expected
for muted links.

Pull Request: https://projects.blender.org/blender/blender/pulls/108375
2023-06-03 12:34:58 +02:00
Leon Schittek
cc9c720aae Fix #103068: Link insert offset not working when rotating/scaling nodes
Fix node link insertion during transform not working properly for
rotation and scale.
Inserting nodes by rotating or scaling...
* ...didn't offset the attached nodes.
* ...could lead to unfreed memory.

This commit fixes that by always calling the `NODE_OT_insert_offset`
operator at the end of the node transform operator rather than having
to explicitly append it into a macro operator for each transform
operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/107460
2023-06-03 12:29:57 +02:00
Germano Cavalcante
3010f1233b Transform: new feature to edit the 'Snap Base'
This commit implements a new modifier key (`B`) for the transform
operators.

This new key allows changing the 'Snap Base' of a transform by snapping
it to a defined point in the scene.

Ref #66424

# Implementation Details

- This feature is only available in the 3D View.
- This feature is only available for the transform modes:
  - `Move`,
  - `Rotate`,
  - `Scale`,
  - `Vert Slide` and
  - `Edge Slide`.
- The `Snap Base Edit` is enabled while we are transforming and we
  press the key `B`
- The `Snap Base Edit` is confirmed when we press any of the keys:
 `B`, `LMB`, `Enter`
- During um operation, if no snap target is set for an element in the
  scene (Vertex, Edge...), the snap targets to geometry Vertex, Edge,
  Face, Center of Edge and Perpendicular of Edge are set automatically.
- Constraint or similar modal features are not available during the
  `Snap Base Edit` mode.
- Text input is not available during the `Snap Base Edit` mode.
- A prone snap base point is indicated with an small cursor drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/104443
2023-06-03 04:18:49 +02:00
Hans Goudey
0c0cd10e55 Merge branch 'blender-v3.6-release' 2023-06-02 21:19:37 -04:00
Hans Goudey
214da4b6b4 Fix #108039: Incorrect results when setting custom normals
The solution using `reverse_index_array` didn't work because it lost the
order that the corners were processed in (the order around the vertex).
This is important when setting custom normals because the process
sets sharp edges when the normal of the current and previous corner
is too different.
2023-06-02 21:18:12 -04:00
Campbell Barton
74dd0ed09e Cleanup: remove redundant struct qualifiers 2023-06-03 08:54:37 +10:00
Campbell Barton
b347346ca7 Cleanup: header wrapping, spelling, use doxy sections 2023-06-03 08:21:48 +10:00
Iliya Katueshenock
05d3eb5eea Geometry Nodes: Parallelelize a delete geometry selection conversion
Parallelize the conversion of an edge selection to a vertex selection,
which makes it approximately twice as fast (0.6 ms -> 0.3 ms).
In another test the whole node operation became about 17% faster,
from 6.9 to 5.9ms. This only applies to the "All" mode with the
edge selection domain.

Similar to 3d209d1619

Pull Request: https://projects.blender.org/blender/blender/pulls/108541
2023-06-02 20:27:42 +02:00
Germano Cavalcante
c1edeb573b Fix unused function after c4a4a89ef5
`applyTrackballMatrix` was unused after c4a4a89ef5.

Trackball supports `transform_matrix_fn` although currently not being
used.

This callback is used in the drawing of gizmos.
2023-06-02 15:04:59 -03:00
Richard Antalik
4a81c417c1 Cleanup: Fix build warnings 2023-06-02 19:18:33 +02:00
Julian Eisel
4fad870c4d Merge branch 'blender-v3.6-release' 2023-06-02 18:19:52 +02:00
Julian Eisel
4832114d60 Fix #107870: Movie Clip Editor hangs in "Clip" view
Because of how the Clip Editor managed region state for different view
modes before region polls were introduced (fa0f295b53), regions could be
written to files in a state that's not valid for displaying them. State
for clip editors written to files is corrected with versioning now.
2023-06-02 18:19:23 +02:00
Richard Antalik
6d215b87ce VSE: Freeze frame feature for retiming tool
Freeze frames can be added now using retiming tool with no need to hold
splitting strips or using hold offsets. To use this feature, add
retiming handle where you want to freeze the frame, hold ctrl key and
drag the handle. It is not possible to freeze frame of transition handle
and it is not possible to add transition to or from freeze frame.
Retiming system would handle these cases, but they are not useful in
practice.

When freeze frame is created, start handle of frozen segment is flagged
as `FREEZE_FRAME`. Most handling is similar to `SPEED_TRANSITION`
type handle. For evaluation, there is no special case for this type, as
it's just 2 handles with same `retiming_factor` value. It is possible to
recreate this behavior without using freeze frame feature by adding
handle between 2 consecutive content frames, but this would not be
recognized by UI or treated as freeze frame segment/handle.

Eventually this feature should replace hold offsets, leaving `Sequence`
struct with single offset type, see PR 105620 for reference.
2023-06-02 18:02:14 +02:00
Harley Acheson
c033e434c5 UI: Allow Opacity for Theme Outline Colors
Allow setting opacity with color for uiWidgetColors outline and for
tab_outline.

Pull Request: https://projects.blender.org/blender/blender/pulls/108248
2023-06-02 17:20:51 +02:00
Nathan Vegdahl
f63c56e05c Fix: action's actual users and recorded user count could diverge
The user count decrement and unassigning the action were split
between two different conditionals, which weren't guaranteed
to both execute/not-execute together.
2023-06-02 16:03:26 +02:00
Jeroen Bakker
c8bd998944 Vulkan: Fix Debug Messenging
In the specification of validation layers it is mentioned that
the messenger should always return VK_FALSE. When this isn't the
case VK_ERROR_VALIDATION_FAILED_EXT will be returned and the
API command will fail.

This PR will always return false.

Pull Request: https://projects.blender.org/blender/blender/pulls/108545
2023-06-02 15:41:09 +02:00
Bastien Montagne
d4068e375f Merge branch 'blender-v3.6-release' 2023-06-02 15:26:34 +02:00
Bastien Montagne
d847851000 Fix #108285: Crash in Outliner when using RNA ID remapping API call.
RNA API call was not updated UI in anyway.
2023-06-02 15:26:04 +02:00
Bastien Montagne
5ce0f80ed6 Fix #108285: Remap Users operator doesn't work on Objects.
Objects were excluded from the ID operation, as originally they had
their own entry in their own menu. Joys of nightmare tools handling in
the Outliner...
2023-06-02 15:26:04 +02:00
Falk David
32982dda26 GPv3: Add initial edit mode overlay support
This PR adds basic overlay support for `OB_GREASE_PENCIL`.
Currently it only renders the points and their selection status based on the ".selection" attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/108511
2023-06-02 15:12:49 +02:00
Falk David
4f977ad56f Merge branch 'blender-v3.6-release' 2023-06-02 15:07:18 +02:00
Sietse Brouwer
a784a65dbe Fix #108473: unreliable auto-normalize results when weight painting in GPencil
Painting weights in Grease Pencil with the auto-normalize option enabled,
gave unpredictable results when vertex groups with a weight of zero
were involved.
This patch resolves the issue. Vertex weights of zero are excluded from
auto-normalization. Which is a better fit for the Grease Pencil workflow,
where weights are mostly painted from scratch since the 'parent to
armature with automatic weights' operator doesn't give good results.

Pull Request: https://projects.blender.org/blender/blender/pulls/108524
2023-06-02 15:04:19 +02:00
Sietse Brouwer
25952b865d Fix #108475: no helpful tooltips for Vertex Paint tools in Grease Pencil
The tools in Vertex Paint mode in Grease Pencil were missing clear
descriptions. This patch adds them, based on the descriptions in
the manual.

Pull Request: https://projects.blender.org/blender/blender/pulls/108522
2023-06-02 15:02:39 +02:00
Germano Cavalcante
c4a4a89ef5 Transform: refactor modes by reorganizing their data in 'TransModeInfo'
No functional changes.

This commit reorganizes the transform mode functions by bundling them
into a struct called `TransModeInfo` in the file.

This structural change enhances the readability of the transform code
and simplifies the process of adding or removing modes.

Furthermore, this refactor allows for the inclusion of other essential
mode-specific values, such as 'input', which cannot be separated from
the code.

Overall, this commit improves the maintainability and extensibility of
the transform functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/108467
2023-06-02 14:42:27 +02:00
Iliya Katueshenock
457f423719 Fix #108537: Incorrect early return in delete geometry node
Fix after 50bfe1dfe3. Early return can be for unchanged
all geometry domains only.

Pull Request: https://projects.blender.org/blender/blender/pulls/108540
2023-06-02 14:23:56 +02:00
Julian Eisel
2d0bd33eda Merge branch 'blender-v3.6-release' 2023-06-02 12:28:00 +02:00
Julian Eisel
a6e1caa1b2 Fix file/asset browser document type icons using wrong theme color
Steps to reproduce were:
- Open File Browser, set it to Thumbnails display mode, disable filters
- Navigate to a directory with documents that have no preview
- Change Preferences > Themes > User Interface > Icon Colors > File
  Folders to light and dark colors
- See how the type icons on top of the white document icon image get
  changed unexpectedly. Only type icons drawn on top of folder icon
  images should change.

When drawing the document type icons on top of the folder or document
image in the center of thumbnails, they would always use the folder icon
color (Preferences > Themes > User Interface > Icon Colors > File
Folders) to determine if they should be drawn with a light or a dark
color. It should only use that when drawing on top of a folder icon
image, and the color for document icon images otherwise.
2023-06-02 12:27:45 +02:00
Christoph Lendenfeld
e73b9c95f5 Refactor: Bidirectionality on Graph Editor Sliders
This PR changes the ranges of some of the operators in the Graph Editor to be more logical

The following operators have been modified to with a range of -1/1 with the default of 0
*  Blend to Neighbor
* Breakdown
* Ease

This is a breaking change because python calls to these operators will now yield different results
(e.g. Blend To Neighbor at 0 does nothing now, while before it did blend to the left neighbor)

Pull Request: https://projects.blender.org/blender/blender/pulls/107173
2023-06-02 12:22:31 +02:00
Dalai Felinto
390f8fef76 Merge remote-tracking branch 'origin/blender-v3.6-release' 2023-06-02 11:10:45 +02:00
Dalai Felinto
9d00d13767 Fix #108501: Image Editor glitch after texture painting undo
When doing the second undo, the image wasn't properly marked for full
update.

There reason was that in some cases the partial_updater was
totally reconstructed: `first_changeset_id` and `last_changeset_id` were both 0.

While the `user_imp->last_changeset_id` was still its last value (e.g., 3).

The fix is to have the partial updater validator to check for the
last change set as well (it was only checking for the first change set).

This way we cover both scenarios when user_imp->last_changeset_id is out
of the range of the partial update history.

Pull Request: https://projects.blender.org/blender/blender/pulls/108533
2023-06-02 11:09:38 +02:00
Jeroen Bakker
30de07199a Vulkan: Some tweaks to the messenger
- Removal of Vulkan version number
- Removal of object counts
- Put objects next under the message

Pull Request: https://projects.blender.org/blender/blender/pulls/108531
2023-06-02 10:12:32 +02:00
Kazashi Yoshioka
a4249588cd Vulkan: Debug Messages
This change will register a callback to Vulkan debug messaging
allowing us to filter out messages and log them using CLog.

This change only provides the initial changes, and more tweaks
are expected to on formatting and filtering.

Pull Request: https://projects.blender.org/blender/blender/pulls/107635
2023-06-02 09:50:30 +02:00
Campbell Barton
553e221c76 PlayAnim: display that a buffer fails to load instead of exiting
Failure to load an image-buffer during animation playback would exit,
display a text warning instead because it could potentially
exit during user interaction/playback.
2023-06-02 14:11:54 +10:00
Germano Cavalcante
a83a0a811f Transform: Remove internal mode 'TFM_TIME_DUPLICATE'
No functional changes.

`TFM_TIME_DUPLICATE` is basically the `TIME_TRANSLATE` or `TRANSLATE`
modes.

The difference is that `TFM_TIME_DUPLICATE` merge duplicates keyframes
at the end of the operation.

It is an unexposed mode in python and promotes code duplication.

It has a similar initialization to `TIME_EXTEND` which redirects to
`TIME_TRANSLATE` or `TRANSLATE` depending on the spacetype.

As it is dependent on other modes (as well as `TIME_EXTEND`), it makes
things a bit more confusing.

There's no real benefit to creating a new internal mode just to
indicate this small change (merge duplicates).

So indicate in another way (by properties) that you want to merge
duplicate keyframes.
2023-06-02 01:07:59 -03:00
Campbell Barton
64aa96d421 Fix failure to paste material color alpha & paste line-art
Error in [0] excluded these members from pasting.

[0]: 5177e2f20b
2023-06-02 13:50:14 +10:00