Commit Graph

127112 Commits

Author SHA1 Message Date
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 8b311daf0a Cleanup: Make format 2023-08-21 15:03:43 +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
Bastien Montagne b404df6989 Further tweaks to LSAN suppression rules.
Mainly add more python-related suppressions.

Also suppressed some reports from `pxr` (usd) libraries.

Now most tests are passing again with ASAN/LSAN on on my machine,
besides modifiers and geometry nodes ones, which often fail on a
mysterious `libstdc++.so.6+0xb259a` leak.
2023-08-21 14:07:16 +02:00
Sergey Sharybin f0a8c19461 Compositor: Increase tolerance for matte tests
The test is very susceptible to exact input values, and recent
change from Filmic to Standard view for those test changed values.

This change is similar to #110897

Pull Request: https://projects.blender.org/blender/blender/pulls/111339
2023-08-21 12:12:12 +02:00
Bastien Montagne 12b261545f I18N: Updated UI translations from SVN trunk (r6668). 2023-08-21 11:41:47 +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 4760908b6e Fix potential buffer overflow & un-terminated strings on macOS
- GHOST_SystemPathsCocoa::getUserSpecialDir
  used `strncpy` without ensuring the string was null terminated.
- GHOST_SystemPathsCocoa::getBinaryDir
  used `strcpy` without checking the destination buffer size.
2023-08-21 11:53:22 +10: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
Campbell Barton 5a8cb665e0 Cleanup: various non-functional C++ changes 2023-08-19 23:52:47 +10:00
Campbell Barton faa3ef6ad5 Cleanup: format 2023-08-19 23:52:47 +10:00
Habib Gahbiche 9d08be1eec Realtime Compositor: add regression tests
Tests must be enabled manually using the CMake flag `WITH_COMPOSITOR_REALTIME_TEST`. Reasons are F12 for realtime compositor is experimental and buildbots have no GPU. Failing tests are excluded.

Pull Request: https://projects.blender.org/blender/blender/pulls/109878
2023-08-19 15:00:54 +02:00
Campbell Barton 4f72240c1d Cleanup: spelling (correct correction), update dictionary 2023-08-19 20:19:13 +10:00
Campbell Barton 20b4a77872 datatoc: exclude the initial C-style comment from GLSL/MSL/Cuda files
Add optional argument `STRIP_LEADING_C_COMMENTS` to CMake macros:
data_to_c_simple & data_to_c.

Strip leading C-style comments that don't bloat binary size.
Comments are replaced with blank lines so line numbers in error messages
match. Reduces Blender's binary size by ~70kb.
2023-08-19 17:57:12 +10:00
Campbell Barton 63c1a26069 Cleanup: move GLSL comments to the file start
This has the benefit that leading comments may be stripped,
reducing the binary size (not yet supported).
2023-08-19 17:56:48 +10:00
Campbell Barton 04bf0f3eb6 License headers: add SPDX copyright entries for '*.msl' files 2023-08-19 17:41:14 +10:00
Campbell Barton add2a656da Cleanup: spelling, use C-style in GLSL 2023-08-19 17:13:05 +10:00
Ray Molenkamp e7c94b35b8 Fix: Missing PDB on windows
Missed one cmake check in 0df3aedfa8
2023-08-19 00:09:19 -06:00
Campbell Barton b903ce04d8 AUTHORS: add new developers 2023-08-19 14:58:05 +10:00
Campbell Barton ccdaba69a5 Tools: improve progress output for credits & author generation
Show a percentage output as the numbers weren't especially meaningful.

Also use default arguments for credits generator so no arguments
are required to generate all-time credits.
2023-08-19 14:51:38 +10:00
Campbell Barton d78189e406 Tools: set the renameLimit for git_log to avoid warnings
Generating credits/authors would print warnings from commits
that renamed many files, increase the diff.renameLimit to account for
this and suppress the warning.
2023-08-19 14:51:38 +10:00
Harley Acheson 1ce9c2b1f8 Fix #111086: Ignore Scroller Zones in Invisible Regions
If a region is hidden then there is no reason to detect or
consider its (also hidden) scroller action zones.

Pull Request: https://projects.blender.org/blender/blender/pulls/111126
2023-08-18 21:31:35 +02:00
Ray Molenkamp e2af12d368 Cleanup: Update copyright to the new format
Had put my name here since the choice was between the foundation
and me personally, with the blender authors file now being in
place this can be cleaned up.
2023-08-18 11:58:37 -06:00
Harley Acheson 9e71b84f1d UI: Error Logging for Some Screen Operations
WM_report on the unlikely event when an area (smaller than minimums) is
within the combined operation bounds (close or join) and interferes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111280
2023-08-18 19:53:18 +02:00
Ray Molenkamp d5e50460e7 CMake/MSVC: Use /debug:fastlink for debug builds
This changes the default linker options for debug builds to use
fastlinking, this causes the PDB only to be usable on the machine
it is being created on, however since debug builds cannot be
distributed to end users (wont run due to missing debug CRT on
their system) this isn't a problem.

This halves the time required for an incremental link on my system
from 7->3.5 seconds
2023-08-18 10:47:47 -06:00
Ray Molenkamp 0df3aedfa8 CMake/MSVC: Only generate/install stripped PDB for release builds
This renames the WITH_WINDOWS_PDB and WITH_WINDOWS_STRIPPED_PDB cmake
options to WITH_WINDOWS_RELEASE_PDB WITH_WINDOWS_RELEASE_STRIPPED_PDB

The Stripped PDB isn't cost free to generate, and is only needed for
builds that are distributed to end users. There is no benefit in making
one for a debug build as the debugger locally will prefer to use the
bigger un-stripped PDB anyhow.

This also stops the copy/install of the PDB for anything but a release
build, this file is about 1.6G for a debug build, and there is really
no need to do this for local development, as the debugger will find/use
the PDB from its original location.

This brings down the time needed for an incremental link on a debug
build by about 30% (10->7 seconds on my local system)
2023-08-18 10:20:36 -06:00
Bastien Montagne 99e78f1c7a Cleanup: Move Object' FluidModifier internal data handling from 'lib_link' into 'read_data' code.
The only acceptable case to handle internal data in 'lib_link' code is
when it depends on other IDs info. Otherwise, it should be done in
'read_data' code (and versioning if relevant).
2023-08-18 17:31:06 +02:00
Christoph Lendenfeld 0c26d4cc3e Fix: Number input on slider
When using a slider it is possible to enter numbers for an exact value
However that input was capped between 0 and 1,
which is no longer correct since the range can be arbitrary.

Additionally it was divided by 100 because the slider
operator system assumed we'd be working with percentages.

This fixes both of these issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/111269
2023-08-18 17:29:41 +02:00
Rawalanche eb57163fdf UI: Add panel for Node Editor in Preferences
Move Node Editor preferences in the Editing section from `Miscellaneous`
panel into their own `Node Editor` panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/111261
2023-08-18 15:54:47 +02:00
Weizhen Huang 8367167626 Render: default roughness distribution to Multiscatter GGX
for glass, glossy and principled BSDF. It is more energy-preserving than
GGX, and with the albedo scaling instead of random walk (888bdc1419) the
render time stays reasonable.

Task: #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/111267
2023-08-18 15:51:30 +02:00
Weizhen Huang 639223d92f Fix Cycles hair orientation test failing on Linux/Windows
Increase samples per pixel

Pull Request: https://projects.blender.org/blender/blender/pulls/111262
2023-08-18 15:33:41 +02:00
Pablo Vazquez 26dcc961f5 Markers: Use double-click to rename
For speed and consistency with other areas in Blender like Outliner,
UILists, animation channels, etc.

This is additionally to F2 (Enter in Industry Compatible keymap),
that shortcut is still valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/111264
2023-08-18 15:23:20 +02:00
Falk David 24082ceecc Cleanup: GPv3: Constructors and destructors
The `TreeNode`, `Layer` and `LayerGroup` constructors and destructors
had some inconsistencies. Now the code is a bit more clean and shared.
2023-08-18 15:06:18 +02:00
Bastien Montagne f954329376 Cleanup: Move FCurve's internal data hanlding from 'lib_lkink' to 'read_data' code.
Deciding to forcefully set an ID pointer to null is not ID lib_linking
process, but internal data management.
2023-08-18 14:58:44 +02:00
Bastien Montagne 77eb7898e9 Cleanup: Comment in liboverride hierarchy handling code. 2023-08-18 14:23:41 +02:00
Bastien Montagne dfb002bac6 Cleanup: Move Workspace's internal data handling from 'lib_link' to 'read_data' code.
Decision to clear the pinned scene ID in case of linked data _is_
internal data handling, and not related to updating relationships to
other IDs.
2023-08-18 14:23:18 +02:00
RedMser baeeff9a84 Fix: crash in liboverride hierarchy ensure
Add null checks to logging and fix typo in if-check.

Pull Request: https://projects.blender.org/blender/blender/pulls/111055
2023-08-18 14:20:34 +02:00
Weizhen Huang c40e3dd142 Workaround failing hair test on Linux/Windows
temporarily disable the test before proper fix
2023-08-18 14:14:07 +02:00
Weizhen Huang 6f8011edf7 Cycles: new Principled Hair BSDF variant with elliptical cross-section support
Implements the paper [A Microfacet-based Hair Scattering
Model](https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.14588) by
Weizhen Huang, Matthias B. Hullin and Johannes Hanika.

### Features:
- This is a far-field model, as opposed to the previous near-field
Principled Hair BSDF model. The hair is expected to be less noisy, but
lower roughness values takes longer to render due to numerical
integration along the hair width. The hair also appears to be flat when
viewed up-close.
- The longitudinal width of the scattering lobe differs along the
azimuth, providing a higher contrast compared to the evenly spread
scattering in the near-field Principled Hair BSDF model. For a more
detailed comparison, please refer to the original paper.
- Supports elliptical cross-sections, adding more realism as human hairs
are usually elliptical. The orientation of the cross-section is aligned
with the curve normal, which can be adjusted using geometry nodes.
Default is minimal twist. During sampling, light rays that hit outside
the hair width will continue propogating as if the material is
transparent.
- There is non-physical modulation factors for the first three
lobes (Reflection, Transmission, Secondary Reflection).

### Missing:
- A good default for cross-section orientation. There was an
attempt (9039f76928) to default the orientation to align with the curve
normal in the mathematical sense, but the stability (when animated) is
unclear and it would be a hassle to generalise to all curve types. After
the model is in main, we could experiment with the geometry nodes team
to see what works the best as a default.

Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/105600
2023-08-18 12:46:13 +02:00
Falk David d06a6105a7 Fix: GPv3: `TreeNode::is_locked()` function
The function returned `true` for the root node, which it shouldn't.
2023-08-18 12:44:11 +02:00
Falk David 725f1dbf2d Revert: GPv3: DNA rename of `name`
Partially reverts b14a0ee57e.

Instead of renaming the DNA field, use namespaces in C++ to resolve
name collisions (which is the reason this change was done
in the first place).
2023-08-18 12:44:11 +02:00