Commit Graph

110194 Commits

Author SHA1 Message Date
Miguel Pozo
8fc614fc1b Fix: EEVEE: Use of scene before assignment
Move update_eval_members to the top of init to avoid future issues.
2024-06-19 18:15:27 +02:00
Brecht Van Lommel
da9f586748 Fix #104061: Python GPU module unusable after too early import
Add-ons may attempt to load the GPU module in background mode when no GPU
context has been initialized yet. This would give an error on import.

If then later the GPU context does get initialized, for example for a
render engine, import would still fail as the module is cached.

This reverts commit d7f124f06f, and again
throws errors in methods and constructors instead of module import.

Pull Request: https://projects.blender.org/blender/blender/pulls/123395
2024-06-19 17:54:35 +02:00
Brecht Van Lommel
eaeb8ba8cd USD: Rename active UV Map to "st" by default
This was previously attempted in #109518 and reverted in #112234. Now do
both the changes in the mesh and material export, and make it an option
in USD export. Hydra always renamed to "st" and continues to do it.

Fix #122800: Missing textures with MaterialX materials

Pull Request: https://projects.blender.org/blender/blender/pulls/123326
2024-06-19 17:53:55 +02:00
Jacques Lucke
934041e8d6 BLO: support overaligned types in SDNA
This fixes #121695. `float4x4` matrices are generally expected to be 16 byte aligned.
Currently, there is no mechanism (afaik) that allows allocating these overaligned types
when loading files from disk. This patch adds an array with alignment information for
 each type in `SDNA`. Currently, the alignment is just `__STDCPP_DEFAULT_NEW_ALIGNMENT__`
for all types and is manually set for the `mat4x4f` DNA type. The .blend file format is
not changed at all. The alignment information is purely runtime data.

In the future it would probably be good to generalize this a bit more instead of
hardcoding the alignment for `mat4x4f`, but would make it unnecessarily complex for
now because this is intended for the release branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/123271
2024-06-19 12:16:24 +02:00
Jacques Lucke
1d4b4440d9 Curve: reduce overhead in debug builds 2024-06-19 12:08:27 +02:00
Aras Pranckevicius
7e61f14a88 Fix #123332: VSE strip transform handles look tweaks
Current look of VSE timeline view strip transformation handles makes them
somewhat "too narrow", especially after recent changes that made them
more narrow than before (handle tweaking feature) and a strip visual change
that made strip outline not go outside of strip bounds. They are now just
2px wide, effectively.

This changes their look as outlined in #123332 design task:
- The inset dark line is no longer over the handles, but rather "inside"
  of them (except when handles are semitransparent, i.e. for strips that
  are not selected).
- The handles themselves have rounded corners.

Pull Request: https://projects.blender.org/blender/blender/pulls/123391
2024-06-19 11:49:20 +02:00
Damien Picard
2948b1e790 Give timeline marker default name when created via binding to camera
Timeline markers get a default name of "F_<frame>" when creating with
`marker.add`, but an empty name with `marker.camera_bind`.
Because the name of the current frame's marker is displayed in the
viewport statistics, such markers appear as "<>" after the name of the
active object, which is confusing.

This change gives the same default name of "F_<frame>" to markers
created this way.
It also cleans up a comment in the line copied from, as that line was
introduced in late 2008 so probably not so temporary.

Pull Request: https://projects.blender.org/blender/blender/pulls/122968
2024-06-19 11:22:28 +02:00
Jacques Lucke
ed357136dc Fix #123410: node frames interfere with node hide toggle
Now the `uiBlock` array for node is indexed with `node.index()` instead
of the draw-index which is not as readily available in some cases.
The main alternative would be to create an extra map from node index
to draw-index but that doesn't seem worth it right now.
2024-06-19 11:21:12 +02:00
Aras Pranckevicius
189410e1ff Fix #123333: VSE strip outline width now takes DPI/line width setting into account
Now the strip outline (1 point for unselected strips, 2 point outline +
1 pt dark inset) takes monitor DPI / user preference line width into
account, via the usual U.pixelsize machinery.

Pull Request: https://projects.blender.org/blender/blender/pulls/123369
2024-06-19 11:19:15 +02:00
Omar Emara
4329dafb4c Fix #123340: Zero division in Difference Key node
The Difference Key node suffered from zero division when the falloff is
zero. Fix that by using safe division.
2024-06-19 11:46:09 +03:00
Hans Goudey
86e1ef2e31 Fix: Memory leak in purge orphans with no unused data-blocks
Operator cutom data was allocated but not freed in the early return.
2024-06-18 23:49:18 -04:00
Harley Acheson
ad625d8dc4 Fix #122423: Clear handlers for non-temporary regions on exit
Resolve regression in [0] which incorrectly replaced
`WM_event_modal_handler_region_replace` with
`WM_event_ui_handler_region_popup_replace`
causing a crash when accessing dangling pointers.

Resolve by restoring the call to clear modal handlers regions.

Ref !122922

[0]: b25eefbf9a
2024-06-19 09:49:21 +10:00
Campbell Barton
0cc9762651 Cleanup: spelling in comments 2024-06-19 09:41:11 +10:00
Sean Kim
bf2e59e1dd Fix: Relax face set occasionally too strong
In a previous refactor, the iteration variable was shadowed resulting in
the extra strength always being applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/123350
2024-06-18 21:49:35 +02:00
Sean Kim
7a16b9f04f Fix #123335: Expand Face Set behaves incorrectly on new mesh
Without the call to ensure_face_sets_mesh, the initial values of the
cache are 0, not 1. The latter is the correct default value to represent
no face set.

Pull Request: https://projects.blender.org/blender/blender/pulls/123392
2024-06-18 21:03:27 +02:00
Clément Foucault
ff03ab4d08 Fix: EEVEE: Overblur of textures because of TAA
This was a missing block of the TAA implementation.
TAA jitter and reprojection have a tedency to soften
the texture. Add a 1.5 bias to make them a bit sharper.

Note that this is a bit different than the usual TAA
blurring. In final render we don't do reprojection
so it is only because the texture filter (box filter
from the LOD) is applied at the same time than our pixel
filter (blackmann-harris). It is less noticeable than
the normal TAA blur, but still blurs ~2px instead of
1.5px.
2024-06-18 19:31:47 +02:00
Falk David
10b1e45ca8 Fix: Curves: Crash in transform code for non bézier curves
This caused a crash in grease pencil when trying to transform strokes (poly curves).
The code assumed that the left and right handle indices existed.

Pull Request: https://projects.blender.org/blender/blender/pulls/123311
2024-06-18 19:08:11 +02:00
Miguel Pozo
feed10a4c2 Fix: GPU: Workaround for validation errors on replaced passes 2024-06-18 18:36:09 +02:00
Nathan Vegdahl
295df94478 Anim: add "legacy behavior" option to Limit Rotation constraint
This adds a "Legacy Behavior" option to the Limit Rotation constraint that makes
it behave how Limit Rotation constraints did prior to
ed2408400d. Newly created constraints have this
option disabled, but versioning code enables the option on constraints from
older files to ensure that the behavior of e.g. existing rigs is not altered.

This is one part of a two-part fix for #123105. The other part is in PR
extensions/rigify#4.

Pull Request: https://projects.blender.org/blender/blender/pulls/123361
2024-06-18 18:29:25 +02:00
Clément Foucault
355c7b788e Fix: EEVEE: Remaining references to EEVEE-Legacy in codebase
Fix #123387
2024-06-18 18:17:34 +02:00
Clément Foucault
e5f514c60c Fix: EEVEE: AO Pass: Regression in quality caused by sample count
Sample count was mismatching the LOD offset leading to
quality regression. Using the same specialization
constant as the fast GI fixes the issue.
2024-06-18 17:53:22 +02:00
Clément Foucault
90c1d5832e Fix: EEVEE: AO: Only clip occluders based on front sample
This is cheaper but avoid loosing the sample influence when
thickness is large.
2024-06-18 17:53:22 +02:00
Clément Foucault
3112799804 Fix: EEVEE: AO: LOD transition too visible at high sample count
This add dithering to the lod steping allowing for a smoother
transition.
2024-06-18 17:53:22 +02:00
Philipp Oeser
751745b2de Fix #123220: Export GP SVG/PDF crash when active object is not GP
`GpencilIOParams.ob` is set to `CTX_data_active_object` at the beginning
of the export [which is not ensured to be a valid `OB_GPENCIL_LEGACY`
object, non-valid objects are filtered out later in
`create_object_list`]. From this (potential non-greasepencil) object's
data, a "global `bGPdata` is stored in `GpencilIOParams`.

From here, it can only go downwards as `stroke_point_radius_get`,
`export_stroke_to_polyline`, `BKE_gpencil_stroke_perimeter_from_view`
all use this "global" `bGPdata`.

Two possible solutions might exist:
- [1] just cancel the operator if the active object is not a
`OB_GPENCIL_LEGACY` object
- [2] make sure we use corresponding `bGPdata` when iterating over
valid objects to export

This PR chooses [2] since it also seems wrong to always use the
`bGPdata` from the active object for certain calculations when iterating
many objects. For example, the export ignores different values for
`Thickness Scale` on different objects and always takes the value from
the active object, which does not seem to be by design.

NOTE: this changes behavior (see above) but for the better
Pull Request: https://projects.blender.org/blender/blender/pulls/123224
2024-06-18 16:44:08 +02:00
Miguel Pozo
9d5f46b1b8 Cleanup: EEVEE: Remove unused variable 2024-06-18 16:15:26 +02:00
Christoph Lendenfeld
99796991d8 Fix #123245: Inserting keys was lacking depsgraph update
When inserting new keys, the depsgraph needs to be updated.
Since that was missing with the new keying code, the NLA wasn't
working properly when inserting the first key.

Pull Request: https://projects.blender.org/blender/blender/pulls/123360
2024-06-18 16:03:38 +02:00
Christoph Lendenfeld
1070ae46fa Fix #122490: Snapping with free handles doesn't move the handles
When snapping keyframes in the Graph Editor, handles
that were set to free didn't move.

The issue was that the snapping code didn't set the handle position.
Instead it relied on the handle recalculation (`calchandleNurb_intern`) to do the job.
That code doesn't affect free handles though.

The fix is to also offset the handles in the snapping code. The handle recalculation
will still run for all the other handle types so that behavior isn't expected to change.

This does NOT change the behavior of bezier snapping in the 3D viewport.

Pull Request: https://projects.blender.org/blender/blender/pulls/123173
2024-06-18 16:00:37 +02:00
Clément Foucault
979e142965 Fix: EEVEE: Object holdout not working
This implement the holdout flag by switching to
the holdout case in the shader. This has a few benefits:
- Doesn't recompile the shaders.
- Makes the object infos mandatory (already the case in
  practice)
- Handle transparent materials properly, keeping the
  transparency working.

Fix #123284

Pull Request: https://projects.blender.org/blender/blender/pulls/123315
2024-06-18 15:35:04 +02:00
Clément Foucault
0dc5abc9e5 Fix: EEVEE: Infinite loop in shadow update
This happened in the following render test:
`render/light/all_light_types_in_volume.blend`

Unfortunately it seems non-deterministic.
To fix this, we change the heuristic to jump
out of the shadow update loop. Also introduce
a upper bound to the number of iteration.

On top of this, add a flush for every loop
to avoid huge command buffer submission.

Thanks @pragma37 for the fix.
2024-06-18 14:55:41 +02:00
Christoph Lendenfeld
1ab66a6b4f Fix #116138: Hidden bones cannot be active
This PR modifies the check for visibility when selected in the outliner.
With the change the visibility check only affects the selection state, not the active state.
The check has also been swapped with a function call to `ANIM_bone_is_visible_editbone`,
so now correctly works with collection visibility.

This PR also fixes the same issue for `Bone` and `bPoseChannel`

Co-authored-by: Cedric-Hutchings

Pull Request: https://projects.blender.org/blender/blender/pulls/123237
2024-06-18 13:54:36 +02:00
Clément Foucault
e71ca93031 Fix: EEVEE: Missing barrier in light sorting compute shader
At high light count, this missing barriers would
produce invalid, non-unique `prefix_sum` indices.
This then resulted in some slots inside `out_light_buf`
never written to, leaving undefined data inside them.

If the buffer was cleared to zero, these undefined light
slots would be interpreted as sun lights and the
shadow setup compute pass would critically fail because
of out of bound memory.

Fix #123195
2024-06-18 12:39:27 +02:00
Jeroen Bakker
d13682efa8 Cleanup: Fix spelling in EEVEE
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/123355
2024-06-18 10:57:03 +02:00
Jeroen Bakker
c525c0354f EEVEE: Film accumulation workaround for Metal/Intel iGPUs
EEVEE Film accumulation workaround for Metal/Intel iGPUs.

On Metal the Intel iGPUs do not support image read write
on array textures. However this limitation doesn't show
any artifacts when using the compute shader.

This PR is a work around that uses the film_comp shader
to process the film samples, but uses a separate film_copy_frag
shader to read the result and copy them to the frame buffer.

I deliberately didn't include the fix to the film_frag shader
as that would change the read/write resources and could lead
to performance issues for other platforms. Writable resources
are typically slower compared to read only resources.

Some code needed to be duplicated (and not added to `*_lib.glsl`)
as compilers would still raise compilation errors due to imageStore/Load
on incompatible resource access.

The Metal/Intel iGPU is also marked to have limited support as
raytracing and probes still produces big artifacts.

This workaround can be tested on any platform just by setting
`use_compute_ = true` in `Film::sync`

Related to #122361

Pull Request: https://projects.blender.org/blender/blender/pulls/123330
2024-06-18 10:53:53 +02:00
Campbell Barton
b141365fc2 Cleanup: quiet unused variable warning 2024-06-18 12:09:41 +10:00
Campbell Barton
0554ec7ec7 Cleanup: spelling in comments 2024-06-18 12:09:40 +10:00
Miguel Pozo
4093945e9c Cleanup: Use the correct license name
Unlicense is the name of the license, it's not that the code is unlicensed.
2024-06-17 19:37:00 +02:00
Miguel Pozo
50a83d3e0b Fix: BLI_SUBPROCESS_SUPPORT check
Fix compilation on platforms with OpenGL but not BLI_subprocess support.
2024-06-17 19:35:51 +02:00
Clément Foucault
6d375cf7f0 Fix: EEVEE: Wrong thickness for rotated objects
The previous code was using matrix multiplication to
get the local thickness to world thickness.

The correct way is to multiply the local thickness
by the scale of the object (length of each columns
of the object_to_world matrix).
2024-06-17 19:12:24 +02:00
Miguel Pozo
8014b9cbb4 Fix #123183: EEVEE: Optimize velocity geometry buffer
Avoid storing duplicated geometry buffers for instances.

Pull Request: https://projects.blender.org/blender/blender/pulls/123320
2024-06-17 18:55:27 +02:00
Alaska
08cc73a9bb Fix #123249: Orthographic DOF is influenced by near clip
Fix an issue where the DOF distance in orthographic mode is
specified distance + near clip distance, which can lead to
unpredicable results.

Pull Request: https://projects.blender.org/blender/blender/pulls/123267
2024-06-17 17:45:55 +02:00
Alaska
274da96722 Render: Clamp minimum DOF focus distance
Clamp DOF focus distance to a minimum of 1e-5.
This is to primarily stop focus distances of 0 being used
which would lead to issues in future code changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123310
2024-06-17 17:42:38 +02:00
Brecht Van Lommel
8ce5c2d8cb Fix: Memory leak in Hydra USD delegate 2024-06-17 16:03:41 +02:00
Jeroen Bakker
832918f9d8 Fix #115344: Generated coordinates for hair psys
When using particle system the generated coordinates where not set.
The reason is that a loose resource handle was created for particle
system that didn't contain enough information to calculate orcos.

This PR will create the object info from its parent object.

Pull Request: https://projects.blender.org/blender/blender/pulls/123307
2024-06-17 13:45:23 +02:00
Miguel Pozo
86bbd2d3a5 Fix #123227 : EEVEE : Ghosting on viewport rendering
Pull Request: https://projects.blender.org/blender/blender/pulls/123308
2024-06-17 13:44:16 +02:00
Clément Foucault
9a6a822dd6 EEVEE-Next: Remove artificial bias
This bias was added when the pixel radius estimation
computation was still broken. This resulted in a shadow
bias way too big in general.

Also fix shadow pixel size being clampped to the wrong
LOD level.

Fix #123295
2024-06-17 12:48:16 +02:00
Miguel Pozo
b029608b97 Fix #123285: EEVEE Next: Ray Visibility > Camera
Add the camera visibility to the MaterialKey.
2024-06-17 12:22:30 +02:00
Bastien Montagne
b143cc1885 I18N: Remove 'edit translation' features from the Blender UI.
This feature was not maintained for a long time already, and would have
required a lot of work to make it sensible and usable after 'recent'
changes (like the move to weblate translation platform).

For details see also
https://devtalk.blender.org/t/ui-translation-tools-remove-edit-translation-feature-from-blender-ui-in-4-2lts-release/34947
2024-06-17 12:17:55 +02:00
Aras Pranckevicius
59d98f3314 Fix #123259: VSE alpha over not working with a Mask modifier
A strip was wrongly deemed to be opaque (and thus strips below it
were skipped from rendering), if the strip content was opaque, but
it gained transparency via presence of a Mask modifier.

While at it, I also noticed that a strip could have been wrongly deemed
opaque when it had a Multiplier < 1.0 with "multiply alpha" option
checked under strip Color settings. So fixed that too.

The whole logic of that factored out into is_opaque_alpha_over function
to make the call site clearer.

Pull Request: https://projects.blender.org/blender/blender/pulls/123303
2024-06-17 11:43:28 +02:00
Aras Pranckevicius
1535ebff61 Fix: VSE waveform preview does not always clip too loud samples
For very low frequency sounds (the ones where waveform drawing goes into
"line mode"), either of min or max can go outside of -1..+1 range.
The code was assuming that only max could be above +1, and only min
could be below -1. Fix that, and also make "line mode" also apply
red "clipped" color when clipping happens.

Pull Request: https://projects.blender.org/blender/blender/pulls/123246
2024-06-17 11:26:50 +02:00
Jeroen Bakker
52d72d9fbb Fix #122847: Show Transparent Render Pass
EEVEE has a transparent render pass that renders materials where
the render mode is set to blended. This was introduced when EEVEE-Next
was still in development, but was never fully backported.

This PR adds the missing pieces.

Pull Request: https://projects.blender.org/blender/blender/pulls/123298
2024-06-17 09:35:03 +02:00