While this was initially meant as temporary design, I think it's fine to
keep this. It adds more flexibility in removing unwanted assets from the
listing. Plus it's unclear if we can get the necessary Python API syntax
to work before the release, so I prefer not relying on that. Should we
get it to work, the API can still be changed before the release.
Enum popups don't set an active button so accelerator keys didn't work.
Always use accelerator keys in popups because these are typically
launched from non-menus (the redo popup for e.g.) where it doesn't
make sense to pass the event to the parent.
Shader write must be correctly specified where required for
shaders which perform direct image and buffer writing operations.
Authored by Apple: Michael Parkin-White
Pull Request: #110219
The Realtime GPU compositor crashes when muting output or viewer nodes.
This happens because output nodes are scheduled regardless of their
muted statued, however, the initial reference count takes the muted
status into account, resulting in a use after free error, hence the
crash.
To fix this, we simply do not schedule muted output nodes.
"Flip" option in mirror modifier is only effective for when "Bisect" is
enabled, thus grey out the flip option when it's ineffective to avoid
confusion on the user interface.
Pull Request: #110191
It is possible to organize shape keys into a tree through the
reference key setting. Mesh editing and sculpting a reference
key is supposed to update all its children, but this was only
done for one level of dependencies.
This changes the code to retrieve the complete set of dependent
keys and update them all.
Caused by fd3e44492e.
Images were drawn filling the entire window, now use available size/
offset inside the window and pass these as `rctf` to
`draw_display_buffer`.
Should be good for 3.6/3.3 LTS
Pull Request: #110206
When scenes only have a world probe the world probe had several
artifacts.
- The first sample didn't update the world.
- When switching between viewports the world didn't get updates
- When rendering it ignored the resolution that was set by the user
The reason was that the ubo was only updated when the probes where
synced. This PR adds an exception to also update when there is only
the world probe.
Pull Request: #110238
Implementation of the smoothing operator for grease pencil strokes.
Works on `CurvesGeometry` position and other attributes, such as radius.
Based on the gaussian blur like algorithm in `BKE_gpencil_stroke_smooth_point` by Henrik Dick.
Pull Request: #109635
This is a fairly verbose part of nodes RNA, which defines the base
NodeSocket and NodeSocketInterface types as well as all the subtypes
required for showing correct properties based on socket type.
The RNA for this part of nodes is quite self-contained, so moving it
to a separate files works well and reduces the overall size of
rna_nodetree.cc considerably (~1700 LoC). This does not include any
functional changes.
Moving this to a separate file will make it easier to improve the node
group interface (#109135).
Pull Request: #110220
The LOD selection for reflection probes wasn't correct and would
select a noisier texture than required. This change will improve
the LOD selection making less noise in the rendered image.
Pull Request: #110234
This utility uses Python's clang module to validate comments intended
to match the struct member names. `cmake_static_check_clang.py` has
been written to support adding other checkers in the future.
In order to better suit the upcoming changes of shader node previews, this
patch replaces the old implementation of the storage of the compositor
previews. It also prevents memory loss for future modification.
BKE_node_preview_clear_tree was removed as it is no longer needed and
will not be used by the new shader node previews.
Pull Request: #110064
Previously the normal strength linearly interpolated and extrapolated
the normal in world space. Instead do it in tangent space, in a way
that ensure the normal remains above the surface and valid.
Pull Request: #109763
No user visible changes expected.
Previously the calculations to skip building the layout for invisible
items used the scrolling offsets quite a bit. These require floating
point math and are managed in other code. So better to minimize use of
this to make code locally more clear & reliable.
No functional changes
In preparation to tackle the following 2 Todos
* TODO: view scale should factor into this someday too...
* TODO: optimize this to not have to calc stuff out of view too?
I did the following cleanup
* extracted drawing code for `BEZT_IPO_BEZ` into a separate function
* extracted code that calculates the resolution between 2 points into a separate function
* cleaned up comments
* renamed variables to have a more telling name
* moved variables closer to where they are used
* added `const` where possible
Pull Request: #108748
No user visible changes expected.
Rather than relying on a C-style function pointer with void pointer
arguments, allow storing a `std::function` object, which can hold
arbitrary data in a type safe way. This can be conveniently used with
lambdas, e.g. from #104831:
```
UI_but_func_set(but, [&shelf_settings](bContext &C) {
shelf::settings_set_all_catalog_active(shelf_settings);
shelf::send_redraw_notifier(C);
});
```
This is not used yet, but will be with #104831 merged. Replacing the
existing C-style callback with this can be done separately.
Previously this allowed looking up a view to filter in in any region of
the current area, so Ctrl+F from the asset shelf footer would be
possible. However in own experiments this didn't really add much, so
rather keeping it simple now.
No user visible changes expected.
This is needed in #104831 but makes sense to expose publicly in the
asset system APIs either way. So committing this to the main branch
already.
It's now possible to have multiple asset shelf types registered for
different contexts (e.g. sculpt mode vs. texture paint mode vs. pose
mode) and the settings are kept separate. For this a proper concept of
an active asset shelf is introduced. Basically only one asset shelf can
be active at a time, but we keep multiple shelves in storage, so we can
switch between them while all settings are preserved.
Adds a `bl_option` to asset shelf type definitions to disable the
default asset dragging (`NO_ASSET_DRAG`), so the drag event can be
overridden by custom keymap items.
AFAIK this doesn't work in master either. Issue is that the operator
relies on context that is only available in the asset shelf region (or
with the mouse over the asset-view template). So the correct region has
to be restored for redo to make this work.
View items now always display mouse hover highlight, regardless of the
embossing (might want to give more precise control for this though).
- Made the active state of items visible, so had to add a way to disable
that.
- Had to make the view item mouse hover highlight work in popups.
An offset was applied for transparent regions, so the hotspot is closer
to where the user expects (closer to the visual content). But this only
makes sense if the background is actually transparent or close to at
least.
We want to support different preview sizes, but the regular region
zooming makes things overly complicated (because of the pagination
and region size snapping mostly). Plus region zooming would usually zoom
text as well. So the preview size is better managed separately.
This means the view always scrolls by a full row, so that asset previews
are never partially in view.
The paginated scrolling is implemented as a standard View2D feature.
This doesn't work well with zooming yet, and it's tricky to get that to
work right.
Since we pass around a struct with a string, and multiple string-references
into this string, we have to make sure the memory address of the string buffer
never changes. It would seem that move semantics give this behavior, but it
wouldn't work for short strings. When moving a string, short string
optimization would still require the string to be copied, not moved, causing a
change in the memory address. GCC and Clang use different definitions of "short
string", causing differences in behavior.
Wrap the string in a unique pointer, so the string itself is never moved or
copied.
- Use (arguably) more readable return type instead of return arguments.
- Update function API comment.
- Use more clear (because more direct) return values
This is the main change needed to properly implement the asset shelf
main region. Loading, displaying, catalog based and type based filtering
work, custom drag & activation operators don't yet. There is no
paginated scrolling or so yet, but scrolling is vertical now (to be
evaulated).
Python defined asset shelfs can now define an `asset_poll__()` function
to determine if an asset should be visible or not, based on type
information. This isn't great and can probably be a performance issue in
bigger libraries. A proper solution would be to provide a set of asset
traits to filter by, but this is a bit tricky to implement. This is a
temporary solution so the brush assets project isn't held up by this.
Mandatory change for the Brush Assets project, from quick test does not
seem to break anything (more) in existing 'old' brushes...
Re. #101908.
Pull Request #105016
This adds support for cursor snapping for the new curves object.
It implements a function `transverts_from_curves_positions_create` (to separate the logic from the `Curves` object type). That function is then C wrapped by `ED_curves_transverts_create` and finally used in `ED_transverts_create_from_obedit`.
Pull Request #104967
Fixes the `-Winconsistent-missing-override` warning.
In theory the `virtual` is redundant in such case, but this is how
it is done in may other areas of USD code.
Pull Request #104977
Previously when markers were used, the newly introduced clamping code (#104516) would stop the last channel from being shown.
This patch fixes that by modifying the `v2d->tot.ymin` calculation.
This is a bit counterintuitive since the `v2d->tot` height is calculated in `action_draw.c`. But the advantage of doing it there is that it also works for the channels region.
Pull Request #104892
This does 2 things to address the ARM64 failures:
- Increases the threshold to be inline with what Cycles uses
- Disables the 2 problematic WebP variations (#105006 will track)
This adds saving and loading tests for our supported image formats.
**Saving - bf_imbuf_save.py**
There are 2 template images which are loaded anew for each file save
attempt. One is an 8-bit RGBA image and the other 32-bit. This is
required as many formats use a variety of factors to determine which of
`ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates
are constructed to have alpha transparency as well as values > 1 (or
clamped to 1 for the case of the 8-bit template).
Test flow:
- Load in an appropriate template image
- Save it to the desired format with the desired set of options
- Compare against the reference image
Notes:
- 98 references are used totaling ~3.6MB
- 10-12 second test runtime
- Templates can be reconstructed with the create-templates.blend file
**Loading - bf_imbuf_load.py**
Test flow:
- Load in each of the reference images
- Save them back out as .exr
- Save additional metadata to a secondary file (alpha mode, colorspace etc)
- Compare the saved out .exr with another set of reference .exrs
- Compare the saved out file metadata with set of reference metadata
Notes:
- 98 exr references are used totaling ~10MB
- 10-12 second test runtime as well
A HTML report is not implemented. The diff output organization is very
similar to the other tests so it should be somewhat easy to do in the
future if we want.
The standard set of environment variables are implemented for both:
BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR
Pull Request #104442
Added new function sculpt_mesh_filter_cancel in sculpt_filter_mesh.cc
for cancelling mesh filters. It currently is unused pending a
revamped modal map for mesh filter (see pull req 104718).
In the outliner, the icons for modifiers are tinted blue. This didn't
work for the geometry nodes modifier icon.
Defining the icon with the macro `DEF_ICON_MODIFIER` also
defines the appropriate theme color so it's now tinted blue
when drawn in the outliner like the other modifier icons.
Pull Request #104957
Add a per node type callback for creating node add search operations,
similar to the way link drag search is implemented (11be151d58).
Currently the searchable strings have to be separate items in the list.
In a separate step, we can look into adding invisible searchable text
to search items if that's still necessary.
Resolves#102118
Pull Request #104794
For example, the pose library add-on can now register an asset shelf
like this:
```
class VIEW3D_AST_pose_library(bpy.types.AssetShelf):
bl_space_type = "VIEW_3D"
@classmethod
def poll(cls, context: Context) -> bool:
return PoseLibraryPanel.poll(context)
```
Filtering by ID type is not supported yet.
This replaces the hack of registering a header type and the asset shelf
template to draw into that.
The tabs should be fully working themselves, however we don't filter
the asset shelf contents based on the active catalog (well, catalog
path) yet.
Includes the changes from D17164.
Essentially, I wanted to use a non-trivially-constructible C++ type
(`std::function`) inside `uiBut`. But this would mean we can't use
`MEM_cnew()` like allocation anymore.
Rather than writing worse code, allow non-trivial construction for
`uiBut`. Member-initializing all members is annoying since there are so
many, but rather safe than sorry. As we use more C++ types (e.g. convert
callbacks to use `std::function`), this should become less since they
initialize properly on default construction.
Also use proper C++ inheritance for `uiBut` subtypes, the old way to
allocate based on size isn't working anymore.
Differential Revision: https://developer.blender.org/D17164
Progress bar display the file reading (and other operations) is actually
broken in master for a while, so this won't actually be reported. Still
calculate it for once it's fixed.
Loading the asset library will create a read-only catalog service. The
read-only nature is not dealt with much in the asset catalog code, the
using code (e.g. the UI) is responsible for respecting it.
Merges the catalog definitions from all asset libraries in to the
storage of the "All" one, builds the catalog tree and refreshes data as
needed. This doesn't allow writing changes back to the catalog
definition files, so the UI probably shouldn't allow edits.
Together with the changes made in master, all this does is making sure
the assets are loaded and removed using the correct asset library nested
within the "All" library. Now full paths for the assets can be built
correctly from the asset identifier, which fixes preview loading and
drag & drop.
Now it actually loads data from all asset libraries when this is
selected. The asset representations still need to be loaded by the file
browser backend, this won't change for now.
This adds the concept of nested asset libraries, which I'd prefer to
keep as implementation detail and not expose in the API. But for now
it's needed (for the asset representation loading by the file browser
backend).
An "All" asset library can be selected in the Asset Browser and asset
view templates now, and that will load all assets from all asset
libraries. Preview loading, drag & drop and asset catalogs don't work
yet.