Commit Graph

110309 Commits

Author SHA1 Message Date
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 3d172170255d0bfc349c386393f98d9fe4b34511.
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
Omar Emara
2eb7c4c329 Fix: Linked images don't work in GPU compositor
Linked images that share the same name as an image in the file will fail
to load in the GPU compositor. That's because cached resources are keyed
using only their ID name, while they should also be keyed by the library
name.

Pull Request: https://projects.blender.org/blender/blender/pulls/123898
2024-06-28 15:26:01 +02:00
Philipp Oeser
33ca4daf8f Fix #123882: Ocean Modifier not updating normals in "Displace" mode
Exposed by 383a145a190c

The real culprit was in 6a3c3c77b3 though (where the original meshes
normals were tagged dirty instead of the result's).

So to resolve, now tag the result (not the original).

Pull Request: https://projects.blender.org/blender/blender/pulls/123893
2024-06-28 14:34:26 +02:00
Philipp Oeser
296d05060d Fix #123560: Select by active material fails in multi-object-edit mode
This was the case when the slot index in the active object is greater
than the available slots of other selected objects.

Code was trying to avoid searching all materials by using
`BKE_object_material_get` to get an appropriate index (an addition to
D4441 added in 6b39dc7672eb). That function has the behavior of clamping
if a target index is greater than the available slots (for good
reasons), so we cant rely on the slot index being the same if
`BKE_object_material_get` finds a material. So in essence, this is not
what we want to use in this case.

 Now use the much simpler `BKE_object_material_index_get` to get the
index [this might be less performant in certain scenarios, dont think
this is critical though and correctness should beat performance here]

Pull Request: https://projects.blender.org/blender/blender/pulls/123718
2024-06-28 13:53:20 +02:00
Jacques Lucke
d6bf027f38 Fix: properly handle negative scale in safe conversion to loc/rot/scale 2024-06-28 12:20:46 +02:00
Jacques Lucke
7866fcd869 Fix: convert math::Axis to vector 2024-06-28 12:16:56 +02:00
Dalai Felinto
51e68fe0ed Cleanup: make format 2024-06-28 11:31:54 +02:00
Damien Picard
92c026c39b I18n: Fix multi-context message extraction regex
The BLT_I18N_MSGID_MULTI_CTXT() macro allows extracting a single
message into up to 16 different contexts. The regex to do that was
slightly wrong because it did not account for the macro potentially
ending with a ",".

The contexts for "New" were also sorted.

Pull Request: https://projects.blender.org/blender/blender/pulls/123793
2024-06-28 10:42:47 +02:00
Campbell Barton
9d10b88f37 Cleanup: remove unnecessary icon scanning on startup
Blender was performing a redundant scan for icons on startup (200 files)
remove this since it adds small but unnecessary overhead.

Part of !123870
2024-06-28 11:53:44 +10:00
Miguel Pozo
baf07c22bd Revert "Fix #123794: Crash when UDIMs have gray and color tiles"
This reverts commit 095e78bd28bbbab98bc66a8d8947ab1bfae969ac.
2024-06-27 19:15:55 +02:00
Miguel Pozo
095e78bd28 Fix #123794: Crash when UDIMs have gray and color tiles 2024-06-27 19:14:48 +02:00
Michael Kowalski
b2f8f5a491 Fix: USD import: domelight Y-up orientation
Added necessary rotation to convert from Y-up to Z-up when
importing USD dome lights as world materials.

Pull Request: https://projects.blender.org/blender/blender/pulls/123797
2024-06-27 19:06:49 +02:00
Sergey Sharybin
32588169d3 Fix: Initialization of paint mode fails in certain files
It is possible that the file does not have Grease Pencil paint
yet, leading to a crash in the BKE_paint_init().

The simple fix is to swap the order of acquiring the paint
pointer and the code which ensures that this paint exists.
2024-06-27 18:40:04 +02:00
Christoph Lendenfeld
f3b393a74a Fix #123738: Keyframe drawing issue while duplicating keys
The issue was introduced with f06fd85d97 where the building of the keylist used was
restricted to the visible range of the dope sheet.
The optimization uses `BKE_fcurve_bezt_binarysearch_index` which can only work when
the FCurve is sorted. During transformations in the dope sheet this is not the case as the
sorting only happens when the transformation is applied.
The fix is to do a range check in the for loop instead of a binary search.
Testing the range comes with a performance impact though.

| Before optimization | broken with f06fd85d97 | this PR |
| - | - | - |
| 90ms | 6ms | 20ms |

An alternative solution would be to sort FCurves during transformations of the Dope Sheet.
This is done in the Graph Editor and with the recent speedups introduced there this could be
a viable option. However this is out of scope for this fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/123824
2024-06-27 16:50:44 +02:00
Hans Goudey
8945b7e49a Fix #123809: Sculpt visibility invert missing PBVH node update
Caused by 1a37017244aed8d06ef809fa6cbdaa212c422874
2024-06-27 09:29:45 -04:00
Christoph Lendenfeld
ef8f14f3d6 Fix #90923: Bone Stick active color
The `Stick` drawing mode for armatures was overriding the colors,
meaning it ignored bone colors specified by the user and also didn't use
the correct color for selected vs active.

Pull Request: https://projects.blender.org/blender/blender/pulls/123544
2024-06-27 15:23:43 +02:00
Brecht Van Lommel
d9bd35c4bc Cleanup: make format 2024-06-26 20:39:01 +02:00
Damien Picard
f739d4832e I18n: Extract and disambiguate a few messages
Disambiguate
- "Thickness": use "Material" for EEVEE's thickness material setting.
- "Generated": use "Texture" for texture coordinates, "Image" for
  image source, keep default context for animation keyframe types.

Translate
- Split "Online access required to (check for|install) updates..."
  into 2x2 messages individually translatable.
- "Geometry" input in bake node.
- "New" for the Palette ID: extract it as part of the
   BLT_I18N_MSGID_MULTI_CTXT for "New".

Some issues reported by Gabriel Gazzán and Satoshi Yamasaki.

Pull Request: https://projects.blender.org/blender/blender/pulls/123404
2024-06-26 19:25:22 +02:00
Damien Picard
26cdf7e340 I18n: Extract many custom labels defined in uiItem*
Those labels needed a manual translation with IFACE_() or RPT_():
  - "Add Item",
  - "Blend",
  - "Cached from the first line art modifier.",
  - "Custom Curve",
  - "Custom Path",
  - "Custom Range",
  - "End",
  - "Enter a Unicode codepoint hex value",
  - "Forward Axis",
  - "Insert Unicode Character",
  - "Mid Level",
  - "Min",
  - "Mode",
  - "No Items",
  - "Object",
  - "Path",
  - "Probability",
  - "Sample Radius",
  - "Sharp edges or custom normals detected, disabling GPU subdivision",
  - "Start",
  - "Texture Mapping",
  - "Up Axis",
  - "Using both CPU and GPU subdivision",
2024-06-26 19:25:20 +02:00
Clément Foucault
36ff8c0231 Fix: EEVEE: Shadow visibility flag not versioned for 4.1 files
The versioning code was introduced in 4.1 release cycle when
we were planning to release EEVEE next in 4.1. This means that
the versioning was not applied to files created in 4.1 using
EEVEE-Legacy and loaded into 4.2.

Moving the code just before the EEVEE-Legacy removal make
the versioning work as expected. There is no side effect
inside the versioning code.

Fix #123500
2024-06-26 18:57:11 +02:00
Clément Foucault
d4de4c1f01 Fix: EEVEE: Shadow: Jitter more than the light radius
When enabled, jittered shadows were jittering inside the
shading light radius that is clamped to a minimum for
numerical precision reasons.

This patch sets the shadow radius to 0 only if the original
light radius is also zero, and use the former to determine
wether or not to apply jittering.
2024-06-26 16:58:37 +02:00
Miguel Pozo
2804b000ac Fix: GPU: Fix handling of invalid binary caches 2024-06-26 16:44:46 +02:00
Philipp Oeser
d4f5d4a6f6 Fix #123770: Vertex paint Accumulate option breaks Blur action
Accumulating allocates previous colors (which are used in
`do_vpaint_brush_blur_XXX`).

The actual problem here was that the  state of `brush_use_accumulate`
was not consistent across the lifetime of strokes.
Vertexpaint was doing the allocation in `vertex_paint_init_stroke`
(**before** `update_cache_invariants` where the mode gets changed to
`BRUSH_STROKE_SMOOTH` etc.), so here it still seemed we would use
accumulation, whereas later (after internally switching the tool/brush)
this was not the case anymore, leading to wrong behavior of
`do_vpaint_brush_blur_XXX`.

So now move the allocation to `init_session_data` (same as for
weightpaint) to make sure all codepaths have a consistent state of
`brush_use_accumulate`.

NOTE: this was made more obvious since 6de6d7267f3d added SHIFT-blurring
to the keymap

Pull Request: https://projects.blender.org/blender/blender/pulls/123778
2024-06-26 15:38:26 +02:00
Philipp Oeser
bc0b86797c Fix #94125: Collada: not all edit mode changes are exported
This was the case when mulitple objects had changes in multi-object-
editmode.

Similar to f8b11528b2 & 3dd08beab308, this now ensures we have mesh data
in editmode.

Pull Request: https://projects.blender.org/blender/blender/pulls/123732
2024-06-26 15:36:47 +02:00
Clément Foucault
56023d5b63 Fix: EEVEE: Transparent pass break AO pass
This was caused by bad ordering. AO pass should only
include Dithered objects.

Fix #123393
2024-06-26 15:21:02 +02:00
Miguel Porces
b120440f7c Fix: Nodes: show group icon for custom node groups
The bl_icon of NodeCustomGroups is being ignored in latest versions.
This commit re-enables the icon drawing for those nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123669
2024-06-26 14:03:02 +02:00
Jacques Lucke
29f6167db1 Fix #123624: no geometry after applying visual geometry to mesh
This happened because `BKE_object_get_evaluated_mesh` now only returns
the mesh if there are no pending depsgraph updates. However, given that the
ID was tagged for changes before the evaluated mesh was accessed, it looked
like there were missing updates when there were not.

Now the depsgraph tag is only set after the object has actually been modified.
2024-06-26 14:00:05 +02:00
Sergey Sharybin
0081c4b64a Fix #123576: VSE Crash: Preview render fails if two Scene strips are stacked
The issue was caused by the ImBuf of the scene strip render sharing the float
buffer pixels with the ImBuf from the render result. If the render result is
ever gets freed (i.e., by a request to perform another render) it'll leave the
strip ImBuf pointing to a freed memory.

This was caused by the #109788.

The simple solution is to restore the code to the state prior to the ImBuf
refactor in the RenderRsult. A better solution would be to use implicit
sharing, similar to how it was done in the #108045.

Pull Request: https://projects.blender.org/blender/blender/pulls/123731
2024-06-26 09:58:46 +02:00
Lukas Tönne
864d701083 Fix #123705: Object Info node is not setting Transform output
This was simply missing in the Object Info node.

Pull Request: https://projects.blender.org/blender/blender/pulls/123709
2024-06-26 09:50:52 +02:00
Campbell Barton
96906536db Extensions: add a Python API for user editable extension directories
Provide a convenient way to access a writable directory for extensions.
This will typically be accessed via:

  bpy.utils.extension_path_user(__package__, create=True)

This API is provided as some extensions on extensions.blender.org
are writing into the extensions own directory which is error prone:

- The extensions own directory is removed when upgrading.
- Users may not have write access to the extensions directory,
  especially with "System" repositories which may be on shared network
  drives for example.

These directories are only removed when:

- Uninstalling the extension.
- Removing the repository and its files.
2024-06-26 14:23:17 +10:00
Campbell Barton
f5aaee39d2 Extensions: prevent recursive file removal for corrupt repositories
When removing a repository & files a valid module name was assumed.
While this should always be the case, add an additional check so in
the unlikely event of memory/file corruption (especially `..`)
recursively removing files outside the repository is never allowed.
2024-06-26 14:22:21 +10:00