Commit Graph

133392 Commits

Author SHA1 Message Date
Julian Eisel
2bfaf94fa7 Refactor: Lazy create & update asset catalog trees
Rebuilding the tree immediately after changes could cause the tree to be
rebuilt multiple times. More importantly, it made it harder to reason
about thread safety, since we would touch the tree within a whole bunch
of API functions. Now tree building is simplified and managed in a
single place, so making the tree building thread safe can be made
trivially in a follow-up.

Note, this means the initial catalog tree building doesn't happen in a
background thread together with loading the asset library and catalogs
anymore. But we would already do all further rebuilds on the main thread
anyway, this shouldn't have any notable impact.
2024-02-26 10:35:15 +01:00
Campbell Barton
a5ef7ac3bd Merge branch 'blender-v4.1-release' 2024-02-26 12:02:26 +11:00
Gangneron
462c144f41 Text Editor: add support for GLSL syntax highlighting
The objective is to be able to create your own GLSL shaders in Blender.
This improves the workflow since all shader programming can be done
directly in Blender. In addition, the GLSL language is a very popular
language in the video games industry and even in general.

Ref !116793

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
2024-02-26 11:57:41 +11:00
Campbell Barton
a8cc6bb75b Cleanup: spelling in comments 2024-02-26 10:23:52 +11:00
Campbell Barton
5db2a842c0 Unbreak build with GLIBC pre 2.28
Also de-duplicate rename logic for Linux & other UNIX systems.
2024-02-26 10:15:54 +11:00
Eugene Kuznetsov
7f43699ebf DRW: Curves: Indexbuf optimization for large numbers of curves
This optimizes a few loops that become significant bottlenecks during
viewport rendering of scenes with large numbers of curves.

To render a curves object, Blender needs to generate a potentially
very large (but trivial) index buffer. As previously implemented,
this index buffer is generated in an extremely inefficient manner,
with a single-threaded loop and an explicit function call per entry.
The buffer then needs to be pushed onto the GPU, which is also a fairly
slow task.

The PR generates the index buffer directly on the GPU with compute
shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/116617
2024-02-25 17:22:58 +01:00
Jacques Lucke
9a3ceb79de BLI: add weighted parallel for function
The standard `threading::parallel_for` function tries to split the range into
uniformly sized subranges. This is great if each element takes approximately
the same amount of time to compute.

However, there are also situations where the time required to do the work for
a single index differs significantly between different indices. In such a case,
it's better to split the tasks into segments while taking the size of each task into
account.

This patch implements `threading::parallel_for_weighted` which allows passing
in an additional callback that returns the size of each task.

Pull Request: https://projects.blender.org/blender/blender/pulls/118348
2024-02-25 15:01:05 +01:00
Campbell Barton
91895bf806 Unbreak build with GLIBC pre 2.28
Also de-duplicate rename logic for Linux & other UNIX systems.
2024-02-25 22:56:22 +11:00
Pratik Borhade
2bad37a219 GPv3: Active layer poll
This is required to avoid execution of operator and disable them in UI when
object has no active layer (this is same as legacy GP)

Pull Request: https://projects.blender.org/blender/blender/pulls/118609
2024-02-25 08:19:59 +01:00
Pratik Borhade
7ae8e1dc07 GPv3: Select strokes by material operator
Port legacy gp operator `GPENCIL_OT_material_select`

Pull Request: https://projects.blender.org/blender/blender/pulls/118652
2024-02-25 08:18:58 +01:00
Jesse Yurkovich
0a2544f2e8 Merge branch 'blender-v4.1-release' 2024-02-24 15:03:01 -08:00
Jesse Yurkovich
0f266ca3c9 Fix #118704: STL batch export used wrong filename
The newly generated filename for batches was not used.

Pull Request: https://projects.blender.org/blender/blender/pulls/118708
2024-02-25 00:01:33 +01:00
Bastien Montagne
3dc0bc27d3 GPv3: Conversion: Copy over FakeUser and IDProperties.
When creating a new GreasePencil ID from an existing bGPdata legacy ID,
also copy FakeUser flag, and the IDProperties.
2024-02-24 20:26:12 +01:00
Bastien Montagne
f2eab300b7 Core: IDRemapp: Allow remapping mismatching ID types.
While this should not be allowed in most cases, in some (e.g.conversion
between different ID types), this is actually a valid operation.
2024-02-24 20:19:55 +01:00
Harley Acheson
311e0270dd UI: Improvements to Confirmation of Pack Resources
A more informative confirmation dialog to confirm that the user wishes
to pack resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/117155
2024-02-24 01:42:20 +01:00
Harley Acheson
5eda7c9fd3 UI: Improvements to Confirmation of Apply Modifier
A more informative confirmation dialog to confirm that the user wishes
to apply modifier to an object with multiple users.

Pull Request: https://projects.blender.org/blender/blender/pulls/117156
2024-02-24 01:38:34 +01:00
Harley Acheson
2c8a3243ee UI: Improvements to Confirmation of Apply Transforms
A more informative confirmation dialog to confirm that the user wishes
to apply transforms to an object with multiple users.

Pull Request: https://projects.blender.org/blender/blender/pulls/117157
2024-02-24 01:32:53 +01:00
Clément Foucault
06d3627c43 EEVEE-Next: Make closure evaluation fully type agnostic
The goal of this task is to remove noise in the most common material
layering configuration.

Subsequently, this also split the evaluation of different closure to
their own buffer to avoid discontinuity when denoising them.

This commit does a few things:
- [x] Removes use of global for closure random number.
- [x] Refactor the forward evaluation to be closure type agnostic.
- [x] Refactor the gbuffer lib to be closure type agnostic.
- [x] Reduces the number of picked closure to 3 maximum or less.
- [x] Use GPU_MATFLAG_COAT to tag the use of multiple usage of glossy BSDF.
- [x] Use two closure bin for Glossy when more than one.
- [x] Set closure bin per type for best noise level for most materials.
- [x] Change the gbuffer header to put the closure at their bin index.
- [x] Add a method to get a closure from the gbuffer from a specific bin.
- [x] Split lighting passes per Closure.

Pull Request: https://projects.blender.org/blender/blender/pulls/118079
2024-02-24 00:00:11 +01:00
Hans Goudey
eaea3b846f Cleanup: Small tweaks to sample grid node
- Remove unnecessary includes
- Correct muli-function debug name
- Remove unnecessary variable
2024-02-23 16:53:29 -05:00
Brecht Van Lommel
5c7df5ef85 Tests: Update and add new workbench reference renders 2024-02-23 19:22:43 +01:00
Lukas Tönne
1d014cc34d GPv3: Conversion code for remaining modifiers
Adds conversion from GPv2 modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/118523
2024-02-23 19:17:52 +01:00
Hans Goudey
77f8a79a96 Cleanup: Use named function for math::Axis char constructor
It was too easy for implicit conversions to use this constructor
by mistake, when values are often 0,1,2 in enum properties.
2024-02-23 12:41:22 -05:00
Miguel Pozo
e842e9fd4c EEVEE-Next: Concatenate info strings
Pull Request: https://projects.blender.org/blender/blender/pulls/118674
2024-02-23 18:39:53 +01:00
Miguel Pozo
ae3220e62b Fix #112041: EEVEE-Next: Distant tranparent object shadow tagging
Ensure dist_to_light is >0.
Otherwise the log2 in lod selection falls into undefined behavior.
2024-02-23 18:33:56 +01:00
Lukas Tönne
690cc6e3cb GPv3: Minor modifier fixes
A couple of small fixes for new Grease Pencil v3 modifiers: typos,
unused properties, draw code for undefined RNA properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/118675
2024-02-23 18:18:23 +01:00
Julian Eisel
57dfc2a885 Cleanup: Make catalog tree const-correct
Basic motivation is that `AssetCatalogService::get_catalog_tree()`
should return a const tree, since this tree is internal state and
shouldn't be modified from outside. This exposed a whole bunch of const
incorrectnesses and just generally allows to make much more of the API
const (as it should be).

Also use references instead of pointers in testing functions, where null
is not an expected value.
2024-02-23 18:13:10 +01:00
Julian Eisel
b07506c87b Fix unintentional copies of asset catalog tree items in asset shelf
The asset catalog selector tree-view would store a copy of each of the
items in the catalog tree, including all of its sub-hierarchy. This can
be avoided, it can just use a reference.
2024-02-23 18:13:10 +01:00
Julian Eisel
53273e4460 Cleanup: Use const for asset catalog query 2024-02-23 18:13:10 +01:00
Sergey Sharybin
ca63ce835f Merge branch 'blender-v4.1-release' 2024-02-23 17:41:22 +01:00
Sergey Sharybin
9277377f6b Make update: Show Git LFS download progress
Solves the issue of the script potentially sitting for a long time
without having any progress reported. Confusingly, such behavior
depends on Git version.

In older versions (< 2.33) there will be progress reported, but it
then got changed by the commit in Git:

  7a132c628e

The delayed checkout is exactly how Git LFS integrates into the Git
process. Another affecting factor for the behavior is that submodule
configured to use "checkout" update policy is forced to have quite
flag passed to the "git checkout":

  https://github.com/git/git/blob/v2.43.2/builtin/submodule--helper.c#L2258

This is done to avoid the long message at the end of checkout about
the detached state of HEAD, with instructions how to resolve that.

There are two possible solutions: either use "rebase" update policy
for submodules, or skip Git LFS download during the submodule update.

Changing the update policy is possible, but it needs to be done with
a bit of care, and possible revised process for updating/merging
tests data.

This change follows the second idea of delaying LFS download for a
later step, so the process is the following:
- Run `git submodule update`, but tell Git LFS to not resolve the links
  by using GIT_LFS_SKIP_SMUDGE=1 environment variable.
- Run `git lfs pull` for the submodule, to resolve the links.

Doing so bypasses hardcoded silencing in the Git. It also potentially
allows to recover from an aborted download process.

The `git lfs pull` seems to be a nominal step to resolve the LFS links
after the smudging has been skipped. It is also how in earlier Git
versions some Windows limitations were bypassed:

  https://www.mankier.com/7/git-lfs-faq

The submodule update now also receives the "--progress" flag, which
logs the initial Git repository checkout process, which further
improves the feedback.

The byproduct of this change is that an error during precompiled
libraries and tests data update is not considered to be fatal.
It seems to be more fitting with other update steps, and allows
more easily reuse some code.

There is also a cosmetic change: the messages at the end of the
update process now have their own header, allowing more easily
see them in the wall-of-text.

Pull Request: https://projects.blender.org/blender/blender/pulls/118673
2024-02-23 17:40:59 +01:00
Sybren A. Stüvel
37eab3f5bc Cleanup: document ANIM_animdata_get_context side-effects
Document a (for me unexpected) side-effect of `ANIM_animdata_get_context`.

No functional changes.
2024-02-23 17:14:48 +01:00
Sybren A. Stüvel
f91c6a241c Cleanup: expand documentation of how to register DNA defaults
No functional changes.
2024-02-23 17:14:48 +01:00
Miguel Pozo
014979f9f2 Update shader math images 2024-02-23 16:53:39 +01:00
Jeroen Bakker
7da72a938c EEVEE: Reset samples when reflection probes are updated.
This fixes an issue where the number of viewport samples are set
to 1 and reprojection is deactivated. In this case the sample that
has the data to update the probes is ignored as all samples where
already rendered. A tweak in the viewport was needed to fix this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/118654
2024-02-23 15:53:52 +01:00
Sebastian Parborg
86c8c27974 Merge branch 'blender-v4.1-release' 2024-02-23 15:35:31 +01:00
Philipp Oeser
c75d2d09e3 Fix: Cloth could ignore "Shear" vertexgroup
Oversight in e3d31b8dfb

While most situations would have other vertexgroups set anyways (so this
probably wasnt noticed, it was only ignored if it is the only
vertexgroup used), at least theoretically it could happen that
`cloth_uses_vgroup` would return false even then `vgroup_shear` is set
(thus skipping actually setting these weights later).
2024-02-23 15:34:12 +01:00
ok_what
8b5f11839e Fix: Copying strip inside meta, copies top-most meta instead
When inside a meta strip, copying and pasting a strip would copy the
top-most meta strip, rather than the intended strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/118090
2024-02-23 15:08:14 +01:00
Jeroen Bakker
03833417b3 EEVEE-Next: Fix black world probe when disabling probes
When disabling/enabling reflection probes the atlas texture can be
recreated removing the existing content of the texture. When this
happens the world probe needs to be rerendered.

Pull Request: https://projects.blender.org/blender/blender/pulls/118656
2024-02-23 14:04:36 +01:00
Julian Eisel
ee3291dc6d Fix double loading of asset catalogs when reloading "All" library
`refresh_catalogs()` for the "All" asset library effectively does the
same as iterating over all other asset libraries and calling
`get_asset_library()` on them. So doing both just performs the same work
twice.
2024-02-23 13:02:54 +01:00
Julian Eisel
49c7dfe904 Fix unintended reloading of asset catalog files from disk
Mistake in #118463.

Updating the catalogs of the "All" asset library would also reload
catalog data of the other asset libraries from disk. This wasn't
intended, this should be done with an explicit load request only (and on
a thread to not block the main thread).
2024-02-23 12:55:38 +01:00
Weizhen Huang
7f2193ff9e Merge branch 'blender-v4.1-release' 2024-02-23 12:51:57 +01:00
Weizhen Huang
95d11b0d33 Fix Cycles area light using MIS when the spread is zero
area light with zero spread was introduced in bf18032977. Such paths can
only be sampled with NEE, so MIS should not be used.
This fixes the discrepancy when Direct Light Sampling is set to MIS or NEE.

Pull Request: #118584
2024-02-23 12:40:48 +01:00
Weizhen Huang
f7c94754a0 Tests: Update microfacet hair reference render for changes 2024-02-23 12:36:55 +01:00
Sergey Sharybin
9b2c312ac7 Merge branch 'blender-v4.1-release' 2024-02-23 12:33:11 +01:00
Weizhen Huang
c292d4dbee Fix assigning value to nullptr 2024-02-23 12:29:39 +01:00
Weizhen Huang
63dd44c810 Cleanup: avoid implicit conversion from int to float 2024-02-23 12:28:46 +01:00
Weizhen Huang
92c4a5fa09 Fix Principled Hair Huang wrong TIR condition
`cos_theta_t` was not initialized for TIR case

Thanks Christophe Hery for spotting the bug
2024-02-23 12:28:23 +01:00
Weizhen Huang
65d910aef7 Fix wrong roughness in Principled Hair Huang trrt+ component 2024-02-23 12:28:08 +01:00
Sergey Sharybin
63613e431e Fix make update pulling libraries when --no-libraries is provided
Likewise, skip tests update when --use-tests is not provided.

It was a bit of ambiguous situation because libraries and tests
are technically submodules. After some feedback it seems that it
is better to ignore submodule for libraries and tests unless
requested explicitly.

Pull Request: https://projects.blender.org/blender/blender/pulls/118631
2024-02-23 12:24:22 +01:00
Pratik Borhade
80e7c04726 Fix #118475: Regression: NLA/driver data missing in outliner
Caused by 0a633a4e07
NLA and driver tree-elements were not added to the outliner when
"action" is unlinked from the object. This is due to the wrong `if`
condition preventing the excution of `expand_drivers/expand_NLA_tracks`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118597
2024-02-23 12:07:40 +01:00