Resolve regression in [0] which would mirror unselected faces.
Only copy UVs between mirror faces that are fully selected,
so unselected faces are left untouched. Vertex mapping also now uses
add_overwrite() to keep the last vertex at duplicate positions for a
more reliable mirroring.
Ref !147405
[0]: 919acbbf7f
Fixes incorrect color for dragged links, likely a regression from #145238.
The fix is to pass `TH_WIRE_INNER` to `nodelink_get_draw_config`. This results
in a color ID of 2 from `nodelink_get_color_id`, which satisfies the
`color_ids[0] < 3u` check in the `gpu_shader_2D_nodelink_vert.glsl`.
Pull Request: https://projects.blender.org/blender/blender/pulls/147462
This PR changes the current behavior that closes menus that are open
when your mouse is moved out of its "safe" area (a bit wider than its
visible bounds). With this PR applied menus stay open unless you click
elsewhere, hover a neighboring menu, press escape, or select an item.
Although this PR turns off menu mouse leave, it also adds a preference
that can be used to turn it back on.
Pull Request: https://projects.blender.org/blender/blender/pulls/145523
Selecting "Wide Lines" has always made the playhead vertical line
thicker. But with #145081 the line is an odd width, so when at 1X scale
it is three pixels instead of two with default lines, five pixels
instead four with wide line lines. But that one pixel isn't a big
deal, it is that the SHADOW around the line is now calculated based on
the line width when it used to be based on ui scale. This means at
1X scale and wide lines the shadow is two pixels when it used to
be just one. This PR goes back to the old shadow width calculation
which makes the overall obscuring width 2 pixels narrower at 1x wide.
Pull Request: https://projects.blender.org/blender/blender/pulls/147467
Use the custom color even when nodes are muted, to keep them more
recognizable.
The muted state is still indicated by mixing in the background color
and making the node transparent.
Additionally this makes small tweaks so the header colors of muted
nodes are the same between the collapsed and uncollapsed state.
Pull Request: https://projects.blender.org/blender/blender/pulls/147349
This PR gives access to OpenVDB's level set filtering operations
through individual **SDF Grid** nodes.
- **Mean Curvature**: Smoothens high curvature areas more than flatter
ones.
- **Laplacian**: Approximates mean curvature flow for true SDFs at lower
computational cost.
- **Median**: Reduces noise while preserving sharp features.
- **Mean**: Fast separable averaging filter for general-purpose
smoothing with linear computational complexity.
- **Offset**: Uniform dilation/erosion operation that shifts the SDF
surface by a world-space distance.
- **Fillet**: Rounds off concave internal corners by operating only on
regions with negative principal curvature.
Pull Request: https://projects.blender.org/blender/blender/pulls/147224
Add a function `bpy.data.file_path_foreach()` with a callback function
`visit_path_fn`:
```py
def visit_path_fn(
owner_id: bpy.types.ID,
file_path: str,
_meta: typing.Any,
) -> str | None:
return file_path.replace('xxx', 'yyy') or None
bpy.data.file_path_foreach(
visit_path_fn,
*,
subset=None,
visit_types=None,
flags={},
)
```
When the function returns `None`, nothing happens. When it returns a
string, the reported file path is replaced with the returned string.
`subset` and `visit_types` have the same meaning as `subset` resp.
`key_types` in `bpy.data.file_path_map()`. Since the latter parameter
doesn't affect keys in a map, but rather the visited ID types, I named
it `visit_types` instead.
`flags` wraps most of `eBPathForeachFlag` as `set[str]`, with their
prefixes removed. `BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN` becomes
`RESOLVE_TOKEN`, etc. `BKE_BPATH_FOREACH_PATH_ABSOLUTE` is excluded,
as it only affects a field in the C++ callback structure that is not
passed to Python at all. If it turns out to be useful at some point,
we can always add it.
`_meta` is for future use, and is intended to give metadata of the
path (like whether it's an input or an output path, a single file or
the first file in a sequence, supports variables, etc.). By adding
this to the API now, we avoid a breaking change when this feature is
actually implemented.
Design task: #145734
Pull Request: https://projects.blender.org/blender/blender/pulls/146261
Fixed the two most obvious entry points (actually making a linked ID
local, and making a local copy of linked data), there may be more
unusual ways to do that still hidden in the code though.
Also added a couple of 'sanity asserts' to the writefile code regarding
cases where IDs are expected to have a null deep_hash data.
This showed an error while it actually worked as expected. The issue was that it
attempted to pack the entires named `.` and `..`, which have special meaning.
Filtering those out quiets the error message.
Pull Request: https://projects.blender.org/blender/blender/pulls/147455
Using a strip mask in a compositor strip modifier causes other strips to
change in color. This is because the code converted the mask image
buffer in place, which affected its other uses. To fix this, convert the
mask out of the place.
Pull Request: https://projects.blender.org/blender/blender/pulls/147446
It's a common mistake that people want to use the viewer node while the
modifier is disabled and wondering why it doesn't work. This patch adds a
warning that helps users diagnose the issue immediately.
Pull Request: https://projects.blender.org/blender/blender/pulls/147443
The function name `for_each_callback` is ambigous (what are we iterating?)
and also doesn't align with the naming of other "for each" functions in Blender
which usually are named `foreach_<thing>` like `IndexMask::foreach_index`
or `animrig::foreach_fcurve_in_action` etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/147440
Any keyframes for properties inside the compositor node
trees that were used by strips did not show up in the dopesheet.
This was because the compositor tree is its own ID and needs to
be manually added by the dopesheet code.
This fix adds the node trees to the filtering code in
`animdata_filter_dopesheet_scene`.
Note that the dopesheet still uses the active scene as its context.
So this means that if the sequencer scene differes from the active
scene, the animation data from the sequencer scene will not
be shown. This is currently expected behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/147301
Qualcomm driver team found an issue how Blender uses dynamic rendering.
The issue is that between suspend/resume of rendering only a limited
commands are possible. However we add commands that shouldn't be added
there. It is a violation of the Vulkan spec
VUID-VkSubmitInfo-pCommandBuffers-06015
It went unnoticed as it is mere a single line in the 5000+pages spec
and wasn't covered by the validation layers. This has been reported
upstream.
To fix this issue we remove the usage of suspending/resuming render
passes and fix any issue that used this together with clearops. Most
likely the fix will require a second dynamic rendering pass when
clearops are used.
Pull Request: https://projects.blender.org/blender/blender/pulls/147425
This happened if proportional editing was enabled in editmode, not
having an active object plus being in object mode.
The transform system `convert_type_get` assumes
`TransConvertType_Object` if we dont have an active view layer object.
Corresponding code for proportional editing detection [in
`initTransInfo` & `saveTransform`] wasnt though (it used `toolsettings`
`proportional_edit` -- not `proportional_objects` -- in that case).
This is now corrected.
Probably caused by e91d581167
Pull Request: https://projects.blender.org/blender/blender/pulls/147193
This adds a new `PropertyRNA::name_func` property which is similar to the many
existing functions like `editable`, `get_default`, etc. It allows dynamically
getting a UI name for the property.
This is especially useful for node sockets, because those all have the same
hardcoded name "Default Value" which is not helpful. Since we already have
custom tooltips for sockets, this is mostly not visible to the user anymore. The
exception being menu sockets which draw the property name as title. Instead of
"Default Value", this patch makes it show the correct title.
Pull Request: https://projects.blender.org/blender/blender/pulls/147137
Spawning the tooltip or changing values would cause this.
Error in 28827b62f7
Above commit only considered PointCaches associated with **objects**,
not taking into account scene rigid body cache.
This is now added with this PR.
Previously it would cast into modifiers when we actually had a scene as
owner... resulting in a crash.
This was only exposed by 6bf8685628 (it crashes since, was just not
working properly before...). 6bf8685628 changed the data layout of
`struct Object` and only by pure luck the modifiers loop was skipped, now
with the new layout it is entered (but with garbage data resulting in the crash.
Pull Request: https://projects.blender.org/blender/blender/pulls/146577
If we detect an unsupported point instancing setup, do not attempt to
still export it out. Depending on the number of instances this can spew
10's of thousands of USD warning traces to the console.
Pull Request: https://projects.blender.org/blender/blender/pulls/147253
When all vertex groups are *unlocked* and the Normalize All operator is
run with "Lock Active" disabled, the operator would fail with the
patently false error message "All groups are locked".
The cause was that:
1. When all vertex groups are unlocked, the lock flags array used
internally would be left empty, with the idea that a non-existent
flag indicates "unlocked".
2. The code that determined if all groups were locked was checking
if any of those flags were "unlocked".
3. In an empty array, of course no items are "unlocked", and thus
it would think all items are locked.
The fix in this PR is to also check if the flag array is empty when
determining if all groups are locked.
Pull Request: https://projects.blender.org/blender/blender/pulls/147272
The `INSERTKEY_XYZ_TO_RGB` flag on `datablock.keyframe_insert()` in
Blender's Python API was changed to do nothing in #115297 and #119625,
in favor of determining fcurve coloring exclusively from user preferences.
This PR removes that now-useless `INSERTKEY_XYZ_TO_RGB` flag entirely.
Pull Request: https://projects.blender.org/blender/blender/pulls/147262
When there was no other data written in the CustomData for edges
or faces, the layers pointer would be null, and even though the layer
array we write isn't empty, the writing would be skipped. The fix
is just to make sure the layer pointer isn't null.
Pull Request: https://projects.blender.org/blender/blender/pulls/147411
Based on the Python API for UV selection (!138197),
some methods that set the selection need a flush down argument too,
name the argument more clearly so the same name can be used by
all selection functions.
Enabling the normal parameter in the randomize operator triggered a
debug assert, since BKE_object_get_editmesh_eval_cage() was called on
the original object.
Resolved by retrieving the evaluated object from the depsgraph.
Ref !146608
This was caused by a stack-use-after-free due to passing a lambda directly
into a `FunctionRef` that keeps a reference to it. This only happened for
me in an asan build, but not in a release/debug build.
This extracts the construction of the `SocketValueInferencer` out of
`SocketUsageInferencer`. This leads to better separation of concerns and gives
the caller more flexibility. In the future, I especially want to get information
about which group input values were required to determine the usage of other
group inputs. This might help with caching the inferenced values.
Pull Request: https://projects.blender.org/blender/blender/pulls/147352
Support optionally flushing down:
- faces -> edges & verts.
- edges -> verts.
For C++ selection logic flushing down is avoided as it's an extra step
and instead, selection logic must take care to de-select edges/faces
before selection, so any shared vertices or edges are selected.
Flushing down means scripts can set the selection on faces or edges,
then flush this to all other elements without being concerned with
the order they have been set.
Ref !147351
This item is usually more annoying than useful. If one doesn't need it, one has
to go to the side bar to remove it or change its type. Creating the input is as
easy as just connecting a link or using link-drag-search.
Color grids are not supported yet, but vector grids are. Previously, trying to
link a color socket to the Grid to Field node just didn't work because it
doesn't support color sockets. Now, it will create a vector socket instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/147343
The placeholder text of this property already says "Object", so the label saying
the same thing is quite redundant. It usually takes up extra space and cuts off
the names of selected objects, so having the label is arguably more inconvenient
than helpful.
This patch removes said label, giving more room for the object selector.
Pull Request: https://projects.blender.org/blender/blender/pulls/147338
Without this check, the dropdowns in Glass BSDF and Metallic BSDF show up twice
because layouts added with `add_default_layout` are drawn once at the start of
`ui_node_draw_node` and a second time in the loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/147329
This reduces the constant overhead for the evaluation of the Geometry Nodes
modifier. Currently, it has to detect which gizmos are currently used, because
it has to potentially trigger additional evaluation to make the gizmos work.
Part of that is detecting which inputs are used, because gizmos for inputs that
are not used are hidden. Previously, it would compute whether each input is
used. This patch changes it so that only the inputs that have gizmos are
checked.
This reduces the evaluation time in my test from 2.2ms to 1.5ms.
Pull Request: https://projects.blender.org/blender/blender/pulls/147286
Seems to have been introduced by 1104c69a0e.
In `BKE_paint_copy` the `src->runtime` can be `nullptr` in some cases.
This adds a check to make sure to only copy the settings
when `src->runtime` exists.
Pull Request: https://projects.blender.org/blender/blender/pulls/147304
This PR renames "Fac" sockets to "Factor" in the user interface across
shading and compositing nodes, while keeping the identifier unchanged
for scripting compatibility.
The only texture node affected by this renaming (Color Ramp) was not
updated, as it still uses the old style node declaration and this is
legacy anyway.
This also changes "Bright" to "Brightness" in both shading and
compositing.
Ref #96219
Pull Request: https://projects.blender.org/blender/blender/pulls/140498