Currently, we create a logger for every compute context that is evaluated,
even when we don't actually log anything in that context (due to other
optimizations). Now, the logger is not created eagerly anymore.
This can be especially benefitial when there are many compute contexts
that should not log anything, e.g. if there is a repeat zone with many iterations.
In an extrem case I measured a speedup for the modifier evaluation
from 24ms to 14ms.
This adds an optional uiBut callback that allows creating a tooltip
line-by-line with specified style and color in any order. It also
allows adding images as well to create very informative tooltips.
Pull Request: https://projects.blender.org/blender/blender/pulls/105905
Display the modal keymap in the status bar for modal operators that
are called within macros. Most notably, the keymap for the transform
operator is displayed when it's called as part of the duplicate,
extrude, or loopcut operators or when moving nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/108027
Remove `es_ES` language.
Rename `uz_UZ` to `uz_UZ@latin`
Rename `zh_CN` to `zh_HANS`
Rename `zh_TW` to `zh_HANT`
Add support for lowercase chars in `country` part of the locale code
(although in the end it is not needed, since `boost::locale` backend
does not supports lowercase 'country' part in locales identifiers
currently) .
Related to https://projects.blender.org/infrastructure/blender-projects-platform/issues/65
The `ScopedModifierTimer` would work for "real" curve modifiers, but was
skipping geometry node modifiers.
Now move it up so geometry node modifiers are included.
Pull Request: https://projects.blender.org/blender/blender/pulls/112420
This allows for better multi threading because work can be moved to
other threads while waiting for the ico sphere to be generated.
Most other nodes don't need this, because they use `parallel_for`
internally, which sends the hint as well.
Changes the `asset_poll()` and `draw_context_menu()` methods for asset
shelves to use the `AssetRepresentation` type, instead of `AssetHandle`.
The latter should be removed, so it's better to avoid using it in the
asset shelf BPY to avoid future compatibility breakage. This is possible
now with d421ebac5e.
Previously Python code would require the hacky `AssetHandle` type and
query the ID type through the file data it contained (like
`asset_handle.file_data.id_type`). We want to get rid of `AssetHandle`.
With this commit we can change asset shelf methods like
`AssetShelf.asset_poll()` to take an `AssetRepresentation` instead of
`AssetHandle`, since the ID type is currently the only relevant part.
This is much nicer and won't require breaking compatibility in future to
deprecate `AssetHandle`.
When inserting a bone collection via a library override, make sure that
the reverse pointers (from the bones in the collection to the collection
itself) are also added. These are used for the "given the active bone,
which collections is it in?" kind of queries.
When showing a list of bone collections in the M/Shift+M menus, only show
those bone collections that can be assigned to. Bone collections from
linked armatures are hidden, because they're read-only anyway.
It would probably be better to still show these read-only collections,
but not sure how that can be done with the current code.
Instead of storing the active bone collection as `BoneCollection*`, store
its name in DNA. This makes it impossible to point to non-owned bone
collections, makes it easier to handle copy-on-write copies, and should
make it possible to use library overrides on it.
This now also introduces a new requirement that bone collections always
have a name. If the name is set to the empty string, the default name
("Bones") will be used instead.
The `active_collection` pointer is still there for ease of access, but
it's been moved to the armature's `runtime` property.
The library overrides part isn't working yet, though.
Do not allow bone collection operations on linked armatures, regardless of
whether it is overridden or not. This is the first step in making the
library overrides system work with bone collections.
This changes the pre-existing check on the object to actually check the
armature, which is the owner of bone collections. The object is irrelevant
here.
Notifiers was sent to outliner for redraw but outliner was out of sync
due to missing flag which is required for syncing.
This will correctly set the select/active outliner element flags with
the help of Base in `outliner_select_sync_from_object`. So correct active
tree element will be highlighted in `outliner_draw_highlights`
Pull Request: https://projects.blender.org/blender/blender/pulls/112370
#112019 included open/closed state of the parent panel in socket
visibility calculation. This prevents dragging links, but also disables
other features that should still work, such as drawing links.
A narrower condition is needed for icon visibility vs. general socket
visibility. The cases which use the new `is_icon_visible` condition:
- Drawing socket selection outlines (same as unselected sockets)
- Drawing multi-input sockets (same as unselected sockets)
- `node_find_indicated_socket`, used by a wide range of mouse click
operators, including the link-drag operator that was cause for
#112019.
Cases using the original `is_visible` (true even if parent panel is
collapsed):
- `nodeLinkIsHidden` draws links only when at least one socket is
visible.
- `node_update_basis`, sockets still added to layout even if icon isn't
rendered.
- `node_update_hidden`, panels are ignored for "hidden" nodes, all
sockets are rendered.
- `NODE_OT_link_make` operator for finding "best" sockets to connect.
- `node_link_viewer` finding sockets to connect to a viewer node.
- `get_main_socket` used for insert-on-links (find sockets to splice
into) and some shader previews
- `node_gather_link_searches`, suggestions for adding a new node at the
end of a link.
Pull Request: https://projects.blender.org/blender/blender/pulls/112326
In the Asset Browser, the display popup is first, and the search second.
Also, the search button is enlarged horizontally. Apply both to the
asset shelf header.
Before this patch the following snapping options were broken
* snap to markers
* snap to seconds with "Absolute Time Snap" turned on
* technically also snap to Frames with "Absolute Time Snap"
turned on (but made no real difference)
The issue was that each end of the strip would snap individually.
Potentially collapsing the strip.
This would happen e.g. when snapping to markers but with only 1 marker present.
This PR fixes the issue by finding out the closest snap offset and
shifting the strip as a whole by that amount.
That means either the start or the end of the strip will snap to the target.
By doing it that way the length of the strip is never changed by snapping.
This means when snapping to Seconds with "Absolute Time Snap" turned on,
the start of the strip might not be on a full second when the end is.
Pull Request: https://projects.blender.org/blender/blender/pulls/111984
The result of BLI_wcwidth wasn't checked before using the result to
calculate a width, this cause a negative return value to be multiplied
by the font size which divided by zero.
BLI_str_utf8_char_width returns -1 for character without a known width.
This caused the right cursor motion to skip these characters.
While editable text should not contain control characters,
cursor motion should behave properly in cases when they do.
The check for control characters didn't account for delete (127).
This wasn't noticeable in most cases as delete is mapped to delete text.
Pressing Shift-Delete would enter 127 control character in the
text-editor, 3D text & Python console. This happened X11 & Wayland,
I didn't check other platforms.
This allows detecting if deleting the attribute will be possible
without actually trying to delete it, which can give warning
messages in the terminal.
As an example:
```
>>> [(item.name, item.is_required) for item in mesh.attributes]
[('Attribute', False),
('position', True),
('.edge_verts', True),
('sharp_face', False),
('.corner_vert', True),
('.corner_edge', True)]
```
Pull Request: https://projects.blender.org/blender/blender/pulls/111468
Regression in [0] caused the function to jump to the error in the text
editor not to restore the exception, using the trace-back being iterated
over instead of the original value.
[0]: 2d2baeaf04
While in practice sys.modules has __main__ module, the purpose of
PyC_MainModule_Backup/Restore is to temporarily override __main__.
Running code outside of the text editor (callbacks for timers for e.g.)
could remove the __main__ module which would then crash when running
a script from the text editor.
Allow transparency in both text and background color, to allow blending
the selected color with whatever is underneath. Making theming more
flexible, especially since the same property is used in different backgrounds.
Note: this doesn't affect the default themes since all of them have the alpha
component in inner at `1.0`.
Pull Request: https://projects.blender.org/blender/blender/pulls/112090
The context contained an invalid region pointer after closing the popup.
In the bug report this caused problems making a copy of context.property
which accesses the region, but doing other access to context.region was
a problem as well.
When multiple packing methods results in effectively the same bounds,
prefer the packer that uses the smallest area. When all islands can
easily fit this is usually the box packer instead of alpaca. The zigzag
method of the latter has a tendendcy to take up more area and rotate
islands.
Fix#110724: smart UV project unnecessarily rotates islands
Pull Request: https://projects.blender.org/blender/blender/pulls/112295
This has a tendency to place islands diagonally in the image which is
not usually wanted, even if it's maximimizing the number of pixels for
the island.
Fix#109906: UV unwrap packs island diagonally instead of straight
Pull Request: https://projects.blender.org/blender/blender/pulls/112295
See #101778
Remove the requirement of restarting Blender to refresh the
extended 3D view menus for node group changes. Also avoid
rebuilding the tree of relevant assets and catalogs on every
redraw, since parsing asset libraries, etc. could become more
expensive than we want. Those two goals combined mean we
have to be more rigorous in how we invalidate the cached
catalog tree.
The first main change required is to clear the tree as asset libraries
are being read, similar to other dynamic asset menus. This is done
with a 3D view header listener rather than a menu listener in this case.
However, that isn't enough, because there is an issue with the asset
system where the "all" library isn't updated when the current file library
changes. The solution is to explicitly rebuild the "all" library's catalogs
when other asset libraries are changed.
The other necessity for dynamic updates is clearing the catalog tree
to be rebuilt when the node group "asset traits" are changed. This is
done with a new notifier type (with the goal of being a bit selective
about when we re-read assets). This _also_ requires running the
"presave" callback that builds asset metadata when updating the
property. Otherwise saving the file and sending the notifier is
necessary, which is too confusing.
Pull Request: https://projects.blender.org/blender/blender/pulls/112166
In the add modifier menu, 3D viewport menus for node tools, and the node
editor add menu, assets not in catalogs are added to an "No Catalog"
menu rather than not being accessible at all.
This makes the default behavior when adding a node tool "not broken"
so at least something happens by default. The question of "How do I
add a catalog?" is much better than "Why didn't anything happen?"
Implements #111529
See #101778
---
![image](/attachments/b943e2c4-f660-4812-b9ab-f7c116b68b98)
![image](/attachments/e6ee94d7-cd14-475f-8fa6-abcc6774fd7e)
![image](/attachments/b1718d0c-4182-49c5-867a-1399082e98f0)
Pull Request: https://projects.blender.org/blender/blender/pulls/112355