Commit Graph

127134 Commits

Author SHA1 Message Date
Guillermo Venegas 84718feb4b Fix potential leaks using SHGetKnownFolderPath
Documentation for `SHGetKnownFolderPath` remarks that the `PWSTR`
parameter should always be freed with `CoTaskMemFree`  even if it
succeeds or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/111128
2023-08-16 23:10:00 +02:00
Harley Acheson 0c7496f74d UI: Increase Color Picker Size
Increase the Color Picker Size by 33%

Pull Request: https://projects.blender.org/blender/blender/pulls/111153
2023-08-16 22:59:14 +02:00
RedMser f1e7fe5492 UI: Windows "Quick Access" items to File Browser System List
On the Windows platform add any Explorer "Quick Access" items to the
bottom of the File Browser "System" List in the sidebar.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108431
2023-08-16 22:36:06 +02:00
guishe c69f526fdb Windows: Propagate errors in make.bat
Propagate errors out of make.bat so any calling processes can use the
exit code to determine failure during build/update.

Pull Request: https://projects.blender.org/blender/blender/pulls/108727
2023-08-16 19:29:47 +02:00
Brecht Van Lommel 59fb9341cf Build: keep SDL haptics disabled on macOS x86_64
Not yet available for the current minimum of macOS 10.15.
2023-08-16 19:11:41 +02:00
Pablo Vazquez eef2b61e91 Theme: Set 3D Viewport background to single color
The default vignette effect introduces issues reported several times
on various hardware configurations.

It would still be nice to figure out the issue and fix it in the
vignette effect code. For now, simply use single-color in the
default theme.

As agreed during the 2023-08-15 User Interface Module meeting.

Fixes #93627
Closes #106699
2023-08-16 18:45:21 +02:00
Brecht Van Lommel b0424a7cbd Fix #111180: crash adding AOV/light output node with shader node previews
Only happened when the experimental option is enabled.
2023-08-16 18:43:23 +02:00
Brecht Van Lommel 51fd4af648 Build: fix OpenVDB Metal patch not applying cleanly 2023-08-16 18:43:23 +02:00
Bastien Montagne f1e64781a8 Core: foreach_id: Tweak handling of scene collection in LayerCollection.
Unfortunately, relying only on the 'embedded' flag of the collection ID
pointer to detect the LayerCollection of a Scene embedded collection is
not enough, since this info may not always be available.

So add an extra explicit 'is_master' to the recursive code processing
all LayerCollections ID pointerrs, and double-check with an assert that
this info is coherent with the Collection's embedded flag, when
possible.
2023-08-16 18:23:15 +02:00
Pablo Vazquez 952371e63b Fix typo in blender_theme_as_c.py 2023-08-16 17:55:39 +02:00
Bastien Montagne 28305c2c73 Refactor: Properly formalize special versioning done after most of readfile code.
In a few cases (IPO conversion, Proxy conversion, ...), versioning
implies creating or removing IDs, and/or needs access to the whole Main
data-base.

So far this was done ad-hoc by adding some code at the end of
`setup_app_data`.

This commit formalizes this process by adding a BLO call
(`BLO_read_do_version_after_setup`) that will encapsulate all such
complex versioning code.

NOTE: This commit does not address the existing issue that this
versioning code is never performmed when linking new data (outside of
the 'opening a blendfile' context). This topic would require its own
design task.

NOTE: This commit does not fix the few current evil cases of ID creation in
regular versioning code. This will be addressed separately.

Although this commit does modifies slightly some logic in this specific
versioning process, no behavioral changes are expected here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111147
2023-08-16 16:21:59 +02:00
Falk David b14a0ee57e Cleanup: GPv3: Refactor usage of `TreeNode`
Some functionality of `Layer`s and `LayerGroup`s can be shared. This is why the `TreeNode` class exists. It encapsulates all the common methods both `Layer`s and `LayerGroup`s should have.

Up until now, the usage of `TreeNode` was not consistent and often the layers would just access the base c-struct directly.

This refactor makes it so that all of the functions affecting only the `TreeNode` are moved to the `TreeNode` class and only implemented there.

For example, renaming a layer is really just renaming the node. Therefor there shouldn't even be a `rename_layer` and `rename_layer_group` function. These were combined into a `rename_node` function.

Pull Request: https://projects.blender.org/blender/blender/pulls/111177
2023-08-16 16:18:26 +02:00
Bastien Montagne dd647677b6 Fix (unreported) Scene foreach_id callback skipping some NULL ID pointers.
Not sure how bad that was in practice, was likely harmless. But
foreach_id logic should never decide to not process an ID pointer
because its value is NULL. Callback code is expected to handle NULL
pointers appropriately.
2023-08-16 15:04:33 +02:00
Pratik Borhade 338e4ef090 Fix: GPv3 layer renaming when name is unchanged
When old and new names of layers/groups are same, garbage string is
displayed. This is because `oldname` char pointer is referenced to
`node.name`. After function execution, `oldname` memory is freed in
`interface_handler` (see `after.rename_orig`), thus displays garbage
string.
Fix is to copy the content of `oldname` instead of referencing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/111173
2023-08-16 14:48:46 +02:00
Omar Emara 85a3f61150 BLI: Add 2D transformation matrix decomposition
This patch adds support for 2D transformation matrix decomposition into
translation, rotation, and scale.

Pull Request: https://projects.blender.org/blender/blender/pulls/111178
2023-08-16 14:47:14 +02:00
Brecht Van Lommel 1594f7fb95 Build: update SDL to 2.28.2
Older versions don't build with Xcode 14.3.

Ref #109244

Pull Request: https://projects.blender.org/blender/blender/pulls/110975
2023-08-16 14:39:11 +02:00
bsavery c6f5915bc8 Cycles: enable HIP for integrated graphics of Ryzen 7000 CPUs
Specifically the gfx1036 architecture, for AMD Zen4 APUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/110907
2023-08-16 14:35:09 +02:00
Aras Pranckevicius 2f060706a4 Cleanup: fewer BLI_color.hh et al includes
Include counts of some headers while making full blender build:
- BLI_color.hh 1771 -> 1718
- BLI_math_color.h 1828 -> 1783
- BLI_math_vector.hh 496 -> 405
- BLI_index_mask.hh 1341 -> 1267
- BLI_task.hh 958 -> 903
- BLI_generic_virtual_array.hh 509 -> 435
- IMB_colormanagement.h 437 -> 130
- GPU_texture.h 806 -> 780
- FN_multi_function.hh 331 -> 257

Note: DNA_node_tree_interface_types.h needs color include only
for the currently unused (but soon to be used) socket_color function.
Future step is to figure out how to include
DNA_node_tree_interface_types.h less.

Pull Request: #111113
2023-08-16 14:48:53 +03:00
Campbell Barton 92c4756d02 Fix replacement of "Blender Foundation" in recent header change
The recent change to header copyrights [0] unintentionally changed
"Blender Foundation" to "Blender Authors" for the WIN32 file path
which blender is installed into.

Revert lines changed that aren't related to copyright text.

[0]: e955c94ed3
2023-08-16 21:21:55 +10:00
Campbell Barton cede822bdc AUTHORS: regenerate to remove duplicates
Using the same `git_data_canonical_authors` module for
credits & authors exposed more duplicates,
regenerate AUTHORS from the updated data.
2023-08-16 21:00:56 +10:00
Campbell Barton 63fa5b92e7 Authors Script: add script to generate individual contributors
Add the script used generate individual contributors for AUTHORS,
add "make authors" utility that updates the AUTHORS file in-place.
2023-08-16 21:00:20 +10:00
Sergey Sharybin efb2406262 Fix #111165: Regression: Blender Crashes On Scene Switch
The root of the issue is a missing recalculation tag after
changing collection content.

Pull Request: https://projects.blender.org/blender/blender/pulls/111175
2023-08-16 12:22:55 +02:00
Campbell Barton 139dc716f1 Credits Script: improve author de-duplication
- Add git_data_canonical_authors module with maps various
  "Author <email>" combinations to a single author.
- Add git_data_sha1_override_authors module which
  overrides authors for individual commits.
- GitCommit.author now includes the email.
- Move co-author access into GitCommit.co_authors.

Using name & email, then de-duplicating removes 43 duplicates in the
generated credits.

Moving the author & override mapping out of credits_git_gen.py
allows this data to be shared by a utility to update AUTHORS
(not yet committed).
2023-08-16 19:54:37 +10:00
Chao Li 27eb6d48d3 GPv3: Select box grease pencil frames
Adapt the `ACTION_OT_select_leftright`, `ACTION_OT_select_box` and `ACTION_OT_select_column` operators to take into account grease pencil layer channels. These operators call `actkeys_select_leftright`, `box_select_elem`, and `markers_selectkeys_between`, respectively. In these three functions, grease pencil layer channels are considered now. This resolves #110522.

Pull Request: https://projects.blender.org/blender/blender/pulls/110939
2023-08-16 11:44:15 +02:00
Alaska 007b7d0353 Shaders: Change IOR soft minimum to 1.0 in Principled BSDF
Pull Request: https://projects.blender.org/blender/blender/pulls/111158
2023-08-16 10:17:57 +02:00
Alaska 71587663ac Fix #111156: Principled BSDF transmission not rendering in OSL
After recent changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111157
2023-08-16 10:14:00 +02:00
Aras Pranckevicius acbd952abf Cleanup: fewer iostreams related includes from BLI/BKE headers
Including <iostream> or similar headers is quite expensive, since it
also pulls in things like <locale> and so on. In many BLI headers,
iostreams are only used to implement some sort of "debug print",
or an operator<< for ostream.

Change some of the commonly used places to instead include <iosfwd>,
which is the standard way of forward-declaring iostreams related
classes, and move the actual debug-print / operator<< implementations
into .cc files.

This is not done for templated classes though (it would be possible
to provide explicit operator<< instantiations somewhere in the
source file, but that would lead to hard-to-figure-out linker error
whenever someone would add a different template type). There, where
possible, I changed from full <iostream> include to only the needed
<ostream> part.

For Span<T>, I just removed print_as_lines since it's not used by
anything. It could be moved into a .cc file using a similar approach
as above if needed.

Doing full blender build changes include counts this way:
- <iostream> 1986 -> 978
- <sstream> 2880 -> 925

It does not affect the total build time much though, mostly because
towards the end of it there's just several CPU cores finishing
compiling OpenVDB related source files.

Pull Request: https://projects.blender.org/blender/blender/pulls/111046
2023-08-16 09:51:37 +02:00
Iliya Katueshenock f50da4040f Fix #111142: bl_static_type is empty for node groups and custom nodes
Caused by f18c45eb69.
Functions `node_type_base` and `node_type_base_custom`
are the same, but last one have been missed in the cleanup.

Pull Request: https://projects.blender.org/blender/blender/pulls/111154
2023-08-16 09:29:46 +02:00
Harley Acheson a70953242d Cleanup: Calm Warning
Unreferenced variable introduced in 5741a5d433
2023-08-15 17:21:02 -07:00
Harley Acheson 5741a5d433 UI: Allow Eyedropper Outside of Blender
This adds a new Ghost function, GHOST_GetPixelAtCursor, that allows
picking colors from outside of Blender windows. This only has an
implementation for the Windows platform, but this should allow other
platforms to also do so if possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/105324
2023-08-16 01:14:36 +02:00
Almaz-Shinbay 077db81638 Outliner: Port linked object elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for linked object elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/111130
2023-08-15 22:44:40 +02:00
Sybren A. Stüvel 86085bcb9c Mem: avoid offsetting nullptr
Fix an UBSAN warning about undefined behavior, by preventing additions
to `nullptr`:

```
blender/source/blender/blenlib/intern/BLI_memiter.c:136:42: runtime error:
applying non-zero offset 48 to null pointer
```

No functional changes.
2023-08-15 18:01:11 +02:00
Hoshinova 0702c24a36 Nodes: Add Lacunarity and Normalize inputs to Noise node
This PR adds the Lacunarity and Normalize inputs to the Noise node
similar to the Voronoi node.

The Lacunarity input controls the scale factor by which each
successive Perlin noise octave is scaled. Which was previously hard
coded to a factor of 2.

The Noise node normalizes its output to the [0, 1] range by default.
The Normalize option makes it possible for the user to disable that.
To keep the behavior consistent with past versions it is enabled by
default.

To make the aforementioned normalization control easer to implement,
the fractal noise code now accumulates signed noise and remaps the
final sum, as opposed to accumulating positive [0, 1] noise.

Pull Request: https://projects.blender.org/blender/blender/pulls/110839
2023-08-15 17:38:45 +02:00
Falk David 969de5135a GPv3: Re-evaluate on frame change
This makes it so the `GreasePencil` geometry gets updated on a time
change.
The frame at which the object gets evaluated is stored in runtime as
`eval_frame`. This is for example used to calculate the bounding box
of the geometry as well as invalidating the batch cache for different
frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/111137
2023-08-15 17:31:11 +02:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Bastien Montagne f188d6709f LibOverride: keep some anim data from liboverride when it exists in both IDs.
So far when an anim data had to be created in liboverride (because none
existed in reference ID), and reference ID got an anim data added later,
that reference anim data would simply replace the one from the
liboverride, completely losing all animation-related work done so far in
the liboverride.

This commit fixes that, by adding some custom handling of anim data when
there is a liboverride operation defined on the `animation_data` RNA
property itself.

It then behaves as if everything that is overridable in the existing
liboverride was defined as overrides (and therefore kept), while
everything else is replaced by the reference animdata:
* Action and temp action are kept.
* Settings (extend mode, etc.) are kept.
* Active NLA track and strip are kept, and tracks and strips from the
  liboverride are added at the end of the list of these from the
  reference data.

Note that this behavior is only expected to happen once, on the first
call to 'apply overrides' after anim data has been added to the reference
linked ID. After that, since both IDs have animdata, there should be no
liboverride property defined for the `animation_data` property itself,
but only for paths leading inside that animdata struct.

Implements #110067.
2023-08-15 16:05:25 +02:00
Bastien Montagne 257f21d494 Cleanup: Move Compositor versioning code from Scene's 'lib_link' to actual versioning code.
Not sure when that versioning was added, but nowadays there are the
'after_linking` versioning handlers for that kind of case.
2023-08-15 15:54:21 +02:00
Jeroen Bakker 616e0c8c1d Vulkan: Set Geometry Shader Capability
Vulkan already used geometry stages, but it wasn't set as backend
capability. This resulted that the shader builder didn't validate
shaders that uses geometry stages.

Pull Request: https://projects.blender.org/blender/blender/pulls/111139
2023-08-15 15:53:56 +02:00
Brian Savery (AMD) e90ceefd18 Change packed_float3 to internal float3 for HIP
Remove a workaround for no built in vector type in HIP fixed in ROCM 5.1:
    https://github.com/ROCm-Developer-Tools/HIP/issues/706

Shouldn't have any functional change.  Mainly cleaning up the code.

Co-authored-by: arskell <arskell221@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111122
2023-08-15 15:40:29 +02:00
Jeroen Bakker d20f26aeb6 Fix: Memory Reserve Issue in Vulkan/Std140
This PR solves a memory reserve issue when a nvec3 was followed by
a int, bool, float.

Also adds a debug_print method to the push constants for checking
the structure against data in renderdoc.

Pull Request: https://projects.blender.org/blender/blender/pulls/111109
2023-08-15 14:16:26 +02:00
Jeroen Bakker ab3ae2be4d Fix: Vulkan Use Resource After Free
When immediate mode is used with a temp texture the
draw command was executed after the texture was freed.

This PR ensures that the draw command is executed before
the texture is freed.

Pull Request: https://projects.blender.org/blender/blender/pulls/111111
2023-08-15 14:15:46 +02:00
Jeroen Bakker dd4ab50065 GPU: Add Dummy Backend For Unsupported Platforms
With the introduction of metal and vulkan we use a different
GPU backend selection which broke the dialog box for unsupported
platforms.

Blender asserted and segfaulted before the dialog was being shown
to the user.

This patch solves this by introducing a dummy GPU backend in case no
GPU backend was supported by OpenGL, Metal and Vulkan Backend.

It also adds the showMessageBox to GHOST_SystemCocoa.

Related to #110335

Pull Request: https://projects.blender.org/blender/blender/pulls/110919
2023-08-15 14:15:12 +02:00
Aras Pranckevicius 7875074532 Cleanup: fewer iostreams related includes in Cycles
In the commonly used cycles headers, it's enough to include
much smaller <iosfwd> than the full <iostream>. While looking at it,
removed inclusion of some other headers from commonly used headers,
that seemed to not be needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/111063
2023-08-15 13:55:38 +02:00
Bastien Montagne 4b98c0aa24 Cleanup: Remove 'read_data' code from Scene's paint 'link_lib' code.
Changes to internal private data of an ID has _nothing_ to do into its
'lib_link' reading code (unless in the extremely rare case where it
would have hard dependency on its ID having valid ID pointers).

In that case, `BKE_paint_runtime_init` was already called in
`BKE_paint_blend_read_data` anyway, so the only actual change was
setting `p->paint_cursor`... *sigh*
2023-08-15 12:02:37 +02:00
Jeroen Bakker b3ca211bf4 Cleanup: Code formatting 2023-08-15 07:43:03 +02:00
Campbell Barton 8c5c5142d5 Cleanup: use type checking for credits_git_gen.py & git_log.py 2023-08-15 15:18:01 +10:00
Campbell Barton 31c025c856 Cleanup: minor changes to credits_git_gen.py
- Don't write 2x blank lines in between each author.
- Don't abbreviate unicodedata as it's only used once.
2023-08-15 15:01:06 +10:00
Campbell Barton 08690709db Credit Script: use multi-processing, add --jobs command line argument
On my system this gives between 30-40x speedup, generating the credits
now takes about 36 seconds.

Move the is_credit_commit_valid check inside the process_commit method
to avoid bottle necking on a single process.
2023-08-15 14:22:53 +10:00
Clément Foucault dd9a92785a Metal: Fix incorrect texture 2D array read
Authored by Apple: Michael Parkin-White
2023-08-14 23:32:44 +02:00
Michael Kowalski ccbb185d39 USD import: improve unsupported type warning.
Now including the USD type name in the warning for
unsupported attribute types.
2023-08-14 15:51:00 -04:00