Commit Graph

110339 Commits

Author SHA1 Message Date
Jesse Yurkovich
4806078dbd Fix: USD: Use correct property names in RNA update callback
Use the correct property names in the up and forward axis update
callbacks. Otherwise they don't work as intended and the following will
be traced to the console:
```
RNA_enum_get: WM_OT_usd_export.forward_axis not found.
RNA_enum_get: WM_OT_usd_export.up_axis not found.
```

Pull Request: https://projects.blender.org/blender/blender/pulls/124112
2024-07-04 02:03:27 +02:00
Michael Kowalski
94c184d2a7 USD: custom properties export improvements
Added a new custom_properties_namespace USD export option, to
allow replacing or omitting the current default "userProperties"
namespace prefix.

Note that this option does not apply to names that already have a prefix
(e.g., it would apply to name "bar" but not "foo:bar").  It also does not apply
to the  internal Blender "object_name" and "data_name" properties which
always have the prefix "userProperties:blender".

Also added logic to handle ":" namespace delimiters in property names.

Pull Request: https://projects.blender.org/blender/blender/pulls/124067
2024-07-04 00:45:30 +02:00
Jesse Yurkovich
e9ba414799 Fix #124103: Build error when using WITH_USD but not WITH_HYDRA
Move a few functions to a common location so that they're all accessible
from both USD and Hydra.

Pull Request: https://projects.blender.org/blender/blender/pulls/124119
2024-07-03 22:02:53 +02:00
Clément Foucault
71159872a4 Fix: EEVEE: VDB renders as bounding box when using Volume Scatter
Use the same approach as Cycles and only render the volume
objects if the shader is using any attribute.

Fix #124061
2024-07-03 16:27:08 +02:00
Clément Foucault
e10dcc01bd Fix: EEVEE: Avoid loosing SSS small radius energy
This was caused by the effective radius of some
components were below the first sample radius.
This meant that the accumulation resulted in zero
weight for these components.

This patch introduce a minimum radius that can
be represented depending on the sample closest
to the center pixel. This makes sure that we
have at least one sample that will have
non-zero weight.

Fix #124031
2024-07-03 15:09:19 +02:00
Aras Pranckevicius
44510662e9 Fix #123541: VSE thumbnails in some cases are drawn outside of the strip
Code was using seq->start + seq->len to figure out where the "right
side of content" is, seemingly since forever (i.e. since 997b5fe4
added strip thumbnails). But that is incorrect starting with 3.3,
where seq->len is "number of frames / samples in source media",
but that does not necessarily match number of frames in the timeline.
For movies this happens when media framerate does not match
sequencer framerate.

Use SEQ_time_content_end_frame_get instead to calculate where the
content ends.

Pull Request: https://projects.blender.org/blender/blender/pulls/124081
2024-07-03 14:59:07 +02:00
Clément Foucault
4d2fcc5716 Fix: EEVEE: Avoid assert from empty volume object material
Also avoid drawing them at all if the material has no
volume shader.
2024-07-03 14:40:54 +02:00
Alaska
1e6161759e Fix #124073: Incorrect material shadow mode versioning
Only apply EEVEE-Next material shadow versioning to materials with
surfaces. Otherwise this will break the rendering of some materials
(E.g. Volumetrics) by making the surface opaque to the camera.

Pull Request: https://projects.blender.org/blender/blender/pulls/124076
2024-07-03 14:23:40 +02:00
Omar Emara
81e4fa29b8 Compositor: Allow Glare node size below 6
This patch allows the size of the Glare node to be below 6. This is not
really a fix, but it is targeting the release branch because of concerns
about this limitation which din't exist for old EEVEE bloom.

Pull Request: https://projects.blender.org/blender/blender/pulls/124092
2024-07-03 12:30:42 +02:00
Omar Emara
30643fcf9b Fix: Bloom glare crashes when image is too small
The Bloom mode of the Glare node crashes if the input image is too
small. This is because bloom is computed using a down-sampling followed
by an up-sampling chain, and if the user supplied size is not maximum,
the computed chain length might be zero or negative, which is not
handled gracefully. To fix this, we just sanitize the chain length.

Pull Request: https://projects.blender.org/blender/blender/pulls/124089
2024-07-03 11:27:26 +02:00
Campbell Barton
463c05b341 Extensions: fix missing redraw after setting tags, report adding a repo
- Report when a repository is added since it's not so clear from the
  popup that a new repository has been added.
- Fix for missing redraw after selecting all/none tags.
- Also access the tags property once instead of getting it for each
  button.
2024-07-03 16:56:01 +10:00
Jacques Lucke
edd1749e22 Fix #124049: object losing user count in geometry nodes modifier 2024-07-02 20:32:24 +02:00
Clément Foucault
8718aa5513 Fix: EEVEE: Film: Sub-optimal sampling at lower filter size
The `sample_disk` returns samples inside a disk of radius 1
which was spanning 2 pixels. The blackmann-haris filter has
not much energy at the edge of the filter and since we
don't importance sample the filter, we have very low weight
samples at some time steps. Improve this by biasing the
distribution towards the center.

This is a temporary solution until we have proper importance
sample of the filtering function for this case.

Fix #123630
2024-07-02 20:31:20 +02:00
Clément Foucault
04b460317a Fix: EEVEE: Missing diffuse indirect lighting
Cause by lightprobe volume cache size change.

This was missing a simple update tagging for
the world to be reuploaded.
2024-07-02 18:07:09 +02:00
Omar Emara
5a56a56435 Fix: Missing compositor texture node updates
The output of the Texture node in the compositor does not update when
the texture settings or the texture type is adjusted. That's because
texture evaluations are cached, and the cache is not invalidated when
needed.

This happens because we rely on the depsgraph to tag changes to textures
so that the cache is invalidated. The tagging doesn't happen because the
texture ID is actually not part of the depsgraph in some cases. This is
so because the Texture ID property in the node does not update depsgraph
relations when it changed, so the depsgraph is out of sync with the node
tree.

This patch fixes that by invoking a depsgraph relations updates when
ever an ID property used by the compositor is changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/124050
2024-07-02 17:11:29 +02:00
Miguel Pozo
9691ff004a Fix #122456: EEVEE: Reset history on volume updates
Pull Request: https://projects.blender.org/blender/blender/pulls/123916
2024-07-02 17:07:43 +02:00
Miguel Pozo
b0fbd550e0 Fix #124011: GPU: Broken specialization constants
Don't store pointers to `blender::Map` items since, unlike `std::map`,
they're not guaranteed to stay valid.
This resulted in shader binaries being loaded into the wrong
specialization.

Pull Request: https://projects.blender.org/blender/blender/pulls/124051
2024-07-02 16:59:22 +02:00
Bastien Montagne
570eee1717 Debug: Add new userpref option to enforce recompute of ID usercount on filesave.
This is a workaround to allow user to keep working without loss of data
when an issue like #124049 happens.

This commit also expose again the `use_all_linked_data_direct` debug
option, no idea why that one was removed.
2024-07-02 16:46:19 +02:00
Clément Foucault
d8fef30b36 Fix: EEVEE: Broken object attributes on volume, pointcloud and curves
This was a simple oversight.

Also adding a version of `extract_object_attributes` for
single material object.

Fixes #123997
2024-07-02 16:41:12 +02:00
Iliya Katueshenock
3f6d9fa00d Fix #123971: Geometry Nodes: Offset Point in Curve incorrect result
There is was UB due to using of mapped vertex index as index of
offset instead of do read offsets and indices in the same way.

Pull Request: https://projects.blender.org/blender/blender/pulls/124035
2024-07-02 15:50:31 +02:00
Nathan Vegdahl
953b319ea8 Fix #123961: "Only Insert Needed" flag keys objects incorrectly
The root cause was some code that tries to omit keying loc, rot, or
scale based on the current transform mode and pivot type. The idea is
sound, but for it to work properly it also needs to know if more than
one object is being transformed or not. Notably, this bug affected the
scale transform mode as well, not just the rotation transform mode as
reported in #123961.

This fixes the issue by passing a flag down that informs that code
whether more than one object is being transformed, and using that flag
to correctly omit loc/rot/scale when possible.

PR #123998

Pull Request: https://projects.blender.org/blender/blender/pulls/123998
2024-07-02 10:52:24 +02:00
Nathan Vegdahl
e3b125f02b RNA: implement equality operator for RNAPath
Among other things, this enables using various methods on a collection
of `RNAPath`s (e.g. `Vector<RNAPath>`) that depend on the equality
operator being implemented.

The specific implementation and semantics used are based on a review
from and discussion with Bastien Montagne (mont29).

PR #123998
2024-07-02 10:52:22 +02:00
Jeroen Bakker
4d0c14bed3 OpenGL: Fix read from uninitialized memory
When performing framebuffer transition on legacy opengl platforms, some
state was uninitialized. Resulting in incorrect behavior and crashes.

Note that this doens't fix the black cube on legacy platforms. With this PR we
might be able to reproduce the issue on modern HW.

Pull Request: https://projects.blender.org/blender/blender/pulls/123989
2024-07-02 08:37:50 +02:00
Guillermo Venegas
262c68512f Fix #123807: layout panels can't be collapsed on scaled regions
In `ui_popup_block_position` popup blocks are scaled with the owner
button region scale which wasn't being done for layout panel bounds.

This applies the scale applied to the popup block to layout panels
bodies and headers.

Also when calculating layout-panels headers and bodies the offset
`layout_panel_y_offset` is applied in place, this because this value
can also be affected by this scale.

This solves the original issue described in #122411 and reverts the
regression #123807.

Ref !123980
2024-07-02 13:32:18 +10:00
Campbell Barton
e8a3537ffb Extensions: improve automatic repo names for file:// repos on WIN32
- Skip leading slash from drive letters.
- Use back-slashes.

While these weren't exactly bugs, it seemed like an error when the
path name wasn't what users would expect. Relates to #123994.
2024-07-02 11:45:39 +10:00
John Kiril Swenson
8d8a84ffb4 VSE: Fix crashes adding freeze-frames to segments
If a freeze-frame retiming key was added to either a transition or
freeze-frame segment when the strip was selected, Blender would crash.
The issue is that `SEQ_retiming_add_key` returns `nullptr` if the start
key of the current segment is one of these types, and never bothers to
cancel the operation if this happens.

Instead, it only attempts to get a key at the current frame with
`SEQ_retiming_key_get_by_timeline_frame`. This is redundant, since there
are already checks to see if that key exists in `SEQ_retiming_add_key`.
Remove this code and move up the other `nullptr` check to fix the bug.

Pull Request: https://projects.blender.org/blender/blender/pulls/123981
2024-07-01 23:25:11 +02:00
John Kiril Swenson
4c8319a227 VSE: Fix retiming unallowed strip type crashes
Currently, many retiming operators are able to operate on all selected
strips. However, if strips that do not support retiming are selected
(e.g. color strips), attempting to perform these operations will crash
Blender. The operators are only polled away if the active strip does
not support retiming -- this is not resilient enough.

This patch fixes the issue by checking each strip to make sure it
supports retiming. Some of the operators do not necessarily crash
without this fix (`retiming_show`, `retiming_key_add`), but still benefit
from exiting early if the current strip does not permit the functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/123975
2024-07-01 23:19:44 +02:00
John Kiril Swenson
607445da5f VSE: Standardize reset retiming operator
Every retiming operator works on selected strips. However, the reset
retiming operator only works on the active strip.

This patch standardizes the behavior so that all selected strips have
their retiming reset. This gives more control to the user to reset
many strips' retiming in bulk.

Pull Request: https://projects.blender.org/blender/blender/pulls/123973
2024-07-01 23:12:52 +02:00
Richard Antalik
952f41a9fd Fix: VSE frame interpolation is broken
Caused by incorrect output of `SEQ_give_frame_index` for effect strips.
Also since output value is float, it has to be truncated to integer,
when image bufferes are rendered for the effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/123914
2024-07-01 23:07:23 +02:00
Clément Foucault
beb8ec4fe1 Fix: EEVEE: Wrong subsurface sample distribution
The sample distribution was biased toward 0, which
created sharper details than expected.

However the downside is that the subsurface is now
more jittery because of the low amount of samples.
2024-07-01 19:55:01 +02:00
Jesse Yurkovich
2eec6a819e Fix: Add missing thin film parameters to MaterialX export
Wire up the new Principled BSDF thin-film inputs when building
MaterialX graphs.

Pull Request: https://projects.blender.org/blender/blender/pulls/123613
2024-07-01 19:08:56 +02:00
Miguel Pozo
4c314f9a78 GPU: Add --gpu-compilation-subprocesses cmd setting
Allow overriding the `max_parallel_compilations` from the command
line.
Disable compilation subprocesses on RenderDoc sessions.

Pull Request: https://projects.blender.org/blender/blender/pulls/123995
2024-07-01 16:36:01 +02:00
Miguel Pozo
2b248d2720 Fix #123207: EEVEE: Disable motion blur on camera change
Pull Request: https://projects.blender.org/blender/blender/pulls/123919
2024-07-01 15:47:10 +02:00
Clément Foucault
d4774a219b Fix: EEVEE: Missing light tiles in light probes
This was caused by the light culling system not
allocating enough tiles to cover the sphere lightprobe
render target.

Taking the max size between the lightprobe target and
the film fixes the issue.

Fixes #117444
2024-07-01 15:04:53 +02:00
Miguel Pozo
635db22ca6 Fix: Re-apply versioning made for EEVEE-Next in 4.1
Pull Request: https://projects.blender.org/blender/blender/pulls/123909
2024-07-01 13:37:48 +02:00
Omar Emara
e545c814a4 Fix: Scene not rendered even with Cryptomatte node
Blender doesn't render the scene even though a Cryptomatte node exists.
That's because Blender only considers Render Layer nodes, but
Cryptomatte node can reference scenes as well. This patch fixes that by
putting Cryptomatte nodes into consideration.

Pull Request: https://projects.blender.org/blender/blender/pulls/123814
2024-07-01 12:28:24 +02:00
Jeroen Bakker
9f53f3b600 OpenGL: Disable Stencil Export when forcing workarounds
When forcing workarounds the stencil export support wasn't disabled.
This PR disables stencil export support when forcing workarounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/123985
2024-07-01 12:19:26 +02:00
Miguel Pozo
f16fdcfc85 Fix #123794: Crash when UDIMs have gray and color tiles
Don't use grayscale data for color UDIM arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/123905
2024-07-01 12:02:28 +02:00
Campbell Barton
67ddb0e1a5 Extensions: detect external changes on startup & loading preferences
Changes to an extensions manifest weren't accounted for.
This was particularly a problem for "System" extensions which aren't
intended to be managed inside Blender however the problem existed for
any changes made outside of Blender.

Now enabled extensions are checked on startup to ensure:

- They are compatible with Blender.
- The Python wheels are synchronized.

Resolves #123645.

Details:

- Any extension incompatibilities prevent the add-on being enabled
  with a message printing the reason for it being disabled.

- Incompatible add-ons are kept enabled in the preferences to avoid
  loosing their own preferences and allow for an upgrade to restore
  compatibility.

- To avoid slowing down Blender's startup:

  - Checks are skipped when no extensions are enabled
    (as is the case for `--factory-startup` & running tests).
  - Compatibility data is cached so in common case,
    the cache is loaded and all enabled extensions `stat` their
    manifests to detect changes without having to parse them.
  - The cache is re-generated if any extensions change or the
    Blender/Python version changes.

- Compatibility data is updated:

  - On startup (when needed).
  - On an explicit "Refresh Local"
    (mainly for developers who may edit the manifest).
  - When refreshing extensions after install/uninstall etc.
    since an incompatible extensions may become compatible
    after an update.
  - When reloading preferences.

- Additional info is shown when the `--debug-python` is enabled,
  if there are ever issues with the extension compatibility cache
  generation not working as expected.

- The behavior for Python wheels has changed so they are only setup
  when the extension is enabled. This was done to simplify startup
  checks and has the benefit that an installed but disabled extension
  never runs code - as the ability to install wheels means it could
  have been imported from other scripts. It also means users can disable
  an extension to avoid wheel version conflicts.

  This does add the complication however that enabling add-on which is
  an extension must first ensure it's wheels are setup.
  See `addon_utils.extensions_refresh(..)`.

See code-comments for further details.
2024-07-01 15:08:14 +10:00
Clément Foucault
549024b1cc Fix: EEVEE: Broken shadows
Was caused by an invalid check.

Fix #123959
2024-06-30 23:17:25 +02:00
Charles Wardlaw
783fa03d9a Fix #122651: USD Export: Use solid color texture for DomeLights
When the World material has no texture input, create a solid color .hdr
texture from the Background color instead. This is currently requried
for the Hydra Storm render engine[1]

[1] https://forum.aousd.org/t/usdluxdomelight-without-a-texture-file-attribute/1573

Co-authored-by: kiki <charles@skeletalstudios.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/123933
2024-06-30 21:06:11 +02:00
Clément Foucault
53cb73ecea Fix: EEVEE: Depth Of Field: Tile artifact on noisy input
This was caused by the denoiser of the slight out of focus
pass having too much influence at low CoC values.

Making the transition start at 0.5 fixes the issue.

Fixes #123822
2024-06-29 17:08:14 +02:00
Clément Foucault
49491bc541 Fix: EEVEE: Light: Invalid read in Shadow Setup shader
This happened in scenes with high light count and
with some local light being culled.

The culled lights indices would still be processed
and load undefined data. This undefined data
might be interpreted as a sunlight and go into
the cascade setup loop with an undefined number
of levels.

This created loops of 1 billion iteration per thread
which triggered the TDR on windows.

The fix is to skip the culled light indices.

Fixes #123413
Fixes #123190
2024-06-29 15:35:59 +02:00
Richard Antalik
db5cc08714 Revert "Fix #118505: Incorrect strip image transformation"
This reverts commit 3d17217025.
2024-06-28 21:02:38 +02:00
Clément Foucault
6673302840 EEVEE: Shadow: Split Tilemap finalize
This fixes a kernel crash on NVidia GP100.

This splits the tilemap finalize shader into another shader
and split the valid tile gather into its own loop.

Simplifying the shader seems to avoid the issue. But the
cause of the issue remains unknown.

Pull Request: https://projects.blender.org/blender/blender/pulls/123850
2024-06-28 17:54:00 +02:00
Richard Antalik
3d17217025 Fix #118505: Incorrect strip image transformation
When preview is downscaled and transformation origin is not the center
of the image, this causes unexpected offset. This happened, because one
matrix combined image downscaling, so it fits into preview and user
defined scale. When origin was not center of the image, this results in
incorrect offset.

Solved by splitting 1 matrix in `sequencer_image_crop_transform_matrix`
into 2 matrices. First matrix just centers and scales image to expected
size. Second matrix performs rest of transform operations. This code is
bit easier to read as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/123776
2024-06-28 17:11:17 +02:00
Richard Antalik
1a887c06d9 Fix #123543: Delete retiming keys deletes strip
Delete operator was shared for strips and retiming keys, which was not
ideal. Operator logic relied on invoke function setting proper context
which was also hidden from users.

Split these operators and make dedicated operators for removing retiming
keys - `SEQUENCER_OT_retiming_key_delete`.
This operator returns `OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH` if
executed in non-retiming context, or no key is selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123767
2024-06-28 17:06:44 +02:00
Richard Antalik
c7e75090bd Fix #115981: Edge panning causes strips to overlap
Caused by floating point error in `BLI_rctf_transform_pt_v()`

The error is not fixed, but intead of recalculating each strip offset
with this function, only offset for {0, 0} is calculated and added to
easch strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/123825
2024-06-28 17:03:03 +02:00
Sergey Sharybin
c309479912 Fix: Changing sculpt multires level erases sculpt changes
The code which is responsible for applying data from coordinate grids to
displacement grids could be run as part of modifier evaluation, hence
using the safe version of accessing mesh data was returning a nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/123907
2024-06-28 16:36:56 +02:00
Omar Emara
2c345cfe31 Fix: Compositor frees cached resources when canceled
The GPU compositor frees some of the cached resources when it gets
canceled during interactive editing, making the experience less smooth.

This is because when the compositor gets canceled mid-evaluation, some
of the operations won't get the chance to mark their used resources as
still in use.

To fix this, we skip the cache manager reset after canceling,
effectively only resetting when a full evaluation happens, giving all
operations the chance to keep their cached resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/123886
2024-06-28 15:27:09 +02:00