Allows to use regular constructor/destructors. And standard CPP data
like string, maps, etc.
Main is defined as non-movable and non-copyable for the time being.
The existing creating/deleting API is kept as-is, moving to direct
MEM_new/MEM_delete usages in the code is kept as a later cleanup commit.
The 'ListBase' of split-by-libraries Mains has been replaced by a VectorSet.
This is an unfortunate consequence of making Main a non-trivial C++
struct: it is no more guaranteed that next/prev pointers required for
ListBase remain immediately at the top of the struct anymore - and on
Windows they indeed don't.
So move to a more modern form of storage for split-by-libraries mains,
with a few other related changes to internal readfile code.
WARNING: This is quite a sensitive change, extensively tested locally
(including library-related changes across undos and redos, in complex
production scenes).
Pull Request: https://projects.blender.org/blender/blender/pulls/141086
When playing back render result a separate process is started for
playback. This process didn't call the GPU_context_frame_begin/end
functions resulting in post-poning destroying discarded resources until
the playback process was 'exited'.
Pull Request: https://projects.blender.org/blender/blender/pulls/141376
Previously, if a socket inside a panel has the same name prefix as the
panel name, the panel name will be removed from socket names when
displayed inside nodes, but this is not done when displaying them on the
modifier interface, which is too verbose visually. Now panel names are
removed from these property labels as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/140448
Check the polybuild gizmo is drawn before using it,
also account for it being empty (the cause of the crash), although this
shouldn't happen in practice.
Use `N_` for default labels in case value is invalid.
So no double translation.
Synchronize translation context with related property if exist.
So enum item translated like property with such enum.
Use nodes context for zone labels.
Pull Request: https://projects.blender.org/blender/blender/pulls/138393
Avoid overly long paths in the title bar using the `~` prefix.
Based on feedback from !141059 there is consensus on supporting this
on Linux, that PR also supports abbreviations on other systems but
platform maintainers had concerns (see PR for details).
Apply the functionality for generic Linux/Unix systems,
the functionality for other platforms can be evaluated separately.
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.
----
This is how the message looks like now:
<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">
Pull Request: https://projects.blender.org/blender/blender/pulls/140847
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.
----
This is how the message looks like now:
<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">
Pull Request: https://projects.blender.org/blender/blender/pulls/140847
Almost all uiLayout methods that creates sub-layouts returns a uiLayout
reference, API users must use the returned sub-layout to add items,
this prevents a accidental copy that could break Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/141051
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141349
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141349
The `CurvesGeometry::resize` function would not work properly when
passing a new size of zero.
1) The `CustomData_realloc` would allocate an array with zero size.
2) A new size of 1 is passed to `implicit_sharing::resize_trivial_array`
for the curve offsets when it should pass 0.
3) A value is written out-of-bounds to `curve_offsets`
This fixes the issues in the following ways:
1) `CustomData_realloc` now doesn't allocate any data when the new
size is 0 and sets the `layer->data` to `nullptr`.
2) When the new number of curves is 0, resize the `curve_offsets` to 0
not to 1. This also ensures that the data pointer is `nullptr`.
3) Make sure to only write the first and last curve offset when the
number of curves is greater than 0.
Pull Request: https://projects.blender.org/blender/blender/pulls/141333
The returned string was one byte too large, because it contained the null
terminator for string `IDProperty`. Noticed this when retrieving strings
parameters in an operator which are stored as id properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/141321
This replaces the Move/Link to Collection operator popup with a menu,
allowing this to be able to search collection to move and to expand
this menu from other menus.
This removes the expected memory leak of using the popup.
Move to Collection operator now uses `session_uid` to identify
target collection, this now allows to target a collection from another
scene, however, is not exposed throw UI)
Resolves#133772
Pull Request: https://projects.blender.org/blender/blender/pulls/140883
In the viewport, semi-transparent strokes could appear more yellowish.
This was because the `reveal_tx` uses the `GPU_R11F_G11F_B10F` format
(loosing precision in the blue channel).
Now using `GPU_RGB10_A2` for `reveal_tx` to fix the issue.
We don't need to change the format for the `color_tx`.
Pull Request: https://projects.blender.org/blender/blender/pulls/141335
The alpha channel wasn't properly handled when using "multiply" layer
blending.
The formula in `blend_mode_output` for `MODE_MULTIPLY` was first
multiplying the `color.a` by `opacity`, storing the result back into
`color` but then multiplying by `color.a` again.
Instead, multiply `color.a` and `color` by the `opacity` separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/141337
While drag toggle decorators, the button where drag started
still is active, so it can conflict with the button to add/remove
keyframe while dragging upward.
Use `UI_BUT_ACTIVE_OVERRIDE` flag since it has precedence in
`ui_context_button_active`.
Last tested to work in 2.83.
Ref !141317
We do not do any audio time stretching when doing time remapping.
As we also use the audio to keep track of time passed, we should always
pass the actual timestamp we are starting playback from.
The issue was that the old logic would try to undo time remapping on cfra.
However cfra is already correct and is not remapped. I'm guessing that
this changed at some point and we forgot to fix it up in the sound code.
Pull Request: https://projects.blender.org/blender/blender/pulls/141288
Detection of whether an object is in Edit mode can rely on checking its
obdata ID status (for meshes e.g.), which will falsly make remapping
code think it is remapping the obdata of an edited object.
Somewhat work around the issue by forcing such remapping for the time
being. On the long run, check should be updated to only rely on the
Object's status.
Follow up to #140668 that fixes the same issue when using multiple
windows & scenes. This is needed as the active tool can apply to
multiple scenes.
Ref !141260
The Make Links operator does not work with Extend Sockets and generally
do not respect the node's link function. This patch makes it such that
the operator will fallback to an Extend socket if all else fails,
connecting to the first available socket that is not already linked to
the target node.
The main motivation for supporting this is to allow rapid connections to
the File Output node from big nodes like the Render Layers and Image
nodes, which is typically a slow process for users.
Pull Request: https://projects.blender.org/blender/blender/pulls/141287
This was used by the legacy Grease Pencil system while using the draw
tool to quickly render a stroke buffer.
Nowadays, we don't use this buffer anymore and just rerender
the Grease Pencil object.
Changing the computation to be split in 2 steps (one for each matrix)
fixes the issue.
However, it seems this function is used in a lot of places which
I am not sure if this has the potential to slow down some other
operations. So I will simply add a precise version of the function
for now.
Pull Request: https://projects.blender.org/blender/blender/pulls/141327
This replaces uiItemMContents, uiItemDecoratorR* and
uiItemProgressIndicator API with uiLayout methods following
uiLayout refactors and the Python API.
`eButProgressType` is changed to a typed enum class
`blender::ui::ButProgressType`
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141189
If render settings resolution scale had lowered resolution, cached
images from render image/animation session could "stay around"
and be incorrectly used in the VSE preview area. Two cases I found are
fixed here:
- Intra-frame cache was not flushed upon actual final resolution
change,
- "Source images" for effect/scene strips were not removed when
requested resolution no longer matches their rendered resolution.
Pull Request: https://projects.blender.org/blender/blender/pulls/141297
This is extracted from #140967.
Previously, it was possible to sync a bundle/closure node based on what's linked.
However, it was not possible to detect if the syncing was possible or necessary
in the first place. Knowing this helps building UI features that inform the user
about outdated nodes.
The crash happens when hitting tab while using attribute search in the Geometry
Nodes modifier. This triggers some auto-completion code (which doesn't work here
currently, but that's potentially a separate problem). However, the
auto-completion code did not handle the case when the string that's
auto-completed does not have a maximum length, i.e. it is dynamic.
This patch adds some handling for the case when the auto-completed string
storage has a dynamic size.
Pull Request: https://projects.blender.org/blender/blender/pulls/141200
Adds NURBS weight, radius and tilt to Transform panel.
To avoid code duplication code is a bit refactored and `struct TransformMedian_GreasePencil` is removed.
Also GP case has a race condition in existing version. It is fixed using `std::atomic`.
Pull Request: https://projects.blender.org/blender/blender/pulls/141079