It's simple to skip some work when all the triangles will be rendered
in the UV editor (though theoretically the best option would be to
share the non-UV triangle index buffer in this case).
Avoid function call overhead, add consistency between BMesh
and Mesh, parallelize filling the data and calculating the selection,
and avoid over-allocation in the cases where not all triangles will
be rendered.
Pull Request: https://projects.blender.org/blender/blender/pulls/142880
VSE final image cache invalidation for the newly added effect
strip was invoked before the strip time range values were set,
effectively not invalidating anything.
Pull Request: https://projects.blender.org/blender/blender/pulls/142854
Previously if only Increment/Grid Snap Targets are selected, transform
tools will not allow adding snap targets, although if there are extra
snapping target type enabled, you are still able to add grid points as
new snap points anyways, thus remove the restriction.
Pull Request: https://projects.blender.org/blender/blender/pulls/139534
The behavior was changed by d3f84449ad.
It's unclear whether considering custom normals is the "correct"
behavior here. Intuitively it makes more sense to use the true normals
for solidify because the purpose is generally to create even offsets
from existing goemetry. It's also valuable to just restore the old
behavior. A hypothetical node-based solidify would probably provide the
option to customize the offset vector.
Pull Request: https://projects.blender.org/blender/blender/pulls/142892
The compositor crashes when a group node has an output that is connected
to the compositor output, but the group internally has no Group Output
node. That's because the derived node tree structure would return a null
origin socket for this case, but the null socket is not handled by the
code. To fix this, we assume the input socket in such cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/142944
The bmesh.ops.split operator could include deleted edges as the keys
for `boundary_map`.
Resolve by replacing deleted edges with so the same edge is used for
the key & value, needed so the boundary_map can access the entire
boundary, even when it's source edges have been deleted.
This extends the API for bundles in two main ways:
* Adds support for working with paths to reference nested bundles directly.
* Adds support for typed add/lookup, also taking into account implicit conversions.
Some unit tests have been added as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/142942
Use of `*.%s` in string formatting could cause the name to include
partial UTF8 sequences. While these were stripped before ID creation,
they would be set in operator properties which are expected to be UTF8.
Also remove redundant allocation.
The Python API wasn't accounting for structs name properties using
path sub-types, which allow non UTF8 byte sequences.
This meant accessing the SpaceFileBrowser.recent_folders collection
could cause unhandled exceptions because
FileBrowserFSMenuEntry.name uses the PROP_FILENAME sub-type.
Resolve by adding a wrapper around the RNA struct name lookup
that handles path properties properly.
Fixes#142735.
The original clamp patch in #134319 did not add any cases for retiming
key transformation code. A simple solution to the crash would be to
disable the behavior, but this PR opts to bring feature parity to
retiming keys too.
This means that header values are now more accurate, and snap lines do
not erroneously draw when retiming keys get clamped.
It also changes transition key transformation slightly, aligning the
direction of movement with the movement of the two keys. Before, moving
the mouse backwards would have the same effect, which was clunky and
unintuitive.
Pull Request: https://projects.blender.org/blender/blender/pulls/142809
Several changes to make node socket symbols more consistent across
the UI:
* Explicitly use the node editor's theme when looking up the outline
color for node sockets so they are consistent across editors.
* Use the proper socket drawing function in `widget_nodesocket`,
rather than relying on the "widget base" shader to draw a colored
circle
* `uiTemplateNodesocket` now also works in non-embossed layouts.
Pull Request: https://projects.blender.org/blender/blender/pulls/136612
The flags were converted with 96e549c092,
but the new values only used the new `Brush` level properties in
b472570875.
Additionally, the `CurveMapping` structs were not initialized inside
the various operations that depended on them, potentially leading to
a crash if custom curves are used.
This commit fixes what was missing from both previous commitsL
* Conversion of the HSV jitter values and their curves to the new
storage location.
* Correct initialization in relevant operators
Pull Request: https://projects.blender.org/blender/blender/pulls/142104
Quite a few flags in `Strip.flag` were used only at runtime; they were
temporarily set and then cleared thereafter. Move them to
`StripRuntime.flag` instead.
Most of the moves are trivial renames, with some old versioning code for
`SEQ_FLAG_DELETE` deleted. That code fixed a very uncommon edge-case bug
in 2.x which doesn't seem worthwhile to keep deprecated code around for.
Pull Request: https://projects.blender.org/blender/blender/pulls/142776
If screen areas are swapped between windows this can cause an ASAN
heap-use-after-free because of invalid screen->active_region pointer.
That pointer is quickly reassigned as mouse movement indicates the
active region, so just clear them for this operation.
Pull Request: https://projects.blender.org/blender/blender/pulls/142877
Previously, newly added Gaussian Blur effect did not blurring at all,
since blur sizes were set to zero. Make them default to 9 pixel size
blur, which is similar to the amount of blur the Glow effect does by
default.
Pull Request: https://projects.blender.org/blender/blender/pulls/142851
Make `expand_main` a local static function, there is no need for it to
be in the public API anymore.
(It was used in older, pre-'foreach-id' code, as a way to loop over ID
usages. This is no more relevant for quite some time now.)
Use a std::queue to store IDs to be expanded, instead of looping several
times over all IDs of the current library Main until all have been
expanded.
(Cleaner, and will become necessary in upcoming packed IDs change, where
IDs read/loaded from a same blendfile may end up in several different
Mains).
Pull Request: https://projects.blender.org/blender/blender/pulls/142878
No functional changes.
This deals with the TODO
`/* TODO(sergey): How to ensure this is a constexpr? */`
by just making it a `constexpr`.
The line in question was `square_f(0.000001f)`
so the constexpr is just `0.000001f * 0.000001f`
Pull Request: https://projects.blender.org/blender/blender/pulls/142872
The Join Selection operator can remove the original selected points, but
this often removes the wrong points. The reason is that the point ranges
are removed sequentially, and each removal changes the curve topology,
invalidating subsequent ranges. The solution is to combine the ranges
into a single index mask for each drawing before removing points, so
that each drawing is only modified in a single operation.
Pull Request: https://projects.blender.org/blender/blender/pulls/142834
This suppreses -Wnonnull compiler warnings that would previously appear
when trying to pass a nullptr title to this function.
Internally, this function passes its `title` argument to `WM_window_open()`,
which in turn passes it to `WM_window_title()`, which can take a nullptr
as a title, in which case the title is computed dynamically from the
window area name.
In #139438 we added three path template variables that get their values
from user-specified names:
- `scene_name`
- `camera_name`
- `node_name`
These names can contain characters that are illegal in filenames on some
systems, and also characters like "/" that would be interpreted as path
separators in a filepath. This can lead to unexpected outcomes.
For example, if a node's name is "Hue/Saturation" and the `{node_name}`
variable is used in a path, it would result in a "Hue" directory which
in turn contains a "Saturation" file. This is almost certainly not what
the user intended, because the slash in that name is not semantically
supposed to be a path separator.
This PR addresses this problem by splitting string variables into two
types: strings and filepaths. The contents of string variables are
sanitized to be valid filenames when substituted into a path template,
but the contents of filepath variables are left as-is.
Variables such as `blend_name`, `blend_dir`, etc. that actually
represent path components are then added as filepath variables, while
variables such as `scene_name` that represent plain strings without path
semantics are added as string variables.
Pull Request: https://projects.blender.org/blender/blender/pulls/142679
The commit `b3a5d03bd0` introduced a new draw option for cage gizmos to
draw corners. This was turned off by default to prevent it being
visible in circular 2d gizmos.
This fix turns the corner draw option back on explicitly. Note: The
relevant 2D gizmo already sets `ED_GIZMO_CAGE_XFORM_FLAG_SCALE`, so no
changes in transform options are required.
Pull Request: https://projects.blender.org/blender/blender/pulls/142840
Adding a custom node socket in a node group fails, because the socket
type no longer passes the poll function.
Socket type polling for generated enum items was changed in #138824:
The socket type enum is based on the position in the socket types list,
but regular sockets generate many subtypes that should not appear in the
enum. Therefore only the "base type" of the socket is used for the enum
entry. Custom sockets, however, do not have a base type and are used
directly. This broke because now any socket type without a base type
is always rejected.
Fixed by handling a missing base type as indicator that the socket type
should be used directly.
Pull Request: https://projects.blender.org/blender/blender/pulls/142816
When hovering on a matrix field socket, `get_field_type_name` can fail
because of missing `float4x4` case. Now it will properly return a
"Matrix Field" name.
Pull Request: https://projects.blender.org/blender/blender/pulls/142794
Now that multi-select works with shape key, support deleting selected
keyblocks. New function `shape_key_is_selected` being introduced that
returns true for selected/active shape keys
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141881
Crash popups were being displayed even when Blender was running in
background mode, causing the process to hang and blocking automated
workflows (e.g., render farms).
Therefore, disable the crash popup when running in background mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/142518