Commit Graph

115413 Commits

Author SHA1 Message Date
Falk David
e5bdfd533b Grease Pencil: Save Layer Group expanded state
Grease Pencil layer groups are drawn in the layer tree using
`AbstractTreeViewItem`. The problem is that the items can't
store their expand/collapse state. This meant that switching
e.g. the tabs in the properties editor would reset the collapsed
state of layer group items.

This PR uses the `GP_LAYER_TREE_NODE_EXPANDED` flag to store
the expand/collapse state. The tree view then reads from the flag to
expand/collapse the items.

This also adds an RNA property to layer groups `is_expanded`.
Allows to check from python if a group is expanded in the UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/131159
2024-12-02 11:48:42 +01:00
Jeroen Bakker
796959c205 Cleanup: ImageEngine: Code-style (enum casing) 2024-12-02 11:25:32 +01:00
Jeroen Bakker
e0a0bdcf01 Cleanup: Make format 2024-12-02 11:18:52 +01:00
Jeroen Bakker
3351a6e94e Cleanup: Image engine: Use ShaderModule
Replace old C-Style API with a ShaderModule class for managing shader lifetimes

Pull Request: https://projects.blender.org/blender/blender/pulls/131229
2024-12-02 11:04:32 +01:00
Jeroen Bakker
e93ea62d2b Cleanup: ImageEngine: Shader interface naming
Pull Request: https://projects.blender.org/blender/blender/pulls/131228
2024-12-02 11:03:04 +01:00
Richard Antalik
618b7f4a9b Fix #130742 Scene render from VSE is taking twice as long
Regression caused by 5ecb70964e. This is, because renders of individual
strips could no longer be reused when cache is completely disabled
during rendering.

Instead of disabling cache completely, flag cache entries as temporary.
When reading entries also skip disk cache, since in 5ecb70964e goal was
to avoid reading from disk cache.

5ecb70964e also affected visual output of rendered image. This is
reported in #131106. Because of this 1 test must be updated.

Root cause for #131106 is, that byte image was automatically converted
to float, due to processing with other float image. Then the same byte
image was used for processing with another byte image. Before
5ecb70964e this byte converted to float image would be cached, which
caused float code paths to be used. This is correct behavior.
After 5ecb70964e, no image is cached, so float data were not saved, so
byte code path was executed in second processing step.

Pull Request: https://projects.blender.org/blender/blender/pulls/130781
2024-12-02 10:07:08 +01:00
Jeroen Bakker
33fd027dc5 Cleanup: Remove unused attribute 2024-12-02 08:29:46 +01:00
Germano Cavalcante
99e54df9f5 Fix #131215: Snap to Grid not working in x-ray
Caused by commit b4154c6a0e, which incorrectly removed the
`(snap_to_flag & SCE_SNAP_TO_GRID)` condition.
2024-12-01 23:22:03 -03:00
Pratik Borhade
74f212fae2 Fix #130922: GN: Hide empty panel in modifier UI
`interace_panel_has_socket` should return true when panel has
at least a socket of type input or hidden in modifier. That way, panel
drawing code won't be executed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130958
2024-12-01 07:37:06 +01:00
Pratik Borhade
6678b0acfb Fix #130813: Grease Pencil: Skip stabilize stroke line drawing when cursor is hidden
When cursor is disabled, exit early from the cursor draw function of
stabilize stroke to skip drawing of "smooth line".

Pull Request: https://projects.blender.org/blender/blender/pulls/130884
2024-12-01 07:34:23 +01:00
Clément Foucault
b0c0c2708d Refactor: Grease Pencil: Port rendering to new draw manager
Pull Request: https://projects.blender.org/blender/blender/pulls/130337
2024-11-30 22:42:43 +01:00
Clément Foucault
e44ae763bc GPU: GLSL C++ Stubs: Add minor missing features 2024-11-30 10:20:37 +01:00
Jesse Yurkovich
1868ae9366 Fix: IO: wrong ObjectIdentifier used when trying to determine parent status
The wrong ObjectIdentifier was used when trying to see if the object is
a parent to something else in the export graph. This lead to accessing
an invalid iterator which will assert with MSVC in Debug configurations.

Accidentally regressed during the review of 428ab699dc.

Pull Request: https://projects.blender.org/blender/blender/pulls/131174
2024-11-30 04:14:19 +01:00
Clément Foucault
7371bde40b Cleanup: Selection: Adress warning 2024-11-29 21:36:41 +01:00
Clément Foucault
bda911bcaa GPU: GLSL C++ Stub: Add packed type and small types 2024-11-29 21:33:06 +01:00
Clément Foucault
67bf545b61 Fix: Overlay-Next: Missing selection binding for object centers 2024-11-29 18:46:17 +01:00
Clément Foucault
54be7ed322 Fix: Overlay-Next: Broken selection on first click
This was caused by querying on the selection state
before it is setup. It is only setup just before
the draw function.

To fix this, we sync the `info_buf` just before
drawing the overlays.

Also add some safety to avoid uninitialized memory.
2024-11-29 18:46:17 +01:00
Aras Pranckevicius
f1664e1777 Fix #131097: Color space settings of >8bpp movie images do not work
With exception of Sequencer, everywhere else in Blender it is assumed
that float images are in linear color space.

Movie files with more than 8 bit/channel precision are now loaded into
float images (since 39c4c7cf3f), but the "load and use them as an
image" code path was not making sure that they are converted to linear
color space.

Pull Request: https://projects.blender.org/blender/blender/pulls/131141
2024-11-29 17:25:57 +01:00
Sybren A. Stüvel
eaf596c49c Refactor: BLI: Add MutableSpan::contains() function
Add `bool MutableSpan<T>::contains(const T &value)` function, which is an
exact copy of the function from the `Span<T>` class. This makes it possible
to call `.contains()` directly on the `MutableSpan`, instead of having to
call `.as_span()` first.

Note that the `contains_ptr()` function was already copied from `Span` to
`MutableSpan` before.

No functional changes to the affected code, just the removal of the now
no longer necessary `.to_span()` call.

Pull Request: https://projects.blender.org/blender/blender/pulls/131149
2024-11-29 16:28:56 +01:00
Miguel Pozo
8504c12fa9 Fix #130776: OpenGL: Use explicit uniform locations
Ensure uniform locations are the same across specialization constants
shader variations.

Pull Request: https://projects.blender.org/blender/blender/pulls/131116
2024-11-29 15:47:51 +01:00
Jeroen Bakker
9a4b232bd5 Cleanup: Image Engine
Before we start porting image engine to the new drawing manager
we should do some cleanups.

- Use similar namespace as other draw engines (`blender::image_engine`)
- Switched InstanceData and Instance
- Reduce parameters as drawing mode can access Instance.
- Remove some templates to improve readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/131146
2024-11-29 15:46:44 +01:00
Philipp Oeser
e104735eeb Fix: Grease Pencil: issues with the transform keyframes system
Oversight in 09d2108bf5

For one, numinput for keyframes would be broken unless the mouse is moved first.
Secondly, redo would also be broken (using the `Adjust Last Operation` panel or the `Repeat Last` operator).

Above commit did a check for `TRANS_RUNNING` before calling `grease_pencil_layer_update_trans_data`.
This isnt set in any of the above scenarios (it only gets set once the moues moves).

This PR removes `TRANS_RUNNING` check to have proper calls to `grease_pencil_layer_update_trans_data`.
It has one downside: you now get a `grease_pencil_layer_update_trans_data` as soon as you hit `G`.
So it does remove_frame / add_frame unnecessarily (since we are still on the same frame), but only once, sees harmless in comparison to the two regression it fixes.

Fixes #131092
Fixes #130793

Pull Request: https://projects.blender.org/blender/blender/pulls/131143
2024-11-29 15:40:51 +01:00
Omar Emara
4eb1b78d82 Fix: Compositor: Compile error with WITH_FFTW3 off 2024-11-29 15:23:49 +02:00
Omar Emara
b71338ba8d Compositor: Implement Glare node for new CPU compositor
Reference #125968.
2024-11-29 15:04:40 +02:00
Clément Foucault
7a73741157 Fix #131133: GPU: Navigation Gizmo sometimes doesn't display the axis lines
Alignment was incorrect if vertex format stride was bigger than
SSBO required alignment.
2024-11-29 12:50:52 +01:00
Guillermo Venegas
7f7f9e987f Fix #130817: Make resource pool to cycle when swapchain images are presented
Its not standard how `Present Engines` return images for presentation, and
currently is expected that they cycle between swap-chain images with each
`vkAcquireNextImageKHR` call.

However present engines could return any available image, that can mean
to reuse the last presented one if available. (This seem to be the behavior
using `Layered on DXGI Swapchain` the default `Present Method` used
with latest NVIDIA drivers on Windows).

Since resource pools expects to images to cycle in a sequential order, if any
present engine always return the same image for presentation only a single
resource pool would be used for each rendered frame, and since resources
are only released by cycling between resource pools, this resource pool would
overflow since it never releases any resource.

This changes makes resource pools to cycle each time a image is presented.

Pull Request: https://projects.blender.org/blender/blender/pulls/131129
2024-11-29 12:35:44 +01:00
Clément Foucault
4441987e05 Fix #131131: Overlay Next: Clip view crashes Blender
Was simply a missing access to global uniform.
2024-11-29 12:12:53 +01:00
Clément Foucault
6332be9700 GPU: C++ GLSL Stubs: Use unions instead of inheritance for swizzle
This avoid stack overflow on GCC because types were getting too
large (70 bytes for a float4) and created a lot of static
memory for UBOs declarations.
2024-11-29 12:00:01 +01:00
Jeroen Bakker
f5d9f65925 Fix: Overlay: Assert during bone selection in pose mode
Detected when testing `ellie_animation.blend`. When trying to select
bones the select_id_map is empty and would do an invalid resize of
the output buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/131140
2024-11-29 11:28:04 +01:00
Clément Foucault
95233986cb GPU: C++ GLSL Stubs: Add atomic sampler 2024-11-29 10:19:23 +01:00
Jeroen Bakker
71ec30fce9 Fix #131135: Vulkan: Crash closing window
When a main window contains a child window and the main window is closed
it can crash as the context isn't available when destructing the
VKFramebuffer of the child window.

Pull Request: https://projects.blender.org/blender/blender/pulls/131137
2024-11-29 09:11:13 +01:00
Jeroen Bakker
61d4f7359b Fix: Vulkan: Compiling issue
PR for colored debug groups didn't had the latest changes of main
2024-11-29 08:16:13 +01:00
Jiarui-Yan
b356c2bec1 Vulkan: Colored debug groups
This PR adds color to debug group so that RenderDoc can give color to different
debug groups and sub-groups in the parent debug group.

Ref: #124099

Pull Request: https://projects.blender.org/blender/blender/pulls/129340
2024-11-29 07:52:00 +01:00
YimingWu
73b7e8e256 Fix #131049: Line Art: Prevent stroke generation in locked target layer
Line art will not be able to insert any drawings into a locked target
layer, this fix prevent such situation from crashing Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/131073
2024-11-29 06:08:19 +01:00
Clément Foucault
c1bc1ef3ea GPU: C++ GLSL Stubs: Fix isinf / isnan 2024-11-29 00:37:45 +01:00
Clément Foucault
b39843e7b0 GPU: Use extern for non static expressions and use non zero value for gl_WorkGroupSize
Pull Request: https://projects.blender.org/blender/blender/pulls/131064
2024-11-28 23:23:30 +01:00
Clément Foucault
dd480ab604 GPU: Refactor the GLSL C++ stub swizzle implementation
This removes support for nested swizzling but avoid
warning about static member accesses through class
instance.
2024-11-28 23:23:27 +01:00
Harley Acheson
47492c7aa6 Fix #130385: Use Only Advance When Measuring Mono Text
When measuring text strings we consider both the advance and the glyph
bounding box. But monospaced text should only use the advance because
many fonts allow some mono characters to slightly overflow. This just
removes bounding box from the calculation of width for mono text.

Pull Request: https://projects.blender.org/blender/blender/pulls/131114
2024-11-28 20:14:59 +01:00
Clément Foucault
5982b5e75c Fix #130751: Overlay Next: Selected Outline highlight vanishes when face orientation enabled
Was caused by different drawing order. Use the legacy drawing order
until we find a better fix.

The better fix would be to render outline with depth.
2024-11-28 19:16:37 +01:00
Clément Foucault
5e97b5adc2 Sequencer: Use uchar4 colors for drawing quad buffer again
This partially revert the changes from
909b74e91f
2024-11-28 18:30:28 +01:00
Clément Foucault
5954898edf GPU: Add back support for uchar4 color when using widelines
This is still pretty useful as the data savings is not negligeable.

Also supports it for python.
2024-11-28 18:28:08 +01:00
Clément Foucault
ec84fe5fdb Fix #131091: GL: Weird Lines appearing in Gizmo Overlays
This happened because NVidia GPUs require higher alignment
for SSBO binds than for vertex inputs.

This is related to	#131103 which fixed it for vulkan.

Add a common capability option for that.
2024-11-28 17:22:12 +01:00
YimingWu
8fb12839f2 Grease Pencil: Add all supported modes to simplify operator
The stroke simplify operator was implemented at the beginning of GPv3
migration, which means it lacked a few other modes. This fix reused the
same code as in the simplify modifier to provide more simplify modes
back to the modifier so it can work just like GPv2.

Resolves #130616.

Pull Request: https://projects.blender.org/blender/blender/pulls/131076
2024-11-28 17:00:05 +01:00
Lukas Tönne
d8182421fa Fix #130635: Fill tool stroke projection incorrect in ortho mode
There are two bugs here:

1. Projection of mouse cursor into "image space" for starting a flood fill was
first trying to convert region coordinate to image coordinate, which was broken
for ortho mode. This isn't actually needed since the only purpose of the image
coordinate is to convert to layer space immediately. We can simplify by
computing layer space mouse cursor, _before modifying the region matrices_.

2. Projection of boundary pixels from image space to stroke positions in layer
space also has an offset. This is a bug in `ED_view3d_win_to_3d` which uses the
`viewinv` translation vector instead of the `persinv` translation. This only
works when the rendered region is symmetric around the view direction. This is
not the case when rendering flood fill images, which are shifted to make better
use of available pixel space. The `persinv` translation contains the region
shift. A new function has been added, rather than changing `ED_view3d_win_to_3d`
because many operators rely on the broken behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/130918
2024-11-28 16:38:17 +01:00
Jeroen Bakker
8e4502258a Fix: Vulkan: Misalignment sub-buffers immediate drawing
Since recently we bind immediate sub buffers as storage buffers to
extend the geometry for line drawing. We didn't add alignment checks and
that raised warnings. This change will fix those warnings.

Pull Request: https://projects.blender.org/blender/blender/pulls/131103
2024-11-28 16:31:58 +01:00
Christoph Lendenfeld
e52cb5e24b Fix #131045: Wrong UI range for edit bone head and tail
The issues was simply that the UI range for the RNA
property was set to 0. Fixed by setting to `-FLT_MAX`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131099
2024-11-28 16:20:02 +01:00
Jeroen Bakker
c69b107a28 Fix #130121: Vulkan: Lightbaking resources freed to early
When lighting baking is used in a background render the resources are
freed to early. The cause is that light baking does some initialization
within a context, that isn't send to the GPU. The first iteration of
light baking is expecting that it can free resources, what leads to GPU
resources to be deleted that are still used by commands that are
scheduled to be send to the GPU.

This PR fixes this by using multiple resource pools when background
rendering and ensure that contexts are send to the GPU when rendering
ends.

Pull Request: https://projects.blender.org/blender/blender/pulls/131094
2024-11-28 16:05:59 +01:00
Jeroen Bakker
deff994123 Vulkan: Add support for GPU_logic_op_xor_set
Add support for Logic op XOR. This is used in image editors and tracking
editor. Logic ops is required on Linux and Windows, however for macOS it
will be disabled when using MoltenVK. MoltenVK has can be compiled with
support for logic ops, but that isn't the default as it relies on
private APIs.

When the workaround is enabled it will create artifacts when used.

Ref: #130347

Pull Request: https://projects.blender.org/blender/blender/pulls/131089
2024-11-28 15:12:13 +01:00
Clément Foucault
909b74e91f Fix: GPU: Assert due to new GPU requirements regarding wide lines
The formats was not using the correct attribute type.

Fixes assert in graph drawing and potential assert in cursor drawing
Fixes assert in sequencer and file browser
2024-11-28 12:42:17 +01:00
Raphael Langerhorst
f662caf722 Add RISCV CPU architecture support to build config
Remove assert statement from make_update.py, making it ready for any
architecture.

Add riscv 32, 64 and 128 bit cpu architecture with little/big endian
to Blender's BLI_build_config.h and Libmv's build_config.h

Tested (to compile) on riscv64 little endian machine.

Pull Request: https://projects.blender.org/blender/blender/pulls/130920
2024-11-28 12:37:26 +01:00