Commit Graph

144157 Commits

Author SHA1 Message Date
Dalai Felinto
f8ca9ee46b make license: Tweak on generated comments
After coming back to this file after a few months I myself did not remember where to edit it.
Adding the "Introduction and formatting" bullet item and update others for brevity.
2024-12-03 17:55:21 +01:00
Falk David
c86ead28a3 Cleanup: Grease Pencil: unique_node_name function
Some non-functional changes:
* Use the C++ variant of `BLI_uniquename_cb`.
* Use `StringRef` when passing strings as parameters.
* Don't pass default name as parameter. Expect name in
  `unique_node_name` to not be empty.
2024-12-03 17:01:56 +01:00
Julian Eisel
172e9c5b83 Fix #130583: Crash opening a file when asset shelf is set for non-paint modes
The region type isn't set yet when polling regions just after file read. As a
result, the polling state cannot be evaluated correctly, and `init()` may end
up being called without the previous required call to `on_poll_success()`.

Ensure the region type is set earlier, right at the beginning of screen
initialization after file read. This way all further area/region
referesh/re-init (confusingly called "init") logic can assume it's set.

Pull Request: https://projects.blender.org/blender/blender/pulls/131050
2024-12-03 16:57:38 +01:00
Clément Foucault
9380e2d5d8 Cleanup: Overlay: Remove unused structs 2024-12-03 16:49:23 +01:00
Clément Foucault
6a112a435d Cleanup: Overlay: Armature: Remove legacy code 2024-12-03 16:49:23 +01:00
Falk David
083a10148c Cleanup: Grease Pencil: Use StringRef for function parameters
Generally, `StringRef` should be used for parameters and `StringRefNull`
for the return type. This cleans up the code to use this pattern.

Part of #130518.

Pull Request: https://projects.blender.org/blender/blender/pulls/131246
2024-12-03 16:33:15 +01:00
Sebastian Parborg
2ec719447e Cmake: Add Pipewire support
Pull Request: https://projects.blender.org/blender/blender/pulls/126091
2024-12-03 16:26:01 +01:00
Sebastian Parborg
bc39ee692d Audaspace: merge changes from upstream.
Add the Pipewire backend and Pulseaudio fixes.
There are also some other minor changes.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
33af6d9c5b Fix: Make sure that sound scrubbing doesn't interfere with regular playback
When "sound scrubbing" was turned on, it would stop audio playback if
you managed to start the timeline before the "sound scrubbing" audio
preview had finished.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
d7140a599d Fix: Make sure Blender doesn't seek an extra time after starting to playback 2024-12-03 16:25:59 +01:00
Sebastian Parborg
6d1bc2feb1 Fix: remove uneeded A/V sync frame interpolation
This was trying to smooth out the playback but could instead lead to
worse frame pacing. It was also masking some bugs in the PulseAudio
backend that has been fixed.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
32a26b8e19 Fix: Properly reset the audio devices when changing settings
Previously changing audio devices or settings while Blender was playing
back could lead to crashes or the playback state between Blender and
Audaspace de-syncing.
2024-12-03 16:25:59 +01:00
Miguel Pozo
5ffa4c4ffb Fix #131134: EEVEE: Playback performance degrades over time
Ensure `object_steps_usage` is properly reset to prevent `object_steps`
from growing every frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/131165
2024-12-03 16:24:04 +01:00
Falk David
a265b591be Python: Add API function to reorder curves
The order of curves in a Grease Pencil drawing defines the
order in wich they are rendered, so it's important to be
able to change the order. Currently, there is not easy way
to do this from python.

This adds a new `reorder_curves` and `reorder_strokes`
function to reorder the curves in the curves geometry.

The function takes in an array of indices that are the
new indices for the curves (e.g. an index map).

`reorder_curves(new_indices=[...])`

Pull Request: https://projects.blender.org/blender/blender/pulls/130331
2024-12-03 16:23:31 +01:00
Hans Goudey
66e090dcb4 Cleanup: Remove unused function declarations 2024-12-03 10:21:45 -05:00
Hans Goudey
e5a1a61524 Cleanup: Remove unused sculpt drawing code
Unused after 62897317bd.
2024-12-03 10:21:45 -05:00
Sybren A. Stüvel
be921b8ddb Anim: start slot handles at a high number
The `Action::last_slot_handle` field is set to a high-ish value, to
disambiguate slot handles from array indices.

Slot handles are opaque integers, and are just used to find a slot
with that particular handle. Its exact value is irrelevant; Blender
only ensures that slot handles are never reused within the same
Action.

This particular value was obtained by taking the 31 most significant
bits of the TentHash value (Nathan's hash function) for the string
"Quercus&Laksa" (Sybren's cats).

Pull Request: https://projects.blender.org/blender/blender/pulls/131310
2024-12-03 16:15:25 +01:00
Clément Foucault
62897317bd DRW: Remove Basic engine
All remaining shaders were moved to overlay.

The basic engine is not used anymore since
all selection and depth picking happens inside
overlay engine.
2024-12-03 16:11:31 +01:00
Hans Goudey
0675353625 Cleanup: Remove unused functions from BLI math C-API
Pull Request: https://projects.blender.org/blender/blender/pulls/131313
2024-12-03 15:44:36 +01:00
Clément Foucault
3174716347 DRW: Remove use of legacy API in external draw engine
The prepass is now handled by the overlay engine.

Pull Request: https://projects.blender.org/blender/blender/pulls/131311
2024-12-03 15:37:03 +01:00
Jeroen Bakker
52d3cf8568 Fix #131227: OpenGL: Sequence editor crash on legacy Intel platforms
There seems to be an issue inside Intel OpenGL driver of legacy
platforms that fails to link `gpu_shader_sequencer_strips`.
Uniform locations are used to fix an specialization constants issue.

This PR only adds the uniform location when the shader can be
specialized. It is unclear what is actually failing inside the driver
but there are other issues with the driver.

Pull Request: https://projects.blender.org/blender/blender/pulls/131293
2024-12-03 15:31:10 +01:00
Omar Emara
be22fcf425 Fix: Wrong border nearest interpolation around negative edges
The BLI wrapmode variant of nearest interpolation for border boundary is
wrong for coordinates between [-1, 0]. That's because the negative
comparison in wrap_coord is done on the integer rounded coordinates,
which will be zero in this case, so the condition will not fail. To fix
this, do the comparison on the original coordinates instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/131306
2024-12-03 15:04:50 +01:00
Jeroen Bakker
60d918c297 Fix #131269: Vulkan: Add support for GPU_DATA_UINT_24_8 read back
Add support for GPU_DATA_UINT_24_8 readback. Note that stencil reading/writing
are not supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/131302
2024-12-03 14:56:43 +01:00
Julian Eisel
d9eb1d7155 Fix #130758: UI: Spreadsheet: Animation update does not affect tree view
Redraw was not triggered for the region containing the tree-views. Ensure it's
handled by the editor redrawing logic for animation playback.

Pull Request: https://projects.blender.org/blender/blender/pulls/131303
2024-12-03 14:15:02 +01:00
Jacques Lucke
13ed60dbd3 Fix #130503: Separate Geometry node outputs empty grease pencil layers
I'm not quite sure what was wrong about the old implementation, but it was confusing
because it also depended on the user counts of drawings and other more high level
functions like `duplicate_layer`.

This fix just reimplements the functionality using the grease pencil API that we use in
more places in geometry nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131291
2024-12-03 13:55:58 +01:00
Butterscotch!
e2ff0a45aa Fix BVH import bone tail calculation with multiple children
When importing a BVH file with a parent node that has more than one
child that have offsets within `0.001 * global_scale` of the parent
node, the length of the parent node is considered to be zero.

For example: A parent node with `OFFSET 0 -0.1077 0`, two children with
`OFFSET 0 -0.1074 0`, and a global scale of `1.0`, the parent node's
length would be considered zero, therefore adding `global_scale / 10`
(`0.1` in this case) to the y component of the offset. The resulting
tail offset would then be `OFFSET 0 -0.0077 0`.

Ref !105492
2024-12-03 23:30:10 +11:00
Laurynas Duburas
b13e085109 OBJ Import: Improved NURBS curve support
Adds support of NURBS weights or "rat bspline" in OBJ terms.
Tries to guess Blender knot mode better:

- Detects and closes loops. This decision is based on geometry only. No metadata is provided in OBJ for this, so importer has checkbox to disable this feature.
- Bezier knot mode allows to import circles and circular arcs.

Pull Request: https://projects.blender.org/blender/blender/pulls/131169
2024-12-03 13:16:16 +01:00
Jeroen Bakker
c480b7ffd3 Vulkan: Incorrect image aspect when transferring depth textures
When copying from/to depth stencil images the aspect of the image was
set incorrectly. It pointed to only one aspect of the full image when
building resource links, which could lead to incorrect decisions in the
driver.

Found when researching #131269

Pull Request: https://projects.blender.org/blender/blender/pulls/131298
2024-12-03 12:36:39 +01:00
Jacques Lucke
f0500a28ee Fix: BLI: quaternion is not normalized after conversion
This applies the fix from 98334b8f7d to the c++ implementation.

Two notes:
* We need to work towards unifying these implementations which would have avoided this bug.
* In the C++ implementation, one can't use `math::dot` and `math::normalize` for quaternions
  where this function is implemented, because of include dependency order.

Both these things should be resolved, but right now correctness has priority for me.

Pull Request: https://projects.blender.org/blender/blender/pulls/131296
2024-12-03 12:24:55 +01:00
Jacques Lucke
4d24b5fc08 Fix: Grease Pencil: crash when drawing grid overlay without active layer
Found when checking #130503.

Pull Request: https://projects.blender.org/blender/blender/pulls/131290
2024-12-03 12:23:43 +01:00
Campbell Barton
b48c81761f Docs: improve wording for dna_defaults.c descriptions 2024-12-03 22:20:43 +11:00
Pratik Borhade
3b303bed34 Fix: Grease Pencil: Remove group crash when tab is pinned
Missed in bd4f7acce5.

Pull Request: https://projects.blender.org/blender/blender/pulls/131295
2024-12-03 12:10:01 +01:00
Omar Emara
3b69fe0f40 Fix: Defocus node crashes for single value inputs
The Defocus node crashes for single value inputs, because single values
were not handled. Fix this by handling single values independently.
2024-12-03 12:24:27 +02:00
Omar Emara
1fc9ff4a4e Fix: Variable size Bokeh Blur node crashes
The Variable size Bokeh Blur node crashes due to access to pixels
outside of the image boundary. Fix this by accessing using extended
boundaries.
2024-12-03 12:22:15 +02:00
Omar Emara
03b3f69e33 Compositor: Assert for invalid pixel access 2024-12-03 12:21:31 +02:00
Falk David
f6c30bfe45 Curves: Add python function to compare curve geometries
This adds a `unit_test_compare` function to `Curves`.

Compares the curves. Curves are the same if:
* The number of points matches.
* The number of curves matches.
* The attribute names are the same and have the same type.
* The point attribute values are within the `threshold`.
* The curve topology matches (e.g. the curve sizes are the same).
* The curve attribute values are within the `threshold`.
* The indices of the points and curves are the same (can be ignored if this should be treated as the same).

The implementation reuses the same functions as the existing
comparison function for meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131164
2024-12-03 11:11:27 +01:00
Bartosz Kosiorek
c37e6290ec UI: Add missing tooltips to Principled BSDF for Sheen and Thin Film
This adds tooltip descriptions for five items in the Principled BSDF
that currently have no descriptions at all. Sheen Weight: "Intensity
of the sheen layer, which simulates very small fibers on the surface".
Sheen Roughness: "Roughness of the sheen layer. Low and high roughness
values produce fuzzy or dusty appearance, respectively". Tint Color:
"Color of the sheen reflection". Thin Film Thickness: "Thickness of the
film in nanometers". Thin Film IOR: "Index of refraction (IOR) of the
thin film".

Pull Request: https://projects.blender.org/blender/blender/pulls/126735
2024-12-03 10:34:20 +01:00
Clément Foucault
18f3a11955 GPU: Remove remaining metal geometry shader workarounds
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/131267
2024-12-03 10:18:50 +01:00
Jacques Lucke
5e66ece252 Fix #131258: hidden sockets add padding to nodes 2024-12-03 10:08:59 +01:00
Campbell Barton
6ca1417103 Cleanup: suppress unused Python warnings
Suppress unused warnings using the "vulture" utility.

- Include public definitions in the modules `__all__`.
- Mark arguments & variables as unused with a "_" prefix.
2024-12-03 12:54:13 +11:00
Campbell Barton
a590fa749b extern/curve_fit_nd: suppress harmless UBSAN warnings 2024-12-03 12:54:13 +11:00
Harley Acheson
5d05c36fc7 UI: Fix Broken Menus after #129125
Copy and Paste error resulted in UI_block_end_ex
being called twice.  Remove the first.

Pull Request: https://projects.blender.org/blender/blender/pulls/131275
2024-12-03 02:53:38 +01:00
Campbell Barton
ababc2e01b Fix #120778: depth navigation ignores camera & light objects
Restore overlay depth drawing which was removed in [0].
For viewport navigation this is useful. Disable overlays
for other operations such as painting & object placement.

Also disable color drawing in the overlay_next engine drawing
when drawing depth, since it caused the viewport to show a
checkered backdrop.

Details:

A boolean argument has been added to ED_view3d_depth_override instead
of new enums in eV3DDepthOverrideMode since mixing object-filtering
and draw-type in the one enum gets verbose & awkward, where most
existing enums would have needed to include NO_OVERLAY in their name.

V3D_DEPTH_NO_OVERLAYS has been renamed to V3D_DEPTH_ALL,
the caller must pass in use_overlay as false.

[0]: 5fea1eda36
2024-12-03 11:00:27 +11:00
Jesse Yurkovich
d0eff5f665 Cleanup: IO Common: Use clog and fmtlib instead of streams
Use CLOG for warnings and fmtlib for developer output and string
formatting rather than the heavy `<stringstream>` machinery.

Pull Request: https://projects.blender.org/blender/blender/pulls/131126
2024-12-03 00:24:01 +01:00
Clément Foucault
000f1cfa64 DRW: Port Select engine to new draw manager
Includes no functional change.

Pull Request: https://projects.blender.org/blender/blender/pulls/130378
2024-12-02 23:20:29 +01:00
Bartosz Kosiorek
fc122a1a70 UI: Avoid redundancy with Adaptive Time Steps property name
Change "Use Adaptive Time Steps" to "Adaptive Time Steps" with a
description of "Automatically decide when to perform multiple
simulation steps per frame"

Pull Request: https://projects.blender.org/blender/blender/pulls/131170
2024-12-02 23:10:02 +01:00
Clément Foucault
c770b940ae GPU: GLSL C++ Stubs: Use extern variables for buffers and uniforms
Avoid false positive warning about division by zero.
2024-12-02 23:01:12 +01:00
Clément Foucault
e0989d5bd6 Cleanup: GPU: Address unused GLSL variables throughout the codebase 2024-12-02 23:01:12 +01:00
Clément Foucault
01f1e9a2c4 GPU: Silence most GLSL C++ compilation warnings 2024-12-02 23:01:12 +01:00
Harley Acheson
154ab16ee2 Fix #128419: Allow the Positioning of Centered Dialogs
Some popups are positioned centered in the window, like "Splash",
"About", and the large confirmations. But when you drag these to
a different location they will snap back when there is any window
interaction.  This PR allows you to move these popups and they will
stay in the new location.

Pull Request: https://projects.blender.org/blender/blender/pulls/129125
2024-12-02 22:01:05 +01:00