Commit Graph

136208 Commits

Author SHA1 Message Date
Julien Duroure
876bfdcbdf glTF exporter: Fix #121878 crash when exporting without animation 2024-05-18 08:50:21 +02:00
Clément Foucault
fd7b88a43b Fix: StudioLight: Alpha channel messing HDR values
Fixes #121760
2024-05-18 07:27:51 +02:00
Julien Duroure
733bd00432 glTF exporter: fix typo in Vertex Color Alpha management 2024-05-18 07:00:58 +02:00
Harley Acheson
ba36c69c9f Refactor: Add BLF Function to determine input selection boxes
Add a separate function that calculates text selection box positioning
given a string's selection start and end offsets. Moves this to a
better place and allows to have more complex boxes in future when we
might have multi-line and/or multi-directional text input.

Pull Request: https://projects.blender.org/blender/blender/pulls/121448
2024-05-18 00:13:32 +02:00
Sean Kim
31560ca26a Cleanup: Shorten & cleanup names in paint_mask.cc
* Removes unncessary prefixes
* Adds doxygen sections
* Converts a single class to enum class and renames values

Pull Request: https://projects.blender.org/blender/blender/pulls/121896
2024-05-17 18:47:28 +02:00
Lalit Shankar Chowdhury
1456dafa27 Windows: Use COM smart pointers in WASAPI plugin
Use COM smart pointer (`ComPtr`) to simplify memory management in WASAPI driver.

This reduces chances of calling `Release()` when a COM object has not been allocated.

Pull Request: https://projects.blender.org/blender/blender/pulls/121828
2024-05-17 17:00:40 +02:00
Bastien Montagne
e30893e3c2 Fix #121410: Break liboverride hierarchies on Scene IDs.
This commit prevents considering Scenes (and a few other ID types, like
WindowManager or Library) as being part of liboverride hierarchies.

Having collections, objects, obdata etc. depend on a Scene ID is
typically not considered as a valid setup for linked data.

And in any case, Scenes are not officially supported for liboverrides
currently.

In the case of #121410, where a driver of the armature object was using
the Scene ID, it will simply keep that scene reference pointing to the
linked scene, instead of overriding the whole scene.
2024-05-17 16:05:55 +02:00
Bastien Montagne
e85ef6add2 LibOverride: Refactor: de-duplicate 'is part of the hierarchy' checks.
Code checking whether an ID should be considered as part of the
currently processed liboverride hierarchy or not was very similar all
over the liboverride code.

It is now deduplicated into two util functions, which helps ensuring
coherence in these checks, and future potential changes in this
filtering process.

NOTE: While no pratical changes are expected form user PoV with this
refactor, technically it does modifies the behavior in some cases (added
checks).
2024-05-17 16:05:55 +02:00
Bastien Montagne
f6441bdd92 Fix #121410: Prevent diffing of Scene's tool settings.
This is a bit of a hack hammer to solve a specific issue, but it is not
really clear to my currently why some of these tool settings get
invalid data.

On the other end, not sure that it would make any sense to consider
these 'runtime' data for liboverrides anyway.
2024-05-17 16:05:55 +02:00
Nathan Vegdahl
98b0bfa9e7 Refactor: make yet more fcurve evaluation functions take const fcurves
This follows on after #121788.

Pull Request: https://projects.blender.org/blender/blender/pulls/121882
2024-05-17 15:56:57 +02:00
Clément Foucault
0a8a11cc9a EEVEE-Next: Shadow: Remove uneeded -1 bias
The -1 bias was counteracted by the ceil.
Remove both
2024-05-17 15:50:07 +02:00
Michael Kowalski
e4ef0f6ff4 USD: UsdGeomPoints import support
The commit addresses issue #106398.

Provide an implementation of a `USDPointsReader` class to import
`UsdGeomPoints` primitives as Blender Point Clouds.

Co-authored-by: DevinBayly <baylyd@email.arizona.edu>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120060
2024-05-17 14:59:44 +02:00
Pratik Borhade
017cd53e96 Cleanup: Pass nullptr instead of 0 for gpv3 layer pointer
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/121914
2024-05-17 13:54:04 +02:00
Jason Fielder
47ada34324 Metal: Remove redundant synchronization operations
Remove both compute barriers and useResource calls
as explicit resources bound via setTexture and
setComputeBuffer are implicitly tracked by the Metal
API anyway, so these calls increase complexity, without
altering correctness

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121598
2024-05-17 13:38:55 +02:00
Omar Emara
d4bf23771d Compositor: Optimize Fog Glow Glare node
This patches optimizes the Fog Glow Glare node to be about 25x faster
for 4K images. This is mainly achieved by utilizing the FFTW library and
multi-threading support code. Further improvements are still possible by
caching kernels, but the CPU compositor does not support caching yet.

The old Hartley transform was removed, so the node no longer works when
FFTW is disabled as a build time option, much like the OIDN node. A new
BLI library was introduced for FFTW, it includes some helper routines
relevant for FFTW as well as an initialization routine that sets up
multithreading using TBB as well as thread safety.

Build system support for threaded FFTW was also added, which defines the
relevant variables to detect threading support as well as add the
relevant libraries.

We do not currently have the threaded FFTW libs in our precompiled libs,
so the threading code is disabled until the libs lands in the coming
weeks. So currently, the code is only about 9x faster.

The only functional change is that the kernel is now odd sized, which
should produce more accurate results, but the final result is almost
identical and mostly undetectable.

The plan is to port this to the GPU as well similar to how we implement
OIDN until we have a GPU FFT implementation. GPU compositor can also do
caching, so it should be faster, being able to compute a 4K image in
under half a second.

Pull Request: https://projects.blender.org/blender/blender/pulls/121653
2024-05-17 12:45:21 +02:00
Jeroen Bakker
bc1e255d64 Fix #115460: EEVEE-Next: Missing bind when drawing curves
When drawing hair/curves the material shader has a "a" texture slot,
but this slot was never bound to a texture. This PR fixes this by
adding a default texture to it and when available tries to bind
CD_AUTO_FROM_NAME resources.

This part seems to be not implemented when the new curve rendering
was added. `CD_AUTO_FROM_NAME` was never considered and therefore the
layer could not be found and the sampler could not be found.

Fixes #115460

Pull Request: https://projects.blender.org/blender/blender/pulls/121064
2024-05-17 11:15:55 +02:00
Campbell Barton
95a74a02bc Cleanup: format 2024-05-17 15:45:31 +10:00
Campbell Barton
dc7cfb7905 Extensions: improve colors for the "list" subcommand
The dark-grey tagline on black was difficult to read.
2024-05-17 14:53:17 +10:00
Campbell Barton
c598e8c8a7 Fix #121876: index.json error in console, accumulation of @ files
Fix missing check for the existence of index.json before removal.
Also write errors to the stderr instead of the stdout.
2024-05-17 13:56:52 +10:00
Campbell Barton
42d6842654 Cleanup: resolve missing-declarations warning 2024-05-17 13:28:06 +10:00
Campbell Barton
bf7267638a Fix #121892: string formatting errors in the clip editor & sequencer
Regression in 0e3b594edb.
2024-05-17 13:24:34 +10:00
Campbell Barton
2391407116 Cleanup: resolve mypy type warnings 2024-05-17 12:15:03 +10:00
Campbell Barton
676ac9cfb1 Cleanup: de-duplicate error handling when downloading extension data 2024-05-17 12:01:25 +10:00
Campbell Barton
489b6aed18 Extensions: always show errors when checking for updates fails 2024-05-17 12:01:07 +10:00
Campbell Barton
05617ed07d Extensions: clarify defaults in extension command line help text
Also don't use `.` for the output-filepath because it's not a directory.
2024-05-17 10:32:20 +10:00
Clément Foucault
1558bc7cb4 Fix: EEVEE-Next: Raytrace: Wrong ray BSDF bias
The bias was cutting the wrong end of the distribution,
making the result noisier than it should and missing
rays in the center.

This also increases the bias a bit more to reduce
noise.
2024-05-16 22:40:03 +02:00
YimingWu
3f07c63925 Fix #121848: Hide area status text cancelling loopcut
The status text in the viewport for loopcut tool will persist if
cancelled without doing any cuts, this prevented normal UI from showing.
Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121849
2024-05-16 17:29:34 +02:00
Nathan Vegdahl
848bd505b4 Refactor: make evaluate_fcurve() take its FCurve as const instead of mutable
This required making a whole bunch of other functions in the call chain
take const parameters as well.  It also required changing some function
pointers in some types to take const parameters, which in turn required
changing all the functions that are pointed to by those function
pointers to take const parameters as well.

Additionally, there was one mutable usage of the `FModifier *` parameter
in `fcm_cycles_time()` that had to be removed to make the call chain
const.  However, this turned out to be a code path that shouldn't be
reachable, and would represent a bug elsewhere.  So it was changed to
an assert.

All in all, the non-constness was deep and tangled.

There's still a lot more that we can make const, but I wanted to keep
this change as narrow and focused as possible.
2024-05-16 17:13:43 +02:00
Bastien Montagne
4d944c5491 Link/Append: Remove a deprecated hack to handle liboverrides.
Code used to tag liboverrides references as 'pre-existing' to force code
further down the way to always keep these IDs linked.

However, this was a (bad) hack, since it could have uncontrollable
side-effects, abusing a tag for somethig else than its original meaning.
And this should not have been needed for quite some time already, as
liboverrides handling was already properly done by append
post-processing code.

No behavior change expected here.
2024-05-16 16:22:47 +02:00
Bastien Montagne
45f77e61c4 Fix #121457: Append & Reuse corrupting Main data-base in some cases.
In a nutshell, the handling of dependencies in the 'append' part of the
code was not fully correct, and could break badly in some complex cases
(like appending complex hierarchies of data partially re-using some
dependencies from other previously appended data).

This could lead to e.g. some linked data referencing some local IDs...
straight way to crash in undo case (among many other problems).

Previous code was fairly compact and tried to be smart and efficient,
making some not-always-correct assumptions, and being quite hard to
fully understand.

So the first step of this fix was some refactoring:
  * Splitting the post-process part of the 'link' case into its own
    function (it is fairly trivial, and while it does duplicate some
    logic to some extent, it makes the overall link/append process
    clearer).
  * Heavily refactoring the part of the 'append' code that decides how
    to handle each linked ID.

The append-related post-processing is now significantly more complex,
but hopefully better divided in reasonably logical steps. And it is now
expected to deal with complex re-usability cases properly.

Pull Request: https://projects.blender.org/blender/blender/pulls/121867
2024-05-16 16:20:49 +02:00
Campbell Barton
64c4c939a9 Fix "missing scripts" being unavailable in the extensions UI
Add-ons which were enabled but not found warn on startup
and were shown under "Missing scripts", where they can be ignored
(the user can choose to restore the paths) or disabled them to suppress
the warnings in future.

This is now available again, with a minor refactor.
2024-05-16 22:55:20 +10:00
Brecht Van Lommel
a926f5b67d Refactor: Replace ID_IS_LINKED by !ID_IS_EDITABLE
Add new ID_IS_EDITABLE macro that checks if the ID can be edited in the
user interface. Replace usage of ID_IS_LINKED where it is used with this
meaning.

Also add a corresponding ID.is_editable property for Python.

This prepares for the ability to edit some linked datablocks for brush
assets.

Pull Request: https://projects.blender.org/blender/blender/pulls/121838
2024-05-16 14:53:09 +02:00
Vitaljok
2c1238466d Fixing object index value for EEVEE-Next
EEVEE Next uses different bit representation of object index values pushed
to GPU in contrast to EEVEE (Legacy). The fix accounts both approaches.

Fix #121690.

Pull Request: https://projects.blender.org/blender/blender/pulls/121870
2024-05-16 14:37:32 +02:00
Falk David
e78fbad5fa Cleanup: GPv3: Rename "null" frames to "end" frames
The end of a fixed duration frame is stored as a special
`GreasePencilFrame`, notably with a `drawing_index` of
-1.

These were previously called "null" frames (because they
don't point to a drawing). But this name wasn't great.

This commit renames these to the more descriptive
"end" frame. In code, they are `GreasePencilFrame::end()`
and can be checked for with `frame.is_end()`.

All comments and function names referring to "null"
frames have also been updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/121868
2024-05-16 14:34:29 +02:00
Brecht Van Lommel
430c58bbb2 Fix: Inconsistent use of Add-On in label instead of Add-on 2024-05-16 14:05:29 +02:00
Julien Duroure
b583b6ec39 glTF I/O: Use nodes for alpha clipping
Replace the use of Blend Mode on EEVEE (legacy), not existing on EEVEE-Next
2024-05-16 13:14:41 +02:00
Campbell Barton
3003953e14 Extensions: rename the internal name for repository JSON
Use the name "index.json" instead of "bl_ext_repo.json".

This makes more sense as the name is automatically added to the end
of file:// URL's a little like index.html for web-sites.
2024-05-16 20:44:59 +10:00
Campbell Barton
1e852879c5 Cleanup: remove extensions readme
Some of this is outdated.
Documentation for extensions is now part of developers docs.
2024-05-16 20:43:40 +10:00
Clément Foucault
16be59a0f8 Fix: EEVEE-Next: Low Reflection tracing resolution
This happened at roughness near 0.

Loading the gbuffer in the tracing shader is quite
bad for perf but we can optimize that later on.
2024-05-16 09:40:36 +02:00
Campbell Barton
d91e6f7b14 Extensions: use the modal update when enabling the repository
This allows the user to cancel the update by pressing escape.
2024-05-16 17:01:44 +10:00
Campbell Barton
af996db23a Extensions: use the wait cursor for modal actions
Actions such as update/install now use the wait cursor.
2024-05-16 17:01:44 +10:00
Campbell Barton
30f4a5e051 Fix error checking for updates on startup
Manually deleting the extensions directory caused checking for
updates on startup to fail.

It attempted to create a directory without the parent existing
which raised an error.
2024-05-16 17:01:44 +10:00
Campbell Barton
8ff15f1c70 Cleanup: restore error, exclude extensions tests from bl_load_py_modules
Also remove outdated exclusions.
2024-05-16 16:02:25 +10:00
Campbell Barton
ccb1fcb5a5 Cleanup: use more descriptive names for module test exclusion
Include comments for how exclusion works.
2024-05-16 15:57:28 +10:00
Campbell Barton
6e6ce17e34 Addons: include addons_core/modules in sys.path when found
Renaming "addons" to "addons_core" should have included this change.
2024-05-16 15:18:42 +10:00
Campbell Barton
744819cf9b Addons: only ever check "addons_core" for bundled add-ons
Avoid checking every scripts directory for add-ons core,
as creating this directory would cause "addons" to be ignored.
2024-05-16 15:06:10 +10:00
YimingWu
401401b7f2 GPv3: LinArt: Handle shared cache for v3.
Shared cache in GPv3 line art is created before
`MOD_lineart_compute_feature_lines_v3`, the function will create its own
cache and overwrite the old one, causing memory leak. Now all code paths
have been fixed.
2024-05-16 12:30:03 +08:00
YimingWu
66a338741e GPv3: LinArt: Missing walk() for target_material
In `foreach_ID_link` of LineArt v3, the `walk()` call for
`target_material` is missing, causing crash on reopening. Now fixed.
2024-05-16 11:51:25 +08:00
Campbell Barton
672d203e67 Extensions: support file URI's for the remote URL
Previously regular paths were supported however supporting both
URL's and file paths isn't very common & complicated internal logic.

Also fixed an error where the server-generate sub-command created the
"archive_url" from the file-name without URL encoding.
2024-05-16 13:41:39 +10:00
Campbell Barton
dd1769088b Fix error dropping a local extension onto Blender 2024-05-16 12:11:46 +10:00