Test was failing since efdda78175. The asset library path was now using
backslashes on Windows, and got compared to a path with forward slashes. Use
our higher level path comparison function to make sure they point to the same
directory.
When displaying an asset library that contains a back slash on macOS (or Linux,
I assume), resizing the asset browser would make all assets disappear, and
instead the message would show that indicates an invalid asset library path.
Convert all slashes to native format when initializing an asset library. This
might convert slashes that are valid parts of the file name, but this just
leads to an error about a not found asset library, which is better than
crashing. This is a typical tradeoff when dealing with cross platform paths.
Now that handles are effectively hidden with the "Tweak Handles" option
(and clear themselves if `use_restore_handle_selection` is set),
handle selection for multiple strips is quite unintuitive.
It is expected that, after selecting a group of strips, the user will
be able to tweak all of their handles, even if they are not connected,
consistent with other NLEs.
This patch enables that behavior by propagating handle selection to
all selected strips if "Tweak Handles" is on.
Pull Request: https://projects.blender.org/blender/blender/pulls/139075
Originally, `element_already_selected` would always return `true`
as long as the user clicked on a strip that was already selected,
regardless of its handle selection state.
This led to unexpected behavior when trying to tweak a strip:
E.g. taking a strip, selecting its left handle, then trying to tweak
the strip itself would actually tweak the left handle unexpectedly, even
though the cursor would be far enough away that this does not make sense.
A lot of this is very messy and I keep running into
the same weird edge-cases, so hopefully more documentation
will help for the time being, until I can rework the entire
selection system in 5.0.
This should make VSE code more readable and easier to understand from an
outside perspective.
The name was chosen to be `channel` rather than `channel_index` to keep
things short and concise -- it should be clear based on the context
whether we are talking about the strip's channel index (singular case,
`Strip::channel` or `SeqTimelineChannel::index`) vs. the channel list
(plural case, e.g. `Editing::channels`).
Pull Request: https://projects.blender.org/blender/blender/pulls/138919
For default values, the fairly complex reasoning for the code is explained
in details in comments. The TL;DR: would be that this code is needed to
safely load blendfiles older than 2.83, which were saved without any DNA
type information for these default value data.
Storage data have always been written with DNA info (added in commits
3bae60d0c9 and 9d91bc38d3), so no need to add special handling for them.
Just use regular DNA struct reading.
Pull Request: https://projects.blender.org/blender/blender/pulls/139175
Previously, when reordering a tree view item to the end, one had to move it drop
it fairly precisely on the lower half of the last item in the list. This patch
makes it possible to just drop it below the last item too. The outliner has the
same functionality.
Pull Request: https://projects.blender.org/blender/blender/pulls/139025
Currently, nothing happens when trying to scroll while hovering a tree view that
is fully visible (i.e. does not have a scroll bar). This patch makes it so that
the scroll event is passed through in this case so that one can scroll the
entire region even when hovering the tree view. If the tree view does have a
scrollbar, then the scroll-event is still captured by that even if scroll all
the way up/down already.
Pull Request: https://projects.blender.org/blender/blender/pulls/138930
Node UIs can now have panels. Some of those may need to have their
labels translated using translation contexts. PanelDeclarations
already had a translation_context member, this commit adds a way to
specify this context, and to use it for translation on drawing the
node.
Pull Request: https://projects.blender.org/blender/blender/pulls/139124
Reported on devtalk: MotionBuilder produced FBX files contain
"cameras" that are not really user visible cameras, but rather map to
MotionBuilder viewports. They are at root, have no child elements,
and have special names. There is also a "camera switcher";
ignore that too.
Pull Request: https://projects.blender.org/blender/blender/pulls/139204
This patch turns the options of the Crop node into inputs.
Instead of specifying the bounds of the crop, the inputs now specify the
Width and Height of the crop region. The Crop Image Size option was
renamed to Alpha Crop and inverted, so it now defaults to actual
cropping. The Relative option was removed, as it is now superseded by
the Relative To Pixel node, and removal was done to facilitate the
options to inputs project.
Reference #137223.
Pull Request: https://projects.blender.org/blender/blender/pulls/139163
The Relative To Pixel node considers the original resolution of the
image with no transformation, while it is more useful for it to consider
the realized size instead, because that's what later processing nodes
will be using.
If the cursor has never been over the mesh and a stroke is drawn that
starts off of it, passes over the mesh, and then ends off of the mesh,
then when the active index is accessed, it is possible that the BMesh
indices and tables are not initialized.
Pull Request: https://projects.blender.org/blender/blender/pulls/139184
This was used to cache a lazily evaluated viewer field in the past, but is
unused for a while now already. If we need it again, it can be implemented with
`GenericKey` instead of a custom version of that.
Pull Request: https://projects.blender.org/blender/blender/pulls/139192
A small quality of life change to indicate which slots are used.
This only applies to the slots menu, the UI List could show these too
however this requires extending the RNA API.
Ref: !138651
This converts the public `uiItemFullO_ptr` function to an object
oriented API (an `uiLayout::op` overload), matching recents changes
in the API.
Changes include rearranging the `IDProperty *properties` parameter to be
the last parameter. Now is optional (but will be removed), also instead
of using a return parameter the function now returns the pointer to
write properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/139166
With the release of the brush assets project in 4.3, most brush
management moved out of the current .blend file into either the
essentials library or user-created libraries.
With this change, a number of workflows became more difficult:
* Handling a large library of texture and texture properties for brushes
due to ID linkage constraints.
* Having local tweaks to a brush without bloating the the asset library
and reducing discoverability.
This commit introduces an intermediate step to assist with both of the
preceding pain points. The `brush.asset_save_as` operator is extended
to allow saving into the current blend file via the `Duplicate Asset`
context menu entry.
Additionally, these features help ease authoring brush assets in general
from the UI instead of requiring manual datablock management.
This allows brushes to be stored alongside other data inside a specific
blend file.
Related to #129655 and [1].
[1] https://blender.community/c/rightclickselect/XYMA/
Pull Request: https://projects.blender.org/blender/blender/pulls/138105
This commit adds the `BKE_brush_duplicate` function that performs a deep
copy of a brush ID and all associated IDs into the current Main
database.
Unit tests are added with this case to ensure that grandchildren and
embedded data is handled correctly for both Sculpt and Grease Pencil
brushes, as the latter contains more ID references than other brush
types.
Related to #138105
Pull Request: https://projects.blender.org/blender/blender/pulls/138629
Currently, when using link-drag-search and searching for "Value" shows the bake
node first. This is annoying because it's rarely what one means. It's shown
first because it's a shorter search entry.
This patch reduces the weight of that entry so that the Value node shows up
first.
Pull Request: https://projects.blender.org/blender/blender/pulls/139156
This adds a new modal operator that allows reordering columns interactively.
It's triggered by dragging the column header. Edge panning while dragging the
column to the left or right of the region is supported. Scrolling with a
horizontal scroll wheel works too.
There are three new UI elements to help the user understand what is happening.
These three elements seem to be fairly standard in other spreadsheet software.
* The column that is dragged is highlighted in its original place.
* A "shadow" of that column stays attached to the cursor.
* A line indicates where the column will be inserted.
Note: The column order is not yet persistent when columns disappear temporarily.
That will be worked on separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/139136
This improves implicit node inputs in multiple ways:
* Fix crash when switching a group input socket type from e.g. vector to
integer, while the default input is set to "position". Now, the default input
type is reset automatically if it's invalid.
* Add Left/Right Handle as possible implicit vector inputs (next to Position and
Normal). Those were the only ones that we used internally that were not
exposed yet.
* When creating a new group input from an existing socket, also initialize the
default input based on the socket. E.g. when grouping a `Set Position` node,
the `Position` input of the group will now also use the position attribute by
default.
In addition to these user-level changes, some internal changes were done too:
* Use unified `NodeDefaultInputType` in node declaration instead of function
pointers which were hard to propagate to node groups.
* Use a new reusable `socket_type_supports_default_input_type` function in rna
to filter the list of possible input items.
Pull Request: https://projects.blender.org/blender/blender/pulls/139139
The Smoke Surface Emission is the height of the smoke from the mesh surface.
It is measured in Domain Grid Units, and if the grid unit is relatively big
(compared to the mesh), the smoke emission is huge.
To fix that the Surface Emission was decreased from 1.5 to 1.0. As a result
it is possible to emit smaller smokes (width 2, previously 3).
Further decreasing default value of Surface Emission is not recommended,
as in some cases (too small mesh compared to Grid Unit) will result not
emitted smoke.
Fix#132613: Issue with large smoke domain and small emitter
Pull Request: https://projects.blender.org/blender/blender/pulls/138567
This patch removes the Relative option from the Translate node. This is
now superseded by the Relative To Pixel node, and removal was done to
facilitate the options to inputs project.
Pull Request: https://projects.blender.org/blender/blender/pulls/139147
This converts the public `uiItemFullO` function to an object oriented
API (an `uiLayout::op` overload), matching recents changes in the API.
Changes includes the removal of the paramether `IDProperty *properties`
that seems unused (all places just sets `nullptr`, can be added as last
argument with `nullptr` as default value though), and instead of using a
return paramether the function now returns the pointer to write properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/138961
This is because the warm_shader_specialization was
not called for the actually used specialization since
the samples_len would be updated right before accumulation.
Fixed by calling update_sample_table before the warm shader
call. Also avoid default filter request 4 sample specialization.
This avoid all stall altogether.
Previously this attempted to use the evaluated deform mesh (otherwise
known as the cage mesh). Because this isn't the mesh displayed in the
viewport it can be unintuitive, and it also doesn't work when the other
meshes are procedurally generated or have other "generative" modifiers.
This commit switches to just checking the evaluated mesh.
A potential downside is that modifiers like subdivision are also taken into
account and can potentially make the objects incompatible because of
mismatched vertex counts.
Part of #135095
Pull Request: https://projects.blender.org/blender/blender/pulls/138330
This patch adds the option to take screenshots for asset previews.
Since the functionality lives inside an operator, the screenshot can only
be taken from within the GUI of Blender.
* The operator can be accessed from the dropdown menu in the asset
browser preview n-panel.
* It works for local assets and assets that are managed by blender
(e.g. brush assets)
* Click drag anywhere in Blender to create a capture
* Holding Space will move the capture area
* Holding Shift will unlock the aspect ratio
* On a re-run, the operator remembers it previous capture
area to easily create an identical screenshot
* If the screenshot is fully contained within a single 3D viewport,
the background will render transparent
Pull Request: https://projects.blender.org/blender/blender/pulls/132904
Currently, if a user drags an image file into a node editor with
no node tree, then the operator silently fails.
This patch adds an error to warn the user that adding an image is
only possible if a node tree exists already.
Pull Request: https://projects.blender.org/blender/blender/pulls/138997
Check if either the memory is zero or already matches the default value,
and copy. This simplifies a common pattern to a single line.
Preparing for default initializers in DNA (#134531).
Pull Request: https://projects.blender.org/blender/blender/pulls/138830
* Move colorband and theme DNA to own headers
* Move some anim, curve, modifier and space enums to new headers
* Move data transfer enums to DNA
* Duplicate imbuf proxy and GPU backend enums
For a few reasons:
* Reduce number of includes in DNA headers
* Don't define enums used in DNA outside of DNA
* Move theme settings to separate header for userdef_default_theme.c
* Prepare for using default initializers in DNA headers. (#134531)
Pull Request: https://projects.blender.org/blender/blender/pulls/138831
This is mostly a non-functional change except for
* `overlay_armature.cc` was drawing relationship lines to bone
hidden by collection logic (except that doesn't seem to work anyway,
relationship lines are drawn regardless)
* `transform_snap_armature.cc` it was possible to snap to pose bones
hidden by collection logic.
I assumed those to be oversights so I changed them in this PR.
This does *not* remove all usages of `BONE_HIDDEN_P`
and `BONE_HIDDEN_A`. Some direct access is required in
the UI and for cases where we explicitly don't want to check
collection visibility.
Part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/139151