Commit Graph

134583 Commits

Author SHA1 Message Date
Hans Goudey
436c0a773e Cleanup: Remove object vgroup functions to proper header
These functions were declared in the editors/mesh module but
defined in the editors/object module. This commit moves them to
a separate header associated with the object editors module.
2024-03-26 23:45:43 -04:00
Aaron Carlisle
32db305899 Docs: Python: Refactor the config file out of 'sphinx_doc_gen.py'
This was done originally because we need access to some information that is avalable from `bpy` however, we only need a few pieces of information.

Instead, I have refactored the code to a traditional `conf.py` file that uses template strings that get substituted when the file is copied to the build folder.

The goal here is to make it simpler to adjust the configuration.

This change also moves the config generation from `rna2sphinx` to the main function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119904
2024-03-27 04:27:40 +01:00
Hans Goudey
148940ad15 Cleanup: Remove unnecessary keywords from newly C++ headers
Pull Request: https://projects.blender.org/blender/blender/pulls/119943
2024-03-27 02:45:30 +01:00
Hans Goudey
b8b745ae1e Cleanup: Move remaining editors internal headers to C++ 2024-03-27 02:45:27 +01:00
Harley Acheson
ee38a7b723 UI: Button to Save Custom Themes
Add a new "Save" to the Themes list in Preferences to save (overwrite)
custom themes. The operator has a poll function to disable for built-in
themes. Shows a confirmation when overwriting.

Pull Request: https://projects.blender.org/blender/blender/pulls/119491
2024-03-27 01:11:50 +01:00
Hans Goudey
acd1b0b7f9 Refactor: Use C++ Vector for RNA/context collection retrieval
Previously retrieving a collection from the context like "selected_ids"
would give a linked list of allocated items. Now it returns a vector of
RNA pointers. Though the number of items is typically fairly small,
using contiguous memory and avoiding many small allocations are
typical performance improvements that could still be beneficial
when there are many items. Iteration also becomes much simpler.

Pull Request: https://projects.blender.org/blender/blender/pulls/119939
2024-03-27 00:47:39 +01:00
Campbell Barton
3416fe6e1e License headers: add SPDX headers 2024-03-27 10:31:24 +11:00
Campbell Barton
40ab214c0a Cleanup: spelling in comments 2024-03-27 10:25:31 +11:00
Campbell Barton
d6c4433451 Cleanup: remove declarations for removed functions 2024-03-27 10:23:53 +11:00
Campbell Barton
3f594f7b2f Cleanup: consistent naming for EditMesh::looptris elements
Use the term `ltri` everywhere.
2024-03-27 10:09:12 +11:00
Campbell Barton
2220696d25 BMesh: avoid copying by value for BMLoop triangles
Caused by [0] which made BMLoop[3] variables & arguments copy by value.

[0]: 3805974b6fa8e15ae4409f597747bc7beee51fa3
2024-03-27 10:09:10 +11:00
Hans Goudey
f2c5cae3d8 Cleanup: Remove unused RNA function call functions
These functions appear to have been unused for the last 15 years.
They are quite complex with the var_args handling, and may get in
the way of some other cleanups in the area.
2024-03-26 18:12:21 -04:00
Hans Goudey
e1c54d5a24 Fix: Windows build error after recent cleanup commit 2024-03-26 16:20:40 -04:00
Hans Goudey
cd76d06f95 Cleanup: Use boolean instead of int 2024-03-26 16:04:03 -04:00
Hans Goudey
c72d6100ba Cleanup: Remove unrelated change added in previous commit
WIP change unrelated to anything else. Sorry for the noise!
2024-03-26 16:00:00 -04:00
Hans Goudey
48e4576162 Cleanup: Remove unnecessary keywords from C++ headers 2024-03-26 15:58:39 -04:00
Hans Goudey
265bfdb019 Cleanup: Resolve allocation size warning in Hook modifier RNA
GCC seems to complain about a possible signed to unsigned conversion
in combination with allocation and copying here.
2024-03-26 15:43:12 -04:00
Hans Goudey
0cdd429b44 Cleanup: Use newer API for creating IDProperties in most places
There are still a few places that are more complicated where the replacement
to `IDP_New` isn't obvious, but this commit replaces most uses of the ugly
`IDPropertyTemplate` usage.
2024-03-26 15:39:39 -04:00
Hans Goudey
e0567eadbd Cleanup: Use FunctionRef for IDProperty iteration callback
Avoid the need for a seaprate user_data argument.
2024-03-26 15:39:39 -04:00
Clément Foucault
2a600b4a83 EEVEE-Next: Shadow: Limit view per shadow map projection
This limits the number of tilemaps per LOD that can be fed to avoid the
easy to hit "Too many shadow updates" (#119757).

This allows for a max 64 tilemaps to be updated at once at their lowest
requested LOD (so ~10.6667 point lights if every faces of the punctual
shadow map is needed, but likely more in practice).

Unfortunately this is still quite low and will surely be hit quite soon
with directional shadow added to it. One idea to workaround this would
be to time slice the update of some lights, but this opens a whole can
of worms that I'm not ready to open for now so I created #119890 for
future reference.

Some notes, most lights seems to request around 3 LODs. It might help
to allow requesting at least 2 LODs if we are rendering since volumes
might want lower LOD available for volumes.

I added a very simplistic heuristic that also lowers the max tilemaps
when transforming, animation playback or navigating the 3D view to
improve the responsiveness of the engine. Note that this doesn't
only lowers the resolution to the minimum requested one. So it should
be good enough in most cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/119889
2024-03-26 20:33:31 +01:00
Sean Kim
627ec2666b Cleanup: Add doxygen and restructure paint_hide.cc
This PR restructures the flow of `paint_hide.cc` and groups the
existing functions into newly added doxygen blocks.

Pull Request: https://projects.blender.org/blender/blender/pulls/119929
2024-03-26 20:19:54 +01:00
Brecht Van Lommel
2fb4efc905 Fix: GPU test errors importing gpu module
Pull Request: https://projects.blender.org/blender/blender/pulls/119721
2024-03-26 20:16:02 +01:00
Guillermo Venegas
8b6a21c122 IO: Use FileHandlers in the View 3d
Use File Handlers to handle file drag-n-drop in the View 3d. Drop-boxes
still remain since they handle Texture ID drag-n-drop.

This will add-ons to handle drag-n-drop for images and movies while
still providing access to Blender's native support since File Handlers
let users choose which to invoke if there's multiple configured.

Pull Request: https://projects.blender.org/blender/blender/pulls/117728
2024-03-26 20:01:08 +01:00
Sean Kim
5a1bab39d2 Cleanup: Remove modal definition for PAINT_OT_visibility_invert
This PR removes the modal callback for `PAINT_OT_visibility_invert`.
It does not use the provided data, nor is the `modal` function
invoked by a corresponding `invoke`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119930
2024-03-26 19:43:06 +01:00
Jesse Yurkovich
9ae24fee48 USD: Add tests to cover curve, light, and point instancer import
The curve variations were used during development of the GeometrySet
changes.

The lights and point instancer coverage would have helped uncover bugs
earlier. Bugs that eventually had to be fixed in 4.1. Better late than
never.

The one downside is that the light tests is actually a round-trip test,
which is normally fine to do, except it technically does an export
during the import test.

Pull Request: https://projects.blender.org/blender/blender/pulls/119858
2024-03-26 18:58:46 +01:00
Hans Goudey
efee753e8f Cleanup: Move BKE_idprop.h to C++ 2024-03-26 13:07:04 -04:00
Hans Goudey
f41ab9abc1 Cleanup: Combine BKE_idprop C and C++ headers
In preparation for moving the whole BKE_idprop.h to C++.
To keep the git history intact we remove the newer smaller file.
2024-03-26 13:07:04 -04:00
Sean Kim
881178895b Sculpt: Add fast solver option for trim operations
This PR introduces the ability for users to switch between boolean
solvers while using the sculpt *Trim* tools (*Box Trim* & *Lasso Trim*)
much like the mesh boolean modifier and geometry node. Because the
*Exact* solver has performance issues with larger meshes, the *Fast*
solver is set to be the default.

In my very rough timing tests on my laptop on a mesh with **1.7m**
vertices, a *Trim* operation with the *Fast* solver finishes in roughly
20 seconds as opposed to still being in progress after five minutes
with the *Exact* solver.

Addresses part of #84229

Pull Request: https://projects.blender.org/blender/blender/pulls/119699
2024-03-26 17:25:06 +01:00
Hans Goudey
b4b74c8da6 Cleanup: Simplify object data iteration in shade smooth operator
Use a Set instead of the `LIB_TAG_DOIT` flag.
2024-03-26 11:37:05 -04:00
Weizhen Huang
c16fd219a8 Fix #70210: Cycles environment map sampling not accounting for negative values
Cycles samples environment map with a PDF proportional to the luminance.
This computation was assuming positive values, but generated texture
coordinates from world could have negative values, so the resulted CDF
was almost zero in the bug report scene.
Fixed by taking the absolute value when computing luminance in CDF.

Pull Request: https://projects.blender.org/blender/blender/pulls/119896
2024-03-26 16:24:36 +01:00
Falk David
f8ef2b3e78 Curves: Add simplify_curve_attribute function
Compute an index masks of points to remove to simplify the curve attribute using the Ramer-Douglas-Peucker algorithm.

The Ramer-Douglas-Peucker algorithm finds a set of points in a polyline to remove so that the overall shape of the polyline is similar. How similar can be controlled by the distance `epsilon`.

The function takes a `GSpan` so it can be used with any attribute (that has a type `float`, `float2`, or `float3`).

Pull Request: https://projects.blender.org/blender/blender/pulls/118560
2024-03-26 15:28:11 +01:00
Aras Pranckevicius
3663c8147c Vulkan: implement support for compressed textures
Textures that are GPU-compressed already (in practice: from DDS files
that are DXT1/DXT3/DXT5 compressed) now can stay GPU compressed
in Vulkan, similar to how that works on OpenGL.

Additionally, fixed lack of mipmaps in Vulkan textures. The textures
were created with mipmaps (good), the sampler too (good), but
the vulkan image view was always saying "yo, this is mip 0 only"
because mip range variables were never set to anything than zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/119866
2024-03-26 14:49:53 +01:00
Jacques Lucke
4cdc62044e BLI: fix fixed-width-int to string conversion 2024-03-26 14:25:33 +01:00
Sergey Sharybin
d3504a6bab Fix #119907: Active curve vertex/spline not visualizing properly
A regression caused by 7a2d04a5c4.

The offending commit made it so selection tag does not imply parameters
update, which also avoids transitive re-evaluation of the curve geometry.
However, the active curve index is stored on a Curve, and curve modifier
stack creates a copy of the curve to hold the evaluation results, which
makes it so evaluated curve object does not intrinsically share the active
spline index.

This change makes it so changes in selection triggers geometry evaluation
on curves, matching the behavior prior to the offending commit.

AN ideal fix would somehow avoid such geometry re-evaluation, but it would
be a bigger change, not suitable for possible corrective release.

Potential candidate for 4.1.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/119918
2024-03-26 13:58:55 +01:00
Campbell Barton
9c3eceb8c8 BKE_reports: only print a single newline after each report
Printing reports was printing 2x newlines afterwards.

This caused a blank line to be printed when any operator reported info.
2024-03-26 23:00:59 +11:00
Omar Emara
5764173501 Compositor: Update tests for realtime compositor 2024-03-26 12:52:07 +02:00
Jeroen Bakker
e811785f37 Vulkan: to_string for used vulkan types
Every vulkan installation has a vk.xml file containing the vulkan specification
in a machine readable fasion.

This PR uses the vk.xml to generate to_string functions for data types blender uses.
When updating to a new specification or when changing features/extensions we
should re-generate the to_string functions.

The generator is implemented in `vk_to_string.py`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119880
2024-03-26 11:35:16 +01:00
Omar Emara
df9b3d35a2 Fix: Compositor retains old images
The compositor does not correctly free, wrap, or allocate images. That's
because the resetting mechanism didn't reset all members. This patch
rests all members and only retains the important ones.
2024-03-26 12:32:36 +02:00
Sietse Brouwer
a02b429324 Fix: GPv3: Layer settings not copied when duplicating a layer
Pull Request: https://projects.blender.org/blender/blender/pulls/119821
2024-03-26 11:01:00 +01:00
Sietse Brouwer
ab84f9eaf0 Fix: GPv3: The 'Use Masks' switch is always enabled for new layers 2024-03-26 10:59:08 +01:00
Sietse Brouwer
76c164e0ad Fix: GPv3: Blend mode not initialized when adding a new layer 2024-03-26 10:59:08 +01:00
Sietse Brouwer
31c194c002 Fix: GPv3: Layer 'Lock All' not working when 'Unlock All' has run before 2024-03-26 10:59:08 +01:00
Sietse Brouwer
ca8fc1dea6 Fix: GPv3: Empty drawings with layer 'Duplicate' when 'Duplicate Empty Keyframes' has run before 2024-03-26 10:59:08 +01:00
Weizhen Huang
1bf467aff6 Cleanup: make format 2024-03-26 09:39:22 +01:00
Philipp Oeser
b8bd762714 Fix #112618: many Outliner operators crash running without a region
This could happen when e.g. overriding context with just the area.

Now add poll functions that check for an active region when running
operators that require a region.

The fix is similar to 72688791dcb2

Alternatively, we could have a fix similar to a8892c726435 (getting the
correct region from the area), this would require less setup by
scripters, however for some operators the usage of the region is a
little further down the line, so implementation would be a bit more
involved. Also: for some of the operators, this would have to be done in
both `invoke` and `exec` (so would be more duplicate code changes).

Pull Request: https://projects.blender.org/blender/blender/pulls/119696
2024-03-26 09:30:47 +01:00
Alaska
a4f1a52a5c Fix #119903: Cycles compilation on device that don't use the light tree
During the some of the shading for volumetrics, Cycles would try to
write to a variable that does not exist if the device has the
light tree disabled.

At the moment this only impacts AMD GPUs with the Metal backend.

Pull Request: https://projects.blender.org/blender/blender/pulls/119906
2024-03-26 08:20:09 +01:00
Campbell Barton
155dae94d7 Cleanup: code-comments, use doxygen formatting & spelling corrections
Also move some function doc-strings from the implementation
to their declarations.
2024-03-26 17:55:20 +11:00
Omar Emara
6d7b4e049e Compositor: Refactor backdrop offset
This patch refactors the backdrop offset to be stored as a float instead
of an int and to be stored in the image runtime structure instead of the
image itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/119877
2024-03-26 07:49:33 +01:00
Aaron Carlisle
3b3a6ccecd Docs: Python: Use headings instead of rubrics
This allows these headings to show under "On this page".
2024-03-26 01:48:32 -04:00
Aaron Carlisle
7d29f25ee1 Docs: Python: Fixes for sphinx Idioms
- There is no need to use the low level css add function use `html_css_files` instead.
- There is no need to specify each file for `html_extra_path`, just use the directory.
2024-03-26 01:23:55 -04:00