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
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
`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
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
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.
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
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
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
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#131092Fixes#130793
Pull Request: https://projects.blender.org/blender/blender/pulls/131143
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
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.
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
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
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.
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
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
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
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
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
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
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