Commit Graph

109441 Commits

Author SHA1 Message Date
Clément Foucault
fd7b88a43b Fix: StudioLight: Alpha channel messing HDR values
Fixes #121760
2024-05-18 07:27:51 +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
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
42d6842654 Cleanup: resolve missing-declarations warning 2024-05-17 13:28:06 +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
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
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
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
Julian Eisel
7d80fde033 UI: Popup version of the asset shelf
Developed as part of the brush assets project, see #106303. No user visible
changes at this point.

Makes it possible to display asset shelves as popups. These popup asset shelves
use static storage for their settings, mainly to remember the active catalog
and filter string, while keeping them separate from the permanent asset shelf
region. Further, the popup can be displayed in any editor, making asset
selectors possible to add anywhere in the UI. When an asset is chosen, an
operator passed to the asset shelf as bl_activate_operator is called, with an
asset weak-reference to refer to the activated asset stored in the operator
properties.

Adds UILayout.template_asset_shelf_popover() to insert asset shelf popup
buttons, taking an asset shelf idname and some normal UI parameters.
2024-05-16 00:11:47 +02:00
Sean Kim
5a3fee92a5 Cleanup: Add API docs for new WorkspaceStatus methods
This PR adds usage documentation for the new WorkspaceStatus methods
and fixes a small typo in the implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/121810
2024-05-15 23:21:53 +02:00
Clément Foucault
1036d9bdb2 Cycles: Use blender's use_shadow RNA property
This unify Cycles and EEVEE setting.
We always copy the Cycles setting in versionning
except if the first scene is using EEVEE as renderer.

Note that this currently breaks importers
addons who will try to `cycles.cast_shadow`property
on the light.

Pull Request: https://projects.blender.org/blender/blender/pulls/121804
2024-05-15 22:00:55 +02:00
Harley Acheson
1391b7de41 UI: Loop Cut Status Display
While using "Loop Cut and Slide" show the cut count and smoothness
values on the area header and the keymap entries on the Status Bar.

Pull Request: https://projects.blender.org/blender/blender/pulls/121801
2024-05-15 21:07:21 +02:00
Harley Acheson
bef05382a0 Fix #121765: Default Separator for Pie Menu Should be UI_BTYPE_SEPR
As described in the report, pie menus can show horizontal lines if they
use separators without explicit type. This just makes them use blank
space by default instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/121839
2024-05-15 20:55:08 +02:00
Miguel Pozo
d64544a32f Fix: EEVEE-Next: ShaderKey subpass overlap
The same Shader may need to be used by more than one pipeline
subpass.
Include all relevant properties in ShaderKey to always retrieve the
correct subpass.
Fix #121667.

Pull Request: https://projects.blender.org/blender/blender/pulls/121834
2024-05-15 20:06:31 +02:00
Campbell Barton
c4a0bbb1f4 Extensions: Support online extensions and move add-ons outside Blender
The extensions system allows to extend Blender with connectivity to the internet. Right now it means Blender can
discover and install add-ons and themes directly from the internet, and notify users about their updates.

By default this is disabled (opt-in), and users can enable it the first time they try to install an extension or visit
the Prefences > Extensions tab. If this is enabled, Blender will automatically check for updates for
extensions.blender.org upon startup.

When will Blender access the remote repositories:

* Every time you open the Preferences → Extensions: ALL the enabled repositories get checked for the latest info (json)
* Every time you try to install by dragging: ALL the enabled repositories get checked for the latest info (json).
* Every time you start Blender: selected repositories get checked for the latest info (json).

------------------

From the Blender code point of view, this means that most of the add-ons and themes originally bundled with Blender
will now be available from the online platform, instead of bundled with Blender. The exception are add-ons which are
deemed core functionality which just happened to be written as Python add-ons.

Links:
* Original Extenesions Platform Announcement: https://code.blender.org/2022/10/blender-extensions-platform/
* Extensions website: https://extensions.blender.org/
* User Manual: https://docs.blender.org/manual/en/4.2/extensions/index.html#extensions-index
* Technical specifications: https://developer.blender.org/docs/features/extensions/
* Changes on add-ons bundling: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593

------------------

This PR does the following:

* Move extensions out of experimental.
* No longer install `scripts/addons` & `scripts/addons_contrib`.
* Add `scripts/addons_core` to blender's repository.

These add-ons will still be bundled with Blender and will be always enabled in the future, with their preferences
moved to be more closely integrated with the rest of Blender. This will happen during the remaining bcon2 period.
For more details, see #121830

From scripts/addons:

* copy_global_transform.py
* hydra_storm
* io_anim_bvh
* io_curve_svg
* io_mesh_uv_layout
* io_scene_fbx
* io_scene_gltf2
* pose_library
* ui_translate
* viewport_vr_preview

Extra: bl_pkg (scripts/addons_contrib)

Note: The STL (legacy) add-on is going to be moved to the extensions platform. There is already a C++ version on core
which is enabled by default.

All the other add-ons are already available at extensions.blender.org. To use them you need to:

* Go to User Preferences > Extensions
* You will be greated with an "Online Extensions" message, click on "Enable Repository".
* Search the add-on you are looking for (e.g, Import Images as Planes).
* Click on Install

Over time their maintaince will be transferred over to the community so their development can carry on. If you used to
help maintain a bundled add-on please read: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593

Ref: !121825
2024-05-15 19:26:29 +02:00
Sergey Sharybin
3b975dddcc Fix Cycles viewport not properly updating
Only happens under certain circumstances: when a renderable object is
not visible at the graph node build time, but becomes visible due to
some indirect dependency like instancing.

In order to solve this, report all updates via the depsgraph.updates.

Reproduced with 210_0040-lighting.blend from the Gold repository at
revision 2834: open the file, enter rendered viewport, change frame,
and observe that sails do not move with the boat.

Pull Request: https://projects.blender.org/blender/blender/pulls/121833
2024-05-15 18:27:04 +02:00
Harley Acheson
3fbc603137 UI: Mesh Bevel Status Display
While using the mesh Bevel operator, show the changing values on the
area header and keymap entries on the Status Bar using the new system
that shows icons and toggles. Approximately 30% shorter display.

Pull Request: https://projects.blender.org/blender/blender/pulls/121796
2024-05-15 18:12:22 +02:00
Hans Goudey
944be3d619 Refactor: GPv3: Store inverted hardness value
To simplify propagation of the attribute with joined geometry
(0.0 defaults are generally easier to handle with attributes, and
even more performant), store the inverse of the current "hardness"
attribute as "softness" instead. This change involves adding a few
`1.0f - value` operations, though in the future as the renderer is
replaced that mostly should become unnecessary.

Updated version of #118007.

Pull Request: https://projects.blender.org/blender/blender/pulls/121578
2024-05-15 17:51:35 +02:00
Hans Goudey
0a6f89d487 Cleanup: Sculpt: Use const pointers for orig vert data 2024-05-15 11:18:18 -04:00
Harley Acheson
5b249f62d0 Cleanup: Make format
Just formatting changes resulting from running Make Format.
2024-05-15 08:06:21 -07:00
Brecht Van Lommel
ad18fe673e Cleanup: Correct capitalization in comment 2024-05-15 17:04:49 +02:00
Hans Goudey
1cdc76ea41 Cleanup: Sculpt: Remove unused automasking function 2024-05-15 10:53:11 -04:00
Hans Goudey
1c1efb0a14 Cleanup: Sculpt: Move automasking functions to proper file 2024-05-15 10:51:04 -04:00
Hans Goudey
b8e419ba1e Cleanup: Sculpt: Use C++ types for orig vert data 2024-05-15 10:47:54 -04:00
Hans Goudey
b76612998c Cleanup: Sculpt: Use references, std::optional in automasking data 2024-05-15 10:47:46 -04:00
Chao Li
4b59c1bcbf GPv3: Merge by distance Operator
The algorithm to merge points based on distance thresholdhas been
implemented in 8b7d5f8587. This patch moves the function to
`blender::ed::greasepencil` namespace and use it to implement
merge by distance operator.

There are two parameters for the operator:
`threshold`: Distance threshold used for merging.
`use_unselected`: Use whole stroke or only selected points

Resolves: #113917
Pull Request: https://projects.blender.org/blender/blender/pulls/120385
2024-05-15 16:25:41 +02:00
Miguel Pozo
aa37e46152 Draw: Use GPUPass for default material fallback detection
Update #121137 to store the reused GPUPass on its own GPUMaterial,
instead of replacing the GPUMaterial itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/121790
2024-05-15 16:01:05 +02:00
Damien Picard
fb5e7caa70 UI: improve "Compact with Milliseconds" timecode style
The user preference Timecode Style has a "Compact with
Milliseconds" item, but they are not actually milliseconds. For
example at 25 fps, frame 42 will be at 00:01+17, or 00:01.68, which
is just seconds with the decimal part. Actual milliseconds would be
00:01+680ms or something, which would be cumbersome.

This PR rephrases the option to "Compact with Decimals" instead of
"Milliseconds".

Timecodes in animation editors currently show only one decimal
place when this timecode style is selected. This may not be
sufficient precision, so increase the precision to 2 places
instead.

If one animates at 25 fps, each timecode is currently duplicated 2
or 3 times, which makes it hard to distinguish each frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/119768
2024-05-15 15:25:14 +02:00
Philipp Oeser
710d168e30 Fix #121666: Modifying UVs of duplicate affects the original object
Caused by 7eee378ecc.

Since the implicit sharing commit, uv data was not unshared when
accessed. Fix along the ines of 34b4487844 (same downside of not being
able to tell if the data is just read -- or written to).

Pull Request: https://projects.blender.org/blender/blender/pulls/121786
2024-05-15 15:23:26 +02:00
Pratik Borhade
8e6b276f84 Fix #121660: Auto-keyframe icon Overlapping when Navigation Controls are off
This is due to the wrong offset when "navigation controls" is off. Axis
gizmo is still visible so "else" codeblock is expected to handle the
correct offset value.

Pull Request: https://projects.blender.org/blender/blender/pulls/121775
2024-05-15 14:22:32 +02:00
Lukas Tönne
7a3cd753ba GPv3: Fill tool to generate strokes in empty areas
Implementation of the GPv2 Fill tool in Grease Pencil 3.

This tool creates new strokes where the user clicks, by rendering
strokes into an image and then performing flood-fill and boundary
search operations.

This is a minimal first part, several features of the GPv2 tool are
still missing (gap filling methods, smoothing, dilate/erode).

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120693
2024-05-15 13:36:06 +02:00