Commit Graph

130887 Commits

Author SHA1 Message Date
Campbell Barton
64a5f4ee5a editorconfig: add HTML entry
While there aren't many HTML files, use consistent formatting
with 2 space indentation & 99 columns.
2023-12-08 13:28:13 +11:00
Campbell Barton
ecd307041e CMake: suppress warning in flag removing macros
Without quotes, empty flags would warn that string(..) was called
without enough arguments.
2023-12-08 13:13:38 +11:00
Germano Cavalcante
e368a72f20 Fix #112394: 'Absolute Grid Snap' not working correctly plane constraint
It is necessary to clear the result of the previous 'target_type' and
apply the constraint before and after snapping to grid.
2023-12-07 21:55:48 -03:00
Hans Goudey
2b0448c91d Cleanup: Write sculpt mask directly when restoring data before stroke
`SculptMaskWriteInfo` is meant as a temporary solution to ease the
transition to code specialized specialized per PBVH type. Remove one
use of it.
2023-12-07 19:25:44 -05:00
Ray Molenkamp
df94b2ef1b Fix: Build error with MSVC
the bots seem to struggle with this test after 7e916474db
doesn't make a whole lot of sense, and i can't repro the
issue locally, but helping it a little to pick the right
template wouldn't hurt.

Pull Request: https://projects.blender.org/blender/blender/pulls/115916
2023-12-08 00:23:07 +01:00
Aaron Carlisle
ee57ad334e Docs: Add button to report python API documentation issue
Adds a button similar to the user manual at the bottom of each page.
This is done to give people a place to report issues other than the documentation repository which should be limited to the user manual.

With this change also comes a new issue template with helpful text and a redirect for people looking to submit an issue with Blender.

I would also like to add a Documentation label too but that requires configuring with the Gitea project.

Pull Request: https://projects.blender.org/blender/blender/pulls/115865
2023-12-07 22:06:07 +01:00
Clément Foucault
71f6228876 EEVEE-Next: HiZBuffer: Add support for 2nd layer
This allows for parallel processing of refraction.
Also fix a limitation of using AO node in
refraction materials.

This is needed for the grouping of raytracing
passes.

This increases VRAM consumption a bit (8MB for fullHD
frame) but has no impact on performance.

This include a needed fix to the `draw::Texture::swap`.

### Later work
- Limit the memory overhead to the cases where it is needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/115912
2023-12-07 22:04:38 +01:00
Brecht Van Lommel
a355488993 Cleanup: make format 2023-12-07 19:59:16 +01:00
Nate Rupsis
f4bc01b6b7 Refactor: Refactor nla_strip_get_color_inside method
Cleanup `nla_strip_get_color_inside` in `nla_draw.cc`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115870
2023-12-07 19:23:22 +01:00
Hans Goudey
3c476979b1 Cleanup: Resolve mix of bool and char warning 2023-12-07 12:14:28 -05:00
Habib Gahbiche
89f7dc9cbe Fix #115779: Compositor Split node factor 0 still shows the other image
At 0% split ratio, the result of the split node still shows the first row or the first column.

Pull Request: https://projects.blender.org/blender/blender/pulls/115844
2023-12-07 18:10:42 +01:00
Miguel Pozo
b006bfe10b Fix: EEVEE-Next: Deferred tile stencil compilation 2023-12-07 17:39:13 +01:00
Falk David
aaed15a2e1 Fix: GPv3: Crash when drawing
The commit cad81786d0 introduced
a crash. The memory from `curve_fit_cubic_to_points_fl` and
`curve_fit_corners_detect_fl` needs to be freed with `free` and
we need to check for `nullptr`.
2023-12-07 17:35:02 +01:00
Miguel Pozo
3360b6344f Fix #115289: EEVEE-Next: Negative scale lights
There was code for ensuring correct handedness,
but it wasn't working since vec.xyz() doesn't return by reference.
2023-12-07 17:08:23 +01:00
Clément Foucault
2cf64b9100 EEVEE-Next: Add tile deferred lighting
This adds a tile classification pass to the gbuffer.
This is then compact into streams of tiles for each
complexity level of lighting evaluation.

The benefit over a simpler approach of using a per
object stencil value is that we can have a per
tile granularity of the lighting complexity.

To avoid quad overshading, we use a prepass that
tags different stencil values for each complexity
level. This allows to still use a fullscreen quad
for the light evaluation pass and remove the
diagonal overshading cost.

This doesn't use compute shader at all to leverage
render pass merging and in-tile memory loads.

Using `atomicOr` for adding together the `eClosureBits`
revealed to be too slow. Using multiple non-atomic
writes to many data values is faster and not much
memory hungry.

### Performance
The whole tile scheduling process takes ~70µs for
a half covered 3800x790 framebuffer and doesn't
get much more slower than this.

Using simpler lighting shader helps reduce the cost
of the lighting pass by half in most common cases.
SSS materials stay the most costly.

Pull Request: https://projects.blender.org/blender/blender/pulls/115820
2023-12-07 17:04:51 +01:00
Ray Molenkamp
7e916474db CMake/MSVC: Remove stale OIIO sse flag
We disabled SSE for OIIO headers in the days we still supported
32 bit builds, as it was giving build errors there. OIIO handles
this internally now so we no longer need to explicitly disable it,
also we stopped shipping 32 bit quite a while ago
2023-12-07 09:02:52 -07:00
Miguel Pozo
bcab9de531 Fix: GPU: Avoid GPUMaterial/Pass collisions between engines
Prevent draw engines from using GPUMaterials that were compiled for
other engines by storing the engine they where compiled for along the
shader_uuid.

Fix #115356
Fix #115371

Pull Request: https://projects.blender.org/blender/blender/pulls/115819
2023-12-07 16:48:09 +01:00
Hans Goudey
7cf9252713 Cleanup: Fix missing declaration warning 2023-12-07 09:40:09 -05:00
Sebastian Parborg
e7f0bb24f7 VSE: Implement file based copy paste
This is a smaller rewrite/refactor of the VSE copy paste code to use the file copy buffer logic that is used in other places of Blender.

This makes Blender able to copy paste between Blender processes.
It can also paste successfully after closing and reopening Blender.

Other than that, the functionally should remain the exact same as the current copy paste operator with one exception: Scene strips does not retain their scene pointer when pasting into the same file.

This is to make it consistent with how it was before when copy pasting between .blend files.
(The scene data for the scene strips were never copied in when doing that)
Logic for pulling in or linking scenes into new or current files are purposely left for later when a proper proposal of how this would work in a nice fashion is done.

Now the strip data gets copied either fully or partially besides for scene strips. There only the script data gets copied and not the scene data.
If there is a audio/video data block of the same name as in the paste data, it will be reused to reduce potential duplication of data.

Pull Request: https://projects.blender.org/blender/blender/pulls/114703
2023-12-07 15:39:51 +01:00
Philipp Oeser
481094ff5c Fix #114760: new attribute does not get active for some domains
Problem here is that `BKE_id_attribute_to_index` [which
`BKE_id_attributes_active_set` uses] does not match
`BKE_id_attribute_from_index` which can lead to "wrong" indices (there
are "wrong" layers included while iterating such as ".corner_vert" or
".corner_edge" for faces).

Deeper reason is that `get_domains_types` swaps `ATTR_DOMAIN_FACE` and
`ATTR_DOMAIN_CORNER` (originally introduced in eae36be372 -- but unclear
at this point why this was done). Historically, this was used for operators
[vertex color rotate/inverse] introduced in c75e1598dd & 771a4dee0b,
assumption is that eae36be372 was trying to make this more generic and make
it work for other domains as well (ATTR_DOMAIN_MASK_COLOR -- the tootip
was also changed from "Rotate vertex colors inside faces" to "Rotate color
attributes inside faces"), however, at this point in time the tools clearly only work
for the corner domain (and this was made more specific in ee18b625ca as well).

So now, remove the swapping all together and make
`BKE_id_attribute_from_index` & `BKE_id_attribute_to_index` in sync.

Also change the tooltip of said operators to use "face corner color attribute".

Pull Request: https://projects.blender.org/blender/blender/pulls/114797
2023-12-07 15:33:28 +01:00
Stefan Werner
8a6f7640d6 Cycles: Make OIDN on GPU use the existing SYCL queue
There's already a queue from the Cycles rendering device, so let OIDN use the same instead of creating a new one.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115650
2023-12-07 14:16:21 +01:00
Werner, Stefan
3e7b8381cc Cleanup: Removed redundant code in OIDN integration
There was an unused mutex, memory limits can be left at their defaults.
2023-12-07 14:13:49 +01:00
Bastien Montagne
1592aaf01a Fix reported build breaking in BSD/clang after change to BLI_rename code.
The preprocessor checks around `renameat2` usage seem to confuse Clang
15 on FreeBSD at least, split them in two.

Caused by 050d48edfc, report and patch by Shane Ambler, thanks!
2023-12-07 12:56:03 +01:00
Christoph Lendenfeld
e0806e6d51 Refactor: combine x and y for insert_vert_fcurve into float2
No functional changes.

To reduce the argument count of `insert_vert_fcurve`,
the x and y argumentsto define the position
of a keyframe can be merged into a single `float2`

Pull Request: https://projects.blender.org/blender/blender/pulls/115886
2023-12-07 12:05:09 +01:00
Casey Bianco-Davis
4dcda1ec12 GPv3: Overlay: Show edit lines option
Adds option to only show edit mode lines overlay, and also adds overlay options panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/115739
2023-12-07 11:42:06 +01:00
Pratik Borhade
5a2b8da619 Fix: GPv3: Crash switching to draw mode for empty object
Crash occurs in debug mode after switching to draw mode if GP object is
empty (i.e. zero points)
This is due to accessing value which is empty i.e.`std::nullopt`

Pull Request: https://projects.blender.org/blender/blender/pulls/115795
2023-12-07 11:40:08 +01:00
Falk David
cad81786d0 Fix: GPv3: Memory leaks in curve fitting functions
There were some memory leaks in the `polyline_fit_curve` and
`polyline_detect_corners` functions, because the
c-style arrays that the library returns are never freed.
We only copy the data and return it.

The fix makes sure we free the temporary arrays.
2023-12-07 11:08:50 +01:00
Pratik Borhade
31ee0a2a3e Fix: GPv3: Missing add layer option in menu when list is empty
There was a mistake in 671f428ead. When the layers list is empty, the operator to add a new
layer will be missing in the "Active Layer" menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/115785
2023-12-07 10:51:44 +01:00
Jesse Yurkovich
2f0633f5fa Fix: Send more appropriate notification at end of USD/Alembic import
A recent change[1] caused the `NC_SCENE | ND_FRAME` combination to no
longer perform a full Outliner rebuild. However, both Alembic and USD
importers were using this combination. The end result was that the
outliner would not show any of the newly imported objects/collections
until a rebuild was forced some other way (like going into Edit mode on
an object).

Change to use a more appropriate notification that corresponds to the
concept of new IDs being added to the scene instead: `NC_ID | NA_ADDED`

Also, remove the notification being sent from the startjob callback when
creating a new collection. It's unneeded in this situation and it could
be problematic being called from the callback.

[1] b549260aa4

Pull Request: https://projects.blender.org/blender/blender/pulls/115883
2023-12-07 10:45:58 +01:00
Omar Emara
45dcc61fd2 Fix #115859: Cryptomatte node considers preview channels
The Cryptomatte node considers preview channels as part of the
Cryptomatte layers, producing bad pick outputs at best and bad mattes at
worst.

The Cryptomatte specification specifies that a layer with the same name
as the typename is a (Now deprecated) preview layer, so it should be
ignored, which is what the patch does.

Pull Request: https://projects.blender.org/blender/blender/pulls/115879
2023-12-07 10:00:55 +01:00
Jeroen Bakker
5475d8c5cf EEVEE: Lookdev HDRI Spheres
This PR implements the Lookdev (HDRI) Spheres overlay for EEVEE-Next. There are
also improvements for lookdev:

* Scene lighting (direct and indirect are) applied to the spheres.
* Shadow is applied to the spheres.

This is done by virtually placing the balls at the near clip plane of the camera/viewport.

![image](/attachments/735d0f49-a2cd-479e-b293-8e3f4b7f06a1)

Pull Request: https://projects.blender.org/blender/blender/pulls/115465
2023-12-07 08:19:32 +01:00
Campbell Barton
e8f60d4de2 Cleanup: replace unordered_map for cursor lookups with an array 2023-12-07 17:50:43 +11:00
Campbell Barton
488ba5cd9a Fix #115811: Wayland picker cursor isn't displayed
Themes that didn't define "color-picker" showed the default cursor.

Resolve by checking if the theme contains a cursor,
not just that the name is known.
2023-12-07 17:08:06 +11:00
Campbell Barton
96e41bfd19 GHOST/Wayland: update cursor names
Update names to better support Adwaita & Breeze cursor themes.
2023-12-07 17:08:03 +11:00
Campbell Barton
b570efb0a9 Cleanup: reference a const wl_cursor from Wayland 2023-12-07 17:08:01 +11:00
Campbell Barton
ae8f971491 Cleanup: remove GHOST_System::getMilliSeconds
Each GHOST implementation defines it's own getMilliSeconds()
so there is no need to define this in GHOST_System.
2023-12-07 17:07:59 +11:00
Hans Goudey
a86658a58a Fix #115856: Sculpt Face sets drawing sometimes uses wrong default
In some cases the value that defines which ID is displayed as white is
mismatched between the original and evaluated mesh. Use the original
as the source of truth, since that's the mesh that's actively edited.
2023-12-06 23:50:30 -05:00
Hans Goudey
f3dd1a3260 Sculpt: Refactor face sets storage and access
Similar to previous changes for masks and visibility, remove the mutable
pointer to face sets from the sculpt session. With implicit sharing,
this avoids a duplicate copy of face sets on the evaluated object when
face sets aren't edited.

Most retrieval of face sets now goes through the Mesh attribute API
instead of the pointer in sculpt session. This integrates sculpt code
with the rest of Blender, avoiding the need to reinvent things like
basic attribute access.

Similar to previous refactors to mask and visibility operators, refactor
the face set gesture and edit operators to be multithreaded and only
push undo steps and tag updates for actually changed nodes.

There is opportunity for more code deduplication in the future.
For now the aim is to reduce the number of confusing abstraction
levels though.
2023-12-06 23:50:30 -05:00
Hans Goudey
dc234c5d93 Cleanup: Add utility to compare non-indexed and indexed span values
This will be useful for other types in the future (similar abstractions
for editing face sets), and it makes more semantic sense as a templated
utility function.
2023-12-06 23:33:46 -05:00
Hans Goudey
184418b6d0 Fix: Incorrect use of Vector resize in mesh_fair
Wrong since c9b4d75336
2023-12-06 23:33:46 -05:00
Hans Goudey
4e7e539b33 Sculpt: Make hide poly pointer in sculpt session const
This avoids having to make the original data layer mutable when we
aren't going to modify it, meaning the memory can still be shared with
the evaluated mesh-- saving 1 byte per face in some situations. This was
made possible by previous commits that moved to using the Mesh attribute
API instead of the SculptSession pointer to edit this data. Eventually the
`hide_poly` pointer should be completely removed.
2023-12-06 23:33:46 -05:00
Hans Goudey
466dca07d5 Cleanup: Move mesh visibility and selection flushing to C++ namespace
Also rename the functions and move a sculpt function that depended on
the mesh functions to a more proper place. And also use references and
nicer variable names for meshes.
2023-12-06 23:33:46 -05:00
Hans Goudey
9f5878b628 Cleanup: Use enum class for some sculpt enums
Benefits are stronger type safety and prettier code.
2023-12-06 23:33:46 -05:00
Hans Goudey
251069ae5b Sculpt: Reimplement face sets visibility operator
Iterate over faces instead of vertices, and multithread the logic over
all PBVH nodes. The result is about 3 times faster in my tests;
noticeably snappier for large meshes. Add a new sculpt undo type for
face hide storage (as opposed to vertex storage), and use that only
when the data actually changed, which should reduce memory usage too.
Internally some code is shared with the other visibility operators,
since this operation always affects base mesh faces, most isn't.

Similar to 4e66769ec0
2023-12-06 23:33:46 -05:00
Hans Goudey
f6ef00a6f4 Cleanup: Move RNA enum definitions to smaller scope 2023-12-06 23:33:46 -05:00
Hans Goudey
8e03fa34f1 Cleanup: Avoid repeatedly retrieving object in sculpt undo nodes 2023-12-06 23:33:46 -05:00
Hans Goudey
d1d3207e33 Sculpt: Simplify and slightly improve undo update tagging
Mostly make logic more consistent with better variable naming,
early returns, and separated functions. But also avoid adding some
tags if the corresponding data hasn't changed. For example, don't
tag the mesh positions changed if the undo nodes only contained
color or face set information.
2023-12-06 23:33:46 -05:00
Hans Goudey
1e65ede8d9 Cleanup: Use C++ vector to store temporary sculpt undo update tags 2023-12-06 23:33:46 -05:00
Hans Goudey
1863533eb6 Cleanup: Move sculpt_face_set.cc to C++ namespace 2023-12-06 23:33:46 -05:00
Hans Goudey
f61b271458 Cleanup: Remove unused sculpt functions 2023-12-06 23:33:46 -05:00