Commit Graph

124727 Commits

Author SHA1 Message Date
Hans Goudey
81da428cec Merge branch 'blender-v3.6-release' 2023-06-05 20:20:26 -04:00
Hans Goudey
41d994c9ac Fix #108571: OBJ vertex group import crash
`tot_loop_idx` was increased before it was used to set the set
the vertex group value of the current face corner's vertex.
2023-06-05 20:20:03 -04:00
Campbell Barton
f31dfa9b74 Merge branch 'blender-v3.6-release' 2023-06-06 09:49:06 +10:00
Campbell Barton
8e871971b4 Cleanup: quiet compiler warning (missing-declarations) 2023-06-06 09:42:09 +10:00
Campbell Barton
7e7c14ad4c Fix paste flipped creating invalid RNA data paths
- Paste flipped created invalid paths when the size of the name changed
  left -> right: lost the 't' in right.
  right -> left: lost the entire end of the RNA path.

- Correct the fixed buffer size as it may include escaped characters.
2023-06-06 09:35:21 +10:00
Campbell Barton
dd1fe31a74 Cleanup: quiet compiler warnings 2023-06-06 09:34:50 +10:00
Hans Goudey
5ee22dd490 Cleanup: Use const for modifier utility function 2023-06-05 16:50:26 -04:00
Hans Goudey
c2430e55c8 Cleanup: Remove disabled code from particle system modifier
This comment referenced a special case for modifier evaluation in edit
mode. With replacements on the horizon, this won't be added anymore.
2023-06-05 16:50:26 -04:00
Hans Goudey
102c015306 Cleanup: Remove argument from deform modifier utility function
This was only used in the particle system modifier.
2023-06-05 16:50:26 -04:00
Hans Goudey
73d921a0c6 Cleanup: Avoid curve to mesh conversion in some deform modifiers
Some modifiers used `MOD_deform_mesh_eval_get` to make sure they had
a mesh to retrieve vertex groups from. But since curves don't support
vertex groups anyway, and since the curve to mesh conversion is handled
by the (legacy) curve object modifier stack anyway, this is confusing
and unnecessary. This shouldn't give any behavior changes, but some
deform modifiers on legacy curve objects might be faster if they used
to do the conversion.
2023-06-05 16:50:26 -04:00
Germano Cavalcante
260125aed0 Transform: Allow navigation for operator when called from macro or menu
Extrude and duplicate operators now support navigation
(if enabled in preferences).
2023-06-05 16:49:44 -03:00
Germano Cavalcante
17d12522be Cleanup: Simplify Extrude menu code
This commit simplifies the "Extrude" menu layout code.

This should make future modifications and maintenance easier.

Refs:
33b1cbf06d
46b0e90cf6
db4a205fa0
2023-06-05 16:49:44 -03:00
Germano Cavalcante
05b8cfec5e Transform: Allow navigation with "release_confirm"
This limitation was added to avoid conflicts with tools.

But since we now have the "allow_navigation" option on transform
operators, there is no real benefit to having this limitation.
2023-06-05 16:49:44 -03:00
Germano Cavalcante
251614c39c Transform: Include "allow_navigation" option in "Shrink/Fatten"
No functional changes from user's point of view.

"Shrink/Fatten" is used in macros for some extrude operations.

These operations may rely on the type of mesh selection.

While some of these operations are combined with the "Move" function,
which already permits navigation, others are combined with
"Shrink/Fatten", which currently lacks navigation capabilities.

To ensure consistency and enable navigation in all extrude operations,
this commit introduces the option to enable navigation for the
"Shrink/Fatten" operator.
2023-06-05 16:49:44 -03:00
Leon Schittek
27184c4643 Merge branch 'blender-v3.6-release' 2023-06-05 20:23:45 +02:00
Leon Schittek
e6a8c45fd9 Fix #108578: Crash when unlinking input sockets
Fix a mistake in commit 2ce5fc4a3e that caused a crash when detaching
node links from input sockets.

When a link is detached from an input socket, `nodeRemLink` nulls the
`link` pointer of the socket.
So before the next update inputs are linked but don't have a valid `link`
pointer causing the crash, when trying to access the link in
`std_node_socket_draw`.

The introduced check avoids the crash and is more correct since it
doesn't just check one link for multi-input sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/108623
2023-06-05 20:21:07 +02:00
Bastien Montagne
90a0f39c02 Merge branch 'blender-v3.6-release' 2023-06-05 18:12:35 +02:00
Damien Picard
745baa788d I18n: extract a few messages
- "Invalid" in transformation messages.
- For three messages, translation occured after a string
- concatenation, so the full message was not found.
  Instead, translate a format pattern and format it afterwards.
- Alembic errors when there is an import type mismatch.

Pull Request: https://projects.blender.org/blender/blender/pulls/108212
2023-06-05 18:10:11 +02:00
Falk David
8d0b10bbc7 Fix: GP brush stroke operator name and description
These were still the ones copied from the curves operator.
2023-06-05 18:06:00 +02:00
Clément Foucault
e7cc266c92 EEVEE-Next: Fix shader buildtime validation
The `eevee_render_pass_out` needs to be added
at runtime only because test shaders do not
define the `node_tree` UBO.
2023-06-05 15:45:51 +02:00
Bastien Montagne
a9612086b8 Merge branch 'blender-v3.6-release' 2023-06-05 15:35:00 +02:00
Bastien Montagne
855d8d3fa4 Fix #88010: Undo system did not respect memory limit.
Code was plainfully buggy, early-out check in
`BKE_undosys_stack_limit_steps_and_memory` was plainfully wrong.

Also added some more logging for memory limiting code.
2023-06-05 15:23:31 +02:00
Germano Cavalcante
5ea2c80e7f Fix #108574: Error when trying to move a keyframe
Error due to a typo in c4a4a89ef5

_translate > _timetranslate
2023-06-05 10:21:53 -03:00
Julian Eisel
c18ee2e84d Fix compile error on MSVC
Caused by cdd4beeb5e.
2023-06-05 14:22:14 +02:00
Weizhen Huang
d54fe40807 Cleanup: EEVEE: Simplify computation in #ltc_evaluate_disk_simple
The existing code was copied from the ellipse light case. But
this computation simplifies for the disk case, removing the
need of `inversesqrt`.

Pull Request: https://projects.blender.org/blender/blender/pulls/108616
2023-06-05 14:21:38 +02:00
Bastien Montagne
ebb5643e59 Readfile: Refactor several parts of the process
This commit affects:
* Reading undo steps from memfile (aka 'Global Undo');
* Handling of UI IDs (WindowManager, Workspaces and Screens) when
  opening a .blend file.

While no major changes are expected from a user PoV, there may be some
unexpected changes in rare edge-cases. None has been identified so far.

Undo step loading should be marginally faster (`setup_app_data` itself
is 2-3 times faster, as it does not do remapping anymore, which makes the
whole 'read undo step' process about 20% faster - but the most
time-consuming step on undo is the depsgraph processing, which remains
unchanged here).

This commit also solves some bugs (crashes) in some relatively uncommon
cases, like e.g. if the WM had an IDProperty pointing at an object and
UI is not loaded when opening a new .blend file with the 'Load UI' option
enabled (as in previous code on file opening WM ID would never be
remapped).

From a more technical side, this commit aims mainly at cleaning things
up, in preparation for the introduction of new 'no undo, no readfile'
type of handling (as part of the Brush Assets project):
  - Prevent WM code from doing (too much) horrible ID 'management' on
    its WM when opening a new file. It used to remove current WM from
    the Main database, store it in a temporary own list, and then free
    it itself...
  - Trying to make the complex logic behind WM handling on file reading a
    bit more easy to follow, at least way more documented in code.
  - Keep the handling of 'IDs being re-used from old Main' in a single
    place, as much as possible:
    -- Readfile code itself in undo case (because it's more efficient,
       and undo case is in a way simpler than actual .blend file
       reading case). The whole `blo_lib_link_restore` block of code
       is also removed.
    -- (Mostly) setup_app_data code in actual file reading case.
  - Sanitize the usage of the 'libmap' in readfile code in undo case
    (waaaaay too many pointers were added there, which was hiding some
     other issues in the related code, and potentially causing (in
     rare cases) memory addresses collisions.

Pull Request: https://projects.blender.org/blender/blender/pulls/108016
2023-06-05 13:54:49 +02:00
Julian Eisel
cdd4beeb5e Cleanup: Use C++ functor for button pushed query callback
C-style callbacks often rely on `void` pointer arguments that are unsafe
because of the removed type. C++ functors allow passing arbitrary data
along the callback, plus convenient features like defining the callback
using a lambda.

Didn't port the `typedef` because it doesn't add much in this case, just
hides the type from the reader who has to look it up first.

Note that this function isn't used in the main branch currently.
2023-06-05 12:48:44 +02:00
Bastien Montagne
8eb75deb46 Merge branch 'blender-v3.6-release' 2023-06-05 11:58:00 +02:00
Bastien Montagne
93de57b707 I18N: Updated UI translations from SVN trunk (r6562). 2023-06-05 11:56:38 +02:00
Weizhen Huang
0e20e2320b Fix compiler error on Metal 2023-06-05 10:53:46 +02:00
Jeroen Bakker
6a1aead6d1 Metal: Silence Console Output
This PR silences console output during statup phase of blender. During
startup logging isn't yet initialized and print statements where used.
Logging is initialized during the first construction of a Metal Context.

The console prints are now hidden by behind the '--debug-gpu' command
line option.

Pull Request: https://projects.blender.org/blender/blender/pulls/108593
2023-06-05 09:28:19 +02:00
Campbell Barton
c1ac3621a9 Cleanup: replace list-base count_at_most with is_single for clarity 2023-06-05 12:42:46 +10:00
Campbell Barton
aada2800fd Cleanup: use BLI_strchr_or_end to simplify new-line stepping
- DRW_draw_region_engine_info:

  - Remove duplicate line drawing for the last line.
  - Remove string copying, pass the length to BLF_draw_default instead.
  - Resolve a potential buffer overflow as the source string length was
    used to define the destinations maximum size.

- CONSOLE_OT_paste:

  - Remove the need to null-terminate each line.
  - Buffer stepping uses const values
  - console_line_insert no longer strips the string it inserts.

- CONSOLE_OT_insert:

  - New lines in the middle of text now reports an error,
    new lines at the end of text is stripped (as before).
2023-06-05 12:36:12 +10:00
Campbell Barton
7d56c8fe1d BLI_string: add BLI_strchr_or_end
Returning the pointer to the null byte when the character isn't found
is useful when handling null terminated strings that contain newlines.

This means the return value is never null and the line span always ends
at the resulting value.
2023-06-05 12:17:13 +10:00
Campbell Barton
efa4179982 PyAPI: rename filename to filepath for RNA API functions
- Depsgraph.debug_relations_graphviz
- Depsgraph.debug_stats_gnuplot
- RenderLayer.load_from_file
- RenderResult.load_from_file
- bpy.app.icons.new_triangles_from_file
2023-06-05 11:04:53 +10:00
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
35eea10581 Cleanup: format 2023-06-05 12:14:20 +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
Lukas Stockner
f4708831ea Fix Principled Hair Absorption Coefficient when using OSL
The additional SocktType::VECTOR argument was being interpreted as flags,
which caused the OSL compiler to skip the input (since the Vector type enum
happens to align with the INTERNAL flag), which caused the OSL shader to
always use the hardcoded default absorption regardless of what was entered.
2023-06-05 01:35:19 +02:00
Lukas Stockner
3a81a93ecf Merge branch 'blender-v3.6-release' 2023-06-05 01:02:19 +02:00
Lukas Stockner
81f127a7e4 Fix refraction BSDF color when using OSL 2023-06-05 01:01:19 +02: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