This was caused by the deinterleaved format being
incorrectly decoded by the `bind_attribute_as_ssbo`
function.
Accumulating the offset should be done for all attributes
and not only the one being used. Furthermore, this needs
to happen only once per attribute and not once per name.
Moving the offset computation out of the name loop
fixes the issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/136821
If render engines dont specify `RE_USE_PREVIEW` / `bl_use_preview`, they
wont pass the `ED_check_engine_supports_preview` test.
That is mostly meant to tell blender this engine is capable of
generating (Material) previews and if it isnt, they will skip generating
button previews in `icon_preview_startjob_all_sizes`.
There are already exceptions for type of IDs that can still generate
previews (think Asset previews for Objects or Actions), so the same
exception can be made for Images and Brushes as well (these previews
will just befulled from the Image buffer, that should not rely on the engine
whatsoever). We can also be permissive on Groups (they are treated
similar to Objects).
NOTE: this was reported for the Workbench engine, in another (future)
commit, we might even consider flagging that engine `RE_USE_PREVIEW` as
well (see comments in the PR)?
Pull Request: https://projects.blender.org/blender/blender/pulls/136824
This PR refactors the way how swapchains are used.
Allow scaling of the swapchain content to the actual resolution of the swapchain.
can reduce artefacts when resizing windows when supported.
When frame rate is to fast the previous implementation could use a semaphore
that were still in use, leading to unwanted stuttering on certain platforms. Waiting
when the rendering has finished (GHOST_Frame.submission_fence), before the
next image is acquired from the swap chain.
Mailbox has been disabled as it can calculate more frames then actually been
presented, leading to a lag and increased power usage on others.
Pull Request: https://projects.blender.org/blender/blender/pulls/136603
When making a minimized window larger Blender can have negative regions.
This leads to out of bound writes when blitting to the framebuffer.
Easy reproducable on NVIDIA/Windows.
Pull Request: https://projects.blender.org/blender/blender/pulls/136832
When debugging with gdb in vscode, the stuff I print when executing a script in
the text editor does not show up in the terminal. It does work when I flush
explicitly though using `print(..., flush=True)`. This is quite annoying.
The solution is to always flush `stdout` and `stderr` automatically when running
a script. This is done using the CPython API, as just using
`fflush(stdout/stderr)` did not solve the issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/136632
Also affected PDF export.
From 4.3 onwards, we were always exporting with a rect representing the
camera in screespace (just as drawn on the screen).
In 4.2, this was remapped to the camera resolution specified in the
Output Properties.
This also affected pixel aspect being ignored in 4.3.
To resolve, get both the render resolution and the camera rectangle in
screenspace and remap them accodingly.
Behavior when not in camera wasnt changed (this was the same in 4.3 and
4.2 in that it would take the framing rect of the object(s) in the
viewport as document size.
NOTE: this was already reported in #134309 (which ended up being closed
by a fix that wasnt really fixing the issue originally reported I think)
Pull Request: https://projects.blender.org/blender/blender/pulls/136770
Removes the playback handle from the synchronizer API and integrates it
into the device, removing the ISynchronizer interface completely.
This has been discussed in more detail in #126047 and its main purpose is to unify the handling of synchronizer events, especially seek which needed different logic for jack vs other backends.
OpenAL now needs a silence playback handle for synchronization but all
other backends are pretty straightforward just counting the mixed
samples in the SoftwareDevice with some specializations for specific
backends that had their own synchronizers before.
Note: CoreAudio changes are untested as I don't have a Mac.
Pull Request: https://projects.blender.org/blender/blender/pulls/133191
- Now snapping supports both location & rotation, rename variables and
arguments to clarify which they apply to.
- Remove references to in variable names "cursor",
a hangover from when this has hard-coded to use the 3D cursor.
Also use blender::float3 in more places.
Adds an operator setting to allow matching the rotation of the snapped
object to the rotation of the 3d cursor.
When the operators "Rotation" option is enabled, it will rotate selected
objects to match the current rotation of the 3d cursor.
Rotation modes and axis locking are respected.
If multiple objects are selected, they will all be set to the rotation
of the 3d cursor. There's an opportunity for future work on this for
the case where "offset" is toggled on as well, so that the location and
rotation of offset objects would be determined by rotating around the
pivot point.
Addresses #134863.
Ref: !134963
Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.
This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.
Ref !136759
MacOS generally uses mouse cursors we specifically made for that
platform. But in some cases, like WM_CURSOR_WAIT, the OS does not have
an equivalent and we don't have a platform-specific one. So it then
uses of of our base custom cursors. This type of cursor is always
enlarged on Mac high-DPI displays like Retina. So no need to ever
supply larger versions of this type of cursor as it will just get
huge.
Pull Request: https://projects.blender.org/blender/blender/pulls/136005
Neighboring areas can have right-aligned and left-aligned scroll bars
that doesn't leave room for area resizing. This PR carefully reduces
the scroll bar zone size at the area edge. To ensure that the behavior
you get matches the mouse cursor you see, this corrects an error that
we were not setting cursor when transitioning from area border to
scroll bars.
Pull Request: https://projects.blender.org/blender/blender/pulls/136794
Add icons to the rna enum definitions for socket types so they
are displayed in all socket type selection lists like the ones on the
various loop zones.
These places were missed, when the socket icons were added in
commit 821e0024d4.
Pull Request: https://projects.blender.org/blender/blender/pulls/136707
Before #136334 hovering over a zone used to open closed regions, we
would show left/right or up/down directional arrow cursors. That PR
replaced those with chevron cursors that point in the specific
direction the region would open. That change has caused some confusion
so this PR restores those old cursors.
Pull Request: https://projects.blender.org/blender/blender/pulls/136583
This happened because the viewport was drawn after
the UV editor when some update occur (e.g. canceling an
operator). The requested UV edit batch would require only
one specific UV channel. The viewport, in need of a different
UV channel, requested a VBO rebuild (freing the old UV VBO)
but did not correctly clear the UV batches that were referencing
the said VBO. This lead to use after free which would sometime
works because the same memory would be reused for a random new
batch.
Pull Request: https://projects.blender.org/blender/blender/pulls/136780
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemInternalFlag` and moved to the `blender::ui`
namespace. `uiItemInternalFlag` is preserved as a shorthand for
`blender::ui::ItemInternalFlag`.
No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/136782
I get a warning in a bunch of places where `library_ensure_catalogs_in_path` is
called. This is a known false positive of GCC. To workaround the warning, the
`AssetCatalogPath` can be constructed in a separate statement to avoid
implicitly constructing it as temporary value when calling
`library_ensure_catalogs_in_path`.
Pull Request: https://projects.blender.org/blender/blender/pulls/136762
Render Overlay Meshes after the Grid.
As a side effect, in-front wireframe objects are now displayed behind
non-in-front edit mode overlays.
Co-authored-by: Clément Foucault
Pull Request: https://projects.blender.org/blender/blender/pulls/136764
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemType` and moved to the `blender::ui` namespace.
`uiItemType` is preserved as a shorthand for `blender::ui::ItemType`.
No user visible changes expected, layout introspection will still print
item types using property enum identifier format.
Pull Request: https://projects.blender.org/blender/blender/pulls/136740
Different areas of this code were using different checks for whether a
specific curve combination has caps or not. Extract the check to a separate
function to avoid that problem.
Fix an issue where copy-paste of keyframes was broken when action groups
are collapsed. It was caused by the `ANIMFILTER_LIST_VISIBLE` filter
flag; removing it (as it was before the bug-introducing commit) resolved
the problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/136768
This is done because the library is necessary to make certain FFTW
functions thread safe, see #136557 as well.
Also pass each library variable separately to
`find_package_handle_standard_args` instead of as a list, as otherwise
it won't correctly detect if `libfftw3f` or `libfftw3f_threads` is
missing. This is because CMake considers a value false if it contains
`-NOTFOUND` at the end, but not if it's in the middle. For example,
CMake considers
`.../libfftw3f.a;.../libfftw3f_threads.a;FFTW3_LIBRARY_D-NOTFOUND` to be
false, but
`.../libfftw3f.a;FFTW3_LIBRARY_THREADS_F-NOTFOUND;.../libfftw3.a` to be
true.
---
I noticed that some other find modules also have the same list issue. I guess it was done this way to make CMake print all the found libraries instead of only the first.
Pull Request: https://projects.blender.org/blender/blender/pulls/136692
Due to !133498 layers containing incorrect material indices could lead to generating
to many GPU resources crashing Blender. As there is a maximum number of material slots
we can limit it.
This is just a safeguard for incorrect values in material_index attribute layer. Working with
this material index attributes should automatically limit, but I leave that to the modeling
module.
Pull Request: https://projects.blender.org/blender/blender/pulls/136302
This was only working if one had `+ Non-Grouped Keyframes` enabled.So
code wasnt finding the bone name in the groups of the Action.That in
turn was caused by the fact that `animviz_calc_motionpaths` solely uses
`BKE_action_group_find_name` [which is documented to support only legacy
Actions].
To resolve, check if the action is legacy, otherwise get the
`Channelbag` and use its `channel_group_find`
Pull Request: https://projects.blender.org/blender/blender/pulls/136757
After reviewing the locations where `GPU_flush()` are used it doesn't seem
to be harmfull to include these for the Vulkan backend as well. Hopefully
will save some lag that can happen when submitting one huge render graph.
Improved playback of rain_restaurant.blend where frames could be dropped
resulting into UI lag.
Pull Request: https://projects.blender.org/blender/blender/pulls/136654
In light of recent changes by Jeroen, #124515 seems to have been resolved properly, rather then using this workaround.
This also sidesteps the issue seen in #136633 which only happens when GPU sibdiv is disabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/136678