Commit Graph

105721 Commits

Author SHA1 Message Date
Aras Pranckevicius
877d9c596a VSE: Fix various "off by half a pixel" issues in image transform
Code inside `IMB_transform` (which is pretty much only used inside VSE
to do translation/rotation/scale of image or movie strips) was not
correctly doing mapping between pixel and texel spaces. This is similar
to e.g. GPU rasterization rules and has to do with whether some
coordinate refers to pixel/texel "corner" or "center" etc. It's a long
topic, but short summary would be:

- Coordinates refer to pixel/texel corner,
- Do sampling at pixel centers,
- Bilinear filter should use floor(x-0.5) and floor(x-0.5)+1 texels.

Also, there was a sign error introduced in Subsampling 3x3 filter, in
commit b3fd169259.

After making the PR, I found out that this seems to fix #90785, #112923
and possibly some others.

Long explanation with lots of images is in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116628
2024-01-08 16:51:35 +01:00
Miguel Pozo
694cb43e59 Fix: EEVEE-Next: Forward Material compilation 2024-01-08 15:50:09 +01:00
Jacques Lucke
c68b22cfdf Core: expose ID.session_uid in RNA
This exposes the internal `ID.session_uuid` in the Python API as `ID.session_uid`.
The exposed name is not `session_uuid`, because it's not actually universally unique,
and we want to change the internal name too.

The reason for exposing this is to allow Python scripts to call operators that take the
session id as input. A fair number of operators do this as you can see when searching
for `WM_operator_properties_id_lookup`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116888
2024-01-08 15:34:09 +01:00
Alexander Gavrilov
d0ef66ddff Drivers: implement fallback values for RNA path based variables.
As discussed in #105407, it can be useful to support returning
a fallback value specified by the user instead of failing the driver
if a driver variable cannot resolve its RNA path. This especially
applies to context variables referencing custom properties, since
when the object with the driver is linked into another scene, the
custom property can easily not exist there.

This patch adds an optional fallback value setting to properties
based on RNA path (including ordinary Single Property variables
due to shared code and similarity). When enabled, RNA path lookup
failures (including invalid array index) cause the fallback value
to be used instead of marking the driver invalid.

A flag is added to track when this happens for UI use. It is
also exposed to python for lint type scripts.

When the fallback value is used, the input field containing
the property RNA path that failed to resolve is highlighted in red
(identically to the case without a fallback), and the driver
can be included in the With Errors filter of the Drivers editor.
However, the channel name is not underlined in red, because
the driver as a whole evaluates successfully.

Pull Request: https://projects.blender.org/blender/blender/pulls/110135
2024-01-08 15:24:59 +01:00
Alexander Gavrilov
bbd7872680 Drivers: refactor driver_get_variable_property to return an enum.
In order to prepare for introduction of fallbacks, refactor the
function to return its status as an enumeration value. Also, move
the index range check inside the function from python-specific code.
2024-01-08 16:08:18 +02:00
Alexander Gavrilov
b9074381e5 Drivers Editor: apply red underline to drivers that failed evaluation.
F-Curves with a broken rna path are highlighted with a red underline
in the channel list of the animation editors. I think it makes sense
to also apply this to drivers that failed to evaluate and were disabled.

Otherwise, it is not apparent which drivers are broken without checking
every one manually, or applying the errors filter.
2024-01-08 16:08:18 +02:00
Sybren A. Stüvel
1db4ed50e8 Cleanup: make format
Just a run of `make format`. No functional changes.
2024-01-08 14:58:18 +01:00
Sybren A. Stüvel
6d8bb7f73c Anim: armature.collections.move() now retains the active collection
`armature.collections.move(x, y)` now retains the active collection. Due to
the move, the active collection index can change. The index is now updated
to accomodate for this.
2024-01-08 14:53:41 +01:00
Sybren A. Stüvel
687d6932c0 Anim: ensure active bone collection doesn't change when adding new one
Ensure that the active bone collection doesn't change, when adding a new
bone collection via low-level functions (for example
`armature.collections.new()` in Python).

The change to the active bone collection happened because adding a new
child may change the index of the active bone collection.
2024-01-08 14:34:10 +01:00
Alexander Gavrilov
4fe6f0b271 Fix: frame snapping for the time extend transformation mode
The graph editor supports an Extend transformation mode, which is
essentially Move that only affects keyframes either before or
after the current frame, based on the mouse cursor position.

This fixes a bug in this mode where it doesn't respect the snap setting.
2024-01-08 14:18:55 +01:00
Campbell Barton
5b00141144 Fix #116880: Rotation discrepancy when converting a matrix to euler
Converting a near-identity matrix to a euler could be off by over
4.5 degrees when the result of the hypotenuse calculated from the
matrix was small (around 2e-6).

Resolve by increasing the epsilon ~20x to 3.75e-05 which results
in ~1/20th the error.

This was tested against many generated near-identity matrices
(which tend to cause arithmetic error) to ensure this change doesn't
cause worse results in other cases (see report for details).
2024-01-08 23:32:31 +11:00
Brecht Van Lommel
0e4da8d55f Fix macOS ARM build failing with make lite
OpenImageIO headers have a dependency on Imath headers when not on x86_64.
2024-01-08 13:14:34 +01:00
Miguel Pozo
18094d20c9 Fix: EEVEE-Next: GPU_framebuffer_clear assertion 2024-01-08 12:54:08 +01:00
Omar Emara
08130211b1 Fix: GPU Directional Blur node does not match CPU
The GPU Directional Blur node does not match CPU. This is because GPU
accumulates the scale, while the CPU increments it. This patch
incremenets the scale for the GPU to make them match.
2024-01-08 13:42:32 +02:00
Sybren A. Stüvel
2e2b5dcd52 Anim: Outliner, show bone collections in their hierarchy
The Outliner now shows an Armature's bone collections as a hierarchy
instead of a flat list.
2024-01-08 12:31:20 +01:00
Sergey Sharybin
fed446ce8a Fix #116220: Context property driver does not update during playback
This commit fixes missing updates during playback when `frame_current`
property of the active scene is used.

Applied the same check for the depends-on-time as for explicitly
specified scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/116886
2024-01-08 12:30:33 +01:00
Bastien Montagne
d13edee3e0 UI/Code: Fix typos and other UI messages issues. 2024-01-08 12:03:35 +01:00
Pratik Borhade
dddf1ba32a GPv3: Crash when drawing in locked or hidden layer
Cancel drawing operation when layer is locked/hidden (similar to GPv2).
Otherwise `get_editable_drawing_at` returns nullptr which results in crash
and assert hit.

Pull Request: https://projects.blender.org/blender/blender/pulls/116779
2024-01-08 11:18:55 +01:00
Clément Foucault
4dad262dbe Fix: EEVEE-Next: Implicit type conversions
This was breaking compilation on Mesa drivers.
2024-01-08 22:12:01 +13:00
Clément Foucault
98e465109b EEVEE-Next: Replace lighting tiles by direct stencil setup
This avoid the cost of creating the tiles themselves which uses a lot
texture write. This was a bottleneck on Apple GPUs.

Also the per pixel classification allows us to remove certain checks in
the deferred lighting shader making it faster.

### TODO
- [x] Add gl_FragStencilRefARB support on other backend
- [x] Add workaround for when gl_FragStencilRefARB isnt supported

Pull Request: https://projects.blender.org/blender/blender/pulls/116704
2024-01-08 07:35:05 +01:00
Campbell Barton
8c2222b8d9 Fix #116687: Crash on reload scripts and dropping blend files
Reloading scripts lead to wmDropBox::ot pointing to freed operators.
Resolve by following the logic of key-map operator initialization
to ensure changes to registered operator triggers a refresh of the
operator pointer & properties.
2024-01-08 15:24:08 +11:00
Campbell Barton
7fa88241a8 WM: ensure operator context isn't used for drop operator properties
Since wmDropBox are setup with the editors and aren't re-initialized
when the file is reloaded for e.g. it doesn't make sense to use the
current context when setting up their properties.

Note that this doesn't fix any user visible bugs and is more a issue of
correctness.
2024-01-08 14:02:32 +11:00
Campbell Barton
8fadc1ca7f Cleanup: early return & avoid duplicate warnings in WM_dropbox_add 2024-01-08 13:58:46 +11:00
Campbell Barton
375c217ea0 Cleanup: apply clang-tidy modernize-deprecated-headers 2024-01-08 11:32:49 +11:00
Campbell Barton
2783af45ee Cleanup: trailing newlines 2024-01-08 11:31:43 +11:00
Campbell Barton
40444b35d1 Cleanup: various non-functional changes for C++ 2024-01-08 11:31:43 +11:00
Campbell Barton
617f7b76df Cleanup: comment block formatting 2024-01-08 11:31:43 +11:00
Campbell Barton
0ba83fde1f Cleanup: spelling in comments 2024-01-08 11:24:37 +11:00
Jesse Yurkovich
268f93d763 Fix: memory leak during Property Search
An early return prevented the property item array from being free'd.

Pull Request: https://projects.blender.org/blender/blender/pulls/116860
2024-01-07 20:37:30 +01:00
Jacques Lucke
797013b7f4 Fix #116866: crash when adding volume
This removed line is not necessary anymore since
3b3b1bb1a7.

That's because the run-time data is not written to the
.blend file anymore at all.
2024-01-07 13:49:02 +01:00
Jacques Lucke
e983e47616 Cleanup: remove unused simplify level from volume runtime data 2024-01-07 11:03:18 +01:00
Clément Foucault
28356d1f89 Metal: Add debug names to compute pipelines 2024-01-07 22:46:44 +13:00
Thomas Barlow
8b8ca00270 Fix #107634: selecting random hair curves ignores operator settings
There was a second randomization loop after the first loop which ignored
the operator settings. This may have been accidentally left in from when
the operator was being developed.

Removing this second loop makes the operator work as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/116835
2024-01-07 10:22:25 +01:00
Hans Goudey
4b427e1b57 Fix #116843: Multires sculpting crash in undo step creation
The number of multires vertices was wrong after 31435c85c8ee873211cd.
2024-01-06 23:58:14 -05:00
Pratik Borhade
26a629a696 GPv3: Crash deleting end points
Crash is observed when `dst_curve` nums are same as original curve.
`type_count` array in runtime struct of `dst_curve` is not updated after copying
curve attributes hence the crash/assert. In other case (when source and
dst curve_nums are different), type_count is updated when dst.finish()
is called in `gather_attributes()`

Pull Request: https://projects.blender.org/blender/blender/pulls/116839
2024-01-07 05:37:31 +01:00
Clément Foucault
b8b9ed075b Fix: GPU: Crash caused by buffer overflow of name buffer
This was caused by the name buffer not being sized
accordingly. Now counts the specialization constants.
2024-01-07 16:53:56 +13:00
Clément Foucault
8032f85f61 Metal: Allow pretty log for compute shader 2024-01-07 16:48:54 +13:00
Clément Foucault
8dd08d81f4 Fix: GPU: Fix Shader builder
The recent header changes moved the header
containing this function to C++.
2024-01-07 16:48:29 +13:00
Clément Foucault
f2b3403145 EEVEE-Next: Gbuffer Read optimizations
This modify most shader using the GBuffer to use the
`ClosureUndetermined`. This in turn reduces the amount
of duplicated data in the `GBufferReader` structure.

The most important part is the usage of fixed array
indices to access the `GBufferReader.closures[]`.
This avoid the struct to be moved from local register
to device memory and remove a huge performance penalty.

Pull Request: https://projects.blender.org/blender/blender/pulls/116772
2024-01-07 04:46:25 +01:00
Clément Foucault
6f51d7332b EEVEE-Next: Refactor Raytracing to support arbitrary closure
This refactors the whole pipeline to be closure agnostic.

This mean we can have only one raytracing step that covers
any closure type. In practice, it means that there is
3 objects having 1 closure each with a different closure
types each, we can run the raytracing once.

This create a huge overhead during the tile classification
stage. This is fixed by #116772 and will be merged separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/116670
2024-01-07 02:52:04 +01:00
Hans Goudey
3eee758c2b Cleanup: Fix build warnings and errors after recent commits
- Add missing include for `std::function` without TBB
- Add include for math define reported in chat (couldn't reproduce that)
2024-01-06 09:06:20 -05:00
Hans Goudey
e90d844dd7 Cleanup: Grammar in comments
"it's own" -> "its own" again. Start new sentences properly.
2024-01-06 09:02:56 -05:00
Hans Goudey
5179e66756 Cleanup: Move array store files to C++ 2024-01-06 09:02:55 -05:00
Jacques Lucke
3b3b1bb1a7 Volume: move volume runtime data to separate allocation
The same is done for other geometry types. This allows us to use C++ types in
the run-time data more easily and avoids dumping runtime data into .blend files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116840
2024-01-06 13:26:59 +01:00
Guillermo Venegas
5b104fb3fa Cleanup: Silence warnings from 1254fee589
Introduced in 1254fee589

Also remove translation from CLOG statements.

Pull Request: https://projects.blender.org/blender/blender/pulls/116836
2024-01-06 06:53:42 +01:00
Jesse Yurkovich
75c71b78ba Cleanup: Use new OIIO valid_file API
Now that OIIO has proper `valid_file` APIs for the formats we care
about, and which take MemReaders, we can remove the code added to TIFF,
PSD, and PNG as part of 5cc8fea7e9.

Additionally, this change eliminates the recent console spew on startup
where the TIFF loader is asked to load non-TIFF files (it is based on
the ordering of the filetype array)[1]. We now make a `valid_file` check
during open to address this.

[1] `: Not a TIFF or MDI file, bad magic number 12150 (0x2f76).`

Pull Request: https://projects.blender.org/blender/blender/pulls/116826
2024-01-06 05:50:04 +01:00
Guillermo Venegas
1254fee589 IO: Add support for Drag and Drop to FileHandlers
Added support to Drag and Drop to file handlers, part of #111242.

If file handlers are registered with an import operator they can now be
invoked with drag and drop path data.

Import operators must either declare a `filepath` StringProperty or both
a `directory` StringProperty and a `files` CollectionProperty depending
on if they support single or multiple files respectively.

Multiple FileHandlers could be valid for handling a dropped path. When
this happens a menu is shown so the user can choose which exact handler
to use for the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/116047
2024-01-06 03:51:45 +01:00
Hans Goudey
09063a3632 Cleanup: Remove some indirect includes in common headers
The idea is to avoid mistakenly depending on indirect includes,
and avoid compile time overhead from unnecessary header parsing.

Pull Request: https://projects.blender.org/blender/blender/pulls/116664
2024-01-06 01:47:39 +01:00
Jesse Yurkovich
ae02096ad6 Cleanup: Warning fix
Fix warning introduced in b0db5363fa

Pull Request: https://projects.blender.org/blender/blender/pulls/116828
2024-01-05 22:44:46 +01:00
Aras Pranckevicius
423e54b000 VSE: Scopes improvements
- Improve the look of them, so they feel less like from year
  1998 (more details and images in the PR).
- Some of the scopes got slightly faster in the process, others
  stayed the same performance (details below).
- Remove VSE Scopes related data from SpaceSeq DNA, move it into
  runtime instead.
2024-01-05 22:03:03 +01:00