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
The dilate threshold test fails on Qualcomm GPU due to an unknown
reason, but the tests shows significant differences in all platforms
regardless, they are just small enough to pass the test threshold. The
difference is most likely the new SMAA implementation done to match the
GPU version, so updating the reference is reasonable here.
Pull Request: https://projects.blender.org/blender/blender/pulls/147451
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
The result of the Keying Screen node tests is very different yet the
test succeeds, that's because the test result has a very small number of
pixels compared to the final image. To fix this, we match the size of
the result with the render size.
This also updated the test reference which should have been updated
after the new RBF interpolation implementation of the node.
Pull Request: https://projects.blender.org/blender/blender/pulls/147449
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
Ref: https://projects.blender.org/blender/blender/issues/145573.
Added to Essentials(pre-bundled with Blender):
- Camera & Lens Effects/
- Vignette
- Film Grain
- Sensor Noise
- Chromatic Aberration
- Creative/
- Tune Image
- Sepia
- Split Toning
- Unsharp Mask
- Utilities
- Retime
See PR description for demo videos.
Thanks to @Sergey for the RGB <-> CMYK workflow and
@SimonThommes for the help with the vignette masking!
Co-authored-by: Habib Gahbiche <habib@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146038
Cosmetic changes to "Global Transform" panel in 3D Viewport sidebar, to make it
more aligned with rest of the Blender UI.
Note that this isn't a comprehensive update, there are still many things to change
according to our discussions in #137280. This PR only includes small,
non-controversial changes so that we can land improvements in 5.0.
Bigger changes will follow in the next version(s).
List of changes:
- Close all subpanels by default.
- Move "Fix to Camera" subpanel to the bottom, so that it's not between related
"Mirror" and "Relative" subpanels.
- Follow Blender's GUI guidelines:
- Use `property_split`.
- Align related properties.
- Remove redundant label from "Relative" subpanel. The title of the subpanel
already communicates the purpose.
- Rename "Mirror Options" subpanel title to just "Mirror". It's obvious that the
panel will contain options.
Pull Request: https://projects.blender.org/blender/blender/pulls/147436
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
This PR Updates the default colors of the Curve Handle types,
to increase readability and contrast.
Each color more different from each other to not be confusing.
Logic for the new colors:
* Purple/Dark blue is used for the `Vector` type to match the header
and sockets of Vector nodes.
* Red is used for `Auto` to show that they're locked and can't be
changed without converting the type.
* Pink/Salmon color is used for `Auto-Clamped` to be similar to `Auto`
while still being distinct.
* The remaining colors are chosen to be visually distinct from the
other colors.
This also fixes a problem caused by 1067112c11 (#145360) where
Free handle were left fully black. These black handles are extremely
hard to use with Grease Pencil objects, because Grease Pencil strokes
often are black. Because the `Free` handle selected color is also black,
handles do not show if they are selected.
Co-authored-by: Nika Kutsniashvili <nickberckley@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/147335
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
Increase width in some popovers where labels would get trimmed.
This was even worst for other languages, but at least now labels don't
get ellipsis by default (English at 1.0 UI scale).
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
The current placement of the operators make it easy for them to blend in with
other group nodes in that menu.
This patch adds an icon to better indicate the nature of these operators, and
have separators between it and other entries of the menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/147330
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