Commit Graph

3276 Commits

Author SHA1 Message Date
Sybren A. Stüvel
d828e9471e Anim: add concept of 'active slot'
Add the concept of 'active slot' within an Action. This allows
clicking on a slot in the Action editor, to select it and mark it as
'active'.

Note that this does _not_ add support for action slots in
`ANIM_set_active_channel()`, as that function doesn't get enough info
to do that, and refactoring it is not on my wishlist.

RNA property `action.slots.active` can be used to access and set the
active slot in Python. `slot.active` can be used to query the slot's
active state, and is read-only (so that there is one way to set the
active slot).

A panel in the Action editor shows info about the active slot. This
panel is just a minimal UI that shows the name and an icon
representing the idtype of the active slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/124422
2024-07-12 11:59:04 +02:00
Lukas Tönne
3d4b8f91e7 GPv3: Fill tool overlay for extension lines and circles
The (GPv2) fill tool has an "extension" mode to assist with filling
small gaps where strokes don't fully meet.

- Overlay: Draws various helpers during modal fill tool operation, using
  the same functions as the render-to-image used for applying the fill
  tool.
- Extension lines: Scrolling or page up/down extends the tips of strokes
  and draws extra boundary lines to limit filling.
- Extension circles: Press S to toggle the mode. This draws circles
  around stroke tips.
- Stroke overlay: This can be enabled in the brush settings
  (_Advanced > Visual Aids_) to draw strokes in a simple color on top of
  the viewport.
- Extension line collision: Tests for intersections of extension lines
  with other lines and with strokes, and cuts them short. Enable in
  brush settings (_Advanced > Strokes Collision_).
- Better defaults for extension increments: The values are in Blender
  units, and quite arbitrary. Using lower values makes it feel more like
  GPv2 in the 2D animation template.
- Draw functions in the `ed::greasepencil::image_render` namespace now
  consistently expect coordinates in view space (avoids confusion and
  works better for 2D elements).
- Some internal renaming and cleanup (many variable names come from GPv2
  and were not very clear).

Pull Request: https://projects.blender.org/blender/blender/pulls/122771
2024-07-12 11:11:17 +02:00
Campbell Barton
607ad28604 Merge branch 'blender-v4.2-release' 2024-07-12 16:25:49 +10:00
Campbell Barton
3358f427dd Fix #124457: Error enabling installed extension after failure to load
When Blender started with an extension enabled from a repository that
referenced a directory that didn't exist - creating the directory
and extensions would fail to import the extension.

This happened because the missing state of the module was cached.

Resolve by clearing Python's path cache for the repository after
running install actions which may have created the directory.

Also run importlib.invalidate_caches() when manually refreshing local
extensions to ensure modules cached as missing can be imported if
they have become available.
2024-07-12 16:22:09 +10:00
Julian Eisel
70dc26cbef Fix: Empty tool settings with primitive tools in grease pencil draw mode
`UnifiedPaintPanel.get_brush_mode()` may return `None` when the current
tool doesn't use brushes. In the specific case of primitive tools
("Line", "Polyline", "Arc", etc) in grease pencil draw mode, the tools
actually should use brushes, but this isn't implemented properly yet
with brush assets. Still handle this case cleanly.
2024-07-11 19:28:22 +02:00
Jacques Lucke
6107175edb Cleanup: make format 2024-07-11 18:46:14 +02:00
YimingWu
2aa346a123 VSE: Check for scene.sequence_editor != None in UI
Sometimes context.scene.sequence_editor can be None, this fix check for
that and prevents python error.
2024-07-11 23:30:04 +08:00
Falk David
5133a498b1 GPv3: Expose overlay options in UI
This exposes existing overlay options from GPv2
in the overlay settings in the 3D viewport.
2024-07-11 15:38:10 +02:00
Julian Eisel
c6885e00d3 Fix: Missing brush tool in grease pencil weight paint mode
Tools for grease pencil v3 weight paint mode weren't updated in
7b0ea0f1b4. Possibly because there was some back and forth in grease
pencil modes while this was being worked on.
2024-07-11 12:16:21 +02:00
Campbell Barton
c4ed24ce9f Merge branch 'blender-v4.2-release' 2024-07-11 17:57:00 +10:00
Campbell Barton
569ccbec59 Merge branch 'blender-v4.2-release' 2024-07-11 17:56:58 +10:00
Campbell Barton
319684d8f6 Extensions: warn when extensions violate module policies
As each extension has it's own package, any modules it includes must be
imported as sub-modules. Warn if extensions are including themselves
in the sys.path as this breaks name-spacing of extensions.

Show these warnings in the add-on & extensions UI.
2024-07-11 17:50:30 +10:00
Campbell Barton
0bfea7caea Extensions: fix error it tests where the local repo wasn't cleared
Tests interfered with each other because the local repo path wasn't
cleared between different tests.
2024-07-11 17:37:31 +10:00
Campbell Barton
fa46ed2c98 Merge branch 'blender-v4.2-release' 2024-07-11 14:23:41 +10:00
Campbell Barton
9ffc973918 Fix missing check for debug print 2024-07-11 14:22:49 +10:00
Campbell Barton
c9df309f1f Merge branch 'blender-v4.2-release' 2024-07-11 14:18:34 +10:00
Campbell Barton
d13da71db4 Fix the extension add-on reloading when caching the extensions state
When the extensions add-on module was loaded before the add-on was
enabled, the module was detected as having changed since it had no
`__time__` member. Loading the add-on would then reload the module.

Resolve by setting the __time__ when first importing.
2024-07-11 14:12:36 +10:00
Campbell Barton
dffbd44631 Merge branch 'blender-v4.2-release' 2024-07-11 11:23:39 +10:00
Campbell Barton
69fd60b41a Extensions: update tests from changes to repo-list 2024-07-11 11:22:30 +10:00
Campbell Barton
3d87112bbd Merge branch 'blender-v4.2-release' 2024-07-11 11:13:06 +10:00
Campbell Barton
3c567ce171 Merge branch 'blender-v4.2-release' 2024-07-11 11:13:03 +10:00
Campbell Barton
1ff66501b4 Merge branch 'blender-v4.2-release' 2024-07-11 11:12:59 +10:00
Campbell Barton
0c01a01133 Extensions: add command line "repo-add --access-token" support 2024-07-11 11:06:57 +10:00
Campbell Barton
f59e872b3b Extensions: show "source" & access-token in the repo-list sub-command 2024-07-11 11:06:21 +10:00
Campbell Barton
375b173d67 Extensions: correct help text for the "build" command 2024-07-11 10:18:45 +10:00
Jacques Lucke
24dc9a21b1 Geometry Nodes: support attaching gizmos to input values
This adds support for attaching gizmos for input values. The goal is to make it
easier for users to set input values intuitively in the 3D viewport.

We went through multiple different possible designs until we settled on the one
implemented here. We picked it for it's flexibility and ease of use when using
geometry node assets. The core principle in the design is that **gizmos are
attached to existing input values instead of being the input value themselves**.
This actually fits the existing concept of gizmos in Blender well, but may be a
bit unintutitive in a node setup at first. The attachment is done using links in
the node editor.

The most basic usage of the node is to link a Value node to the new Linear Gizmo
node. This attaches the gizmo to the input value and allows you to change it
from the 3D view. The attachment is indicated by the gizmo icon in the sockets
which are controlled by a gizmo as well as the back-link (notice the double
link) when the gizmo is active.

The core principle makes it straight forward to control the same node setup from
the 3D view with gizmos, or by manually changing input values, or by driving the
input values procedurally.

If the input value is controlled indirectly by other inputs, it's often possible
to **automatically propagate** the gizmo to the actual input.

Backpropagation does not work for all nodes, although more nodes can be
supported over time.

This patch adds the first three gizmo nodes which cover common use cases:
* **Linear Gizmo**: Creates a gizmo that controls a float or integer value using
  a linear movement of e.g. an arrow in the 3D viewport.
* **Dial Gizmo**: Creates a circular gizmo in the 3D viewport that can be
  rotated to change the attached angle input.
* **Transform Gizmo**: Creates a simple gizmo for location, rotation and scale.

In the future, more built-in gizmos and potentially the ability for custom
gizmos could be added.

All gizmo nodes have a **Transform** geometry output. Using it is optional but
it is recommended when the gizmo is used to control inputs that affect a
geometry. When it is used, Blender will automatically transform the gizmos
together with the geometry that they control. To achieve this, the output should
be merged with the generated geometry using the *Join Geometry* node. The data
contained in *Transform* output is not visible geometry, but just internal
information that helps Blender to give a better user experience when using
gizmos.

The gizmo nodes have a multi-input socket. This allows **controlling multiple
values** with the same gizmo.

Only a small set of **gizmo shapes** is supported initially. It might be
extended in the future but one goal is to give the gizmos used by different node
group assets a familiar look and feel. A similar constraint exists for
**colors**. Currently, one can choose from a fixed set of colors which can be
modified in the theme settings.

The set of **visible gizmos** is determined by a multiple factors because it's
not really feasible to show all possible gizmos at all times. To see any of the
geometry nodes gizmos, the "Active Modifier" option has to be enabled in the
"Viewport Gizmos" popover. Then all gizmos are drawn for which at least one of
the following is true:
* The gizmo controls an input of the active modifier of the active object.
* The gizmo controls a value in a selected node in an open node editor.
* The gizmo controls a pinned value in an open node editor. Pinning works by
  clicking the gizmo icon next to the value.

Pull Request: https://projects.blender.org/blender/blender/pulls/112677
2024-07-10 16:18:47 +02:00
Campbell Barton
41fe7b0d27 Merge branch 'blender-v4.2-release' 2024-07-10 17:42:42 +10:00
Campbell Barton
7ee6451a51 Extensions: support adding system repositories via the command line 2024-07-10 17:39:06 +10:00
Falk David
509cb361bb GPv3: Remove tint tool from tool bar
This is now accessible from the draw tool as a brush asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/124421
2024-07-09 17:17:25 +02:00
Jacques Lucke
dc8e9678e1 Geometry Nodes: allow naming geometry sets
This adds a new `name` member to the `GeometrySet` class. This name can be set
with the new `Set Geometry Name` node. Currently, the name is only used in the
spreadsheet when displaying instances.

The main purpose of this name is to help debugging in instance trees. However, in the
future it may also be used when exporting instance trees or when creating separate
objects from them.

Note, the name is not expected to be unique, it is fully in user control.

Naming geometries is necessary to make the spreadsheet more useful for instances,
because currently the user has no information for which geometry is used by each instance.

We also want to use this name to improve the integration with grease pencil where
sometimes layers become instances with the same name.

Pull Request: https://projects.blender.org/blender/blender/pulls/114910
2024-07-09 17:03:54 +02:00
Campbell Barton
d44b96bf07 Merge branch 'blender-v4.2-release' 2024-07-09 20:41:11 +10:00
Campbell Barton
3a29e25d21 Extensions: expand on the error report when a repository is locked
- Include the repository name.
- Add a hint for force-unlocking the repository.
2024-07-09 20:39:23 +10:00
Campbell Barton
13200f1f60 Merge branch 'blender-v4.2-release' 2024-07-09 19:49:51 +10:00
Campbell Barton
987a027326 Merge branch 'blender-v4.2-release' 2024-07-09 19:49:49 +10:00
Campbell Barton
29f5d56359 Merge branch 'blender-v4.2-release' 2024-07-09 19:49:46 +10:00
Campbell Barton
b44d5cb5af Fix unhandled exception when updating legacy add-ons to extensions 2024-07-09 19:45:18 +10:00
Campbell Barton
f4231418e9 Extensions: limit the size of the data read from the lock-file
Avoid reading a large amount of data if the lock file
inexplicably contains large amounts of data.
2024-07-09 19:37:12 +10:00
Campbell Barton
1ffde9338d Extensions: support force unlocking a repository
When the repository is owned by another Blender session,
support removing the file-system lock.

This is accessible from a menu in the repository popover.

This is needed if Blender exits unexpectedly while a repository
is being modified (typically install/upgrade).

Addresses #122135.
2024-07-09 19:27:32 +10:00
Campbell Barton
d06c79958c Merge branch 'blender-v4.2-release' 2024-07-09 15:43:02 +10:00
Campbell Barton
912194390a Extensions: ensure generated strings in the TOML file are valid
While this wasn't likely to cause any problems in practice,
using the sub-command "build --split-platform" with a platform
containing any characters that need escaping would have produced a TOML
with invalid syntax.

Add a utility function that's guaranteed to create a valid TOML string.
2024-07-09 15:32:09 +10:00
Fermin
ad58c9eaca XR: Add passthrough support for Meta Quest devices
Uses the OpenXR extension XR_FB_PASSTHROUGH_EXTENSION_NAME,
compatible mainly with the Meta Quest family of devices.

Currently, passthrough support over OpenXR is disabled by default
in the Quest Link app, and must be manually enabled in its settings
to use this feature.

The performance of the passthrough render varies with the quality
of the connection between the headset and the PC. For better results,
connecting the headset directly through USB to the PC, or at least
connecting the PC to the local network over ethernet, is recommended.

Thanks a lot to [KISKA](https://kiska.com/)
for their support in the development of this feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/124204
2024-07-09 06:10:17 +02:00
Campbell Barton
b8fc441fdd Merge branch 'blender-v4.2-release' 2024-07-09 13:47:10 +10:00
Campbell Barton
5d379b9887 Cleanup: remove type hints, follow code style for core scripts 2024-07-09 13:32:30 +10:00
Hans Goudey
792efafa2c Cleanup: Miscellaneous changes to OBJ/import nodes
- Sort add menu alphabetically
- Use forward declaration for GeometrySet again
- Use `this->` to access class methods
- Use `MEM_cnew`
- Fix typo
- Pass Span by value
- Pass MutableSpan instead of Vector &
- Remove unnecessary whitespace
- Use `BLI_SCOPED_DEFER` for freeing non-RAII objects
- Use `is_empty()` instead of `size() == 0`
- Use `GeometrySet::from_mesh` ability to handle null argument
2024-07-08 15:12:42 -04:00
Bastien Montagne
385dfb4650 Merge branch 'blender-v4.2-release' 2024-07-08 20:51:48 +02:00
Bastien Montagne
92d5659653 I18N: Update UI translations from git/weblate repository (9735e28dcce47210).
Note that this commit also introduces a new language, Slovenian.
2024-07-08 20:50:07 +02:00
Devashish Lal
4b884f737c Geometry Nodes: OBJ Import Node
Add a node similar to the STL import node (d1455c4138) that
imports OBJ files, including both meshes and curves. The output consists
of a geometry instance for each mesh/curve in the file.

There are a few improvements to address in the future: Currently the node
has no inputs besides the file path. Options may be exposed in the future.
Materials are also not imported yet, because creating material data-blocks
during evaluation may not be trivial.

This is part of a GSoC project:
https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482

Pull Request: https://projects.blender.org/blender/blender/pulls/123967
2024-07-08 20:20:38 +02:00
Harley Acheson
4e98eebab8 Merge branch 'blender-v4.2-release' 2024-07-08 10:14:03 -07:00
Harley Acheson
987b781412 UI: Various Grammar Changes for Extensions
Various minimal grammar changes in the new Extensions system. For
example changing "Please turn Online Access on the System settings" to
"Please turn Online Access on in the System settings"

Pull Request: https://projects.blender.org/blender/blender/pulls/124262
2024-07-08 19:12:56 +02:00
Jesse Yurkovich
5bb5cfd97a Merge branch 'blender-v4.2-release' 2024-07-08 09:07:07 -07:00