Commit Graph

1631 Commits

Author SHA1 Message Date
John Kiril Swenson
d2a802d3c6 VSE: Remove timeline box select
Remove the box select tool from the timeline to simplify selection
logic, avoid confusion for users, and make maintaining the code
easier in the future. It also brings the selection system  closer
to other industry-standard NLEs.

It also fixes an issue caused by d2091b4b1.

More details in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/128051
2024-10-03 00:37:00 +02:00
Pablo Vazquez
177e2ac837 Grease Pencil: Tool settings layout adjustments
Small adjustments to improve consistency in tool settings
between different tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/128491
2024-10-03 00:28:50 +02:00
Falk David
1829982d3b GPv3: Merge Layers Operator
This adds a function to merge layers in original Grease Pencil geometry.
It also adds an operator to merge layers as well as some tests for the `merge_layers` function.

The operator has 3 modes:
* `Merge Down`: Combine the active layer with the layer just below (if there is one).
* `Merge Group`: Combine all the layers in a group into one single layer and remove
  the group. Can be accessed in the right-click menu of groups.
* `Merge All`: Combine all the layers of the object into one single layer.

All of these can be accessed in the `Extras` menu next to the layer tree.

Pull Request: https://projects.blender.org/blender/blender/pulls/128201
2024-10-02 18:28:30 +02:00
Lukas Tönne
dfc8a782f5 GPv3: Attribute panel to configure layer attributes on original data
This follows the same pattern as attribute panels for Mesh, Curves, and
Point Cloud. Only the layer domain is supported. The _add_ operator now
has to validate the domain setting on invoke, because layer attributes
don't support the default `Point` domain.

Pull Request: https://projects.blender.org/blender/blender/pulls/128471
2024-10-02 13:58:13 +02:00
Falk David
a25456eaf1 Fix: GP: UI errors when no layer tree node is active
The UI code assumed that either a layer or a group is always
active which is not always the case. It can happen that nothing
is active.
The fix makes sure the this case is handled correctly.
2024-10-02 12:41:11 +02:00
Campbell Barton
0b69e1d6f5 Cleanup: double quotes for strings, replace f-string with str.format 2024-10-02 15:46:11 +10:00
Campbell Barton
dadb9ba5dc Cleanup: script formatting 2024-10-02 15:42:46 +10:00
Harley Acheson
8d0fc95fb6 Cleanup: Make format
Just the result of running Make Format
2024-10-01 12:17:43 -07:00
Casey Bianco-Davis
b4881f6b0a GPv3: Layer Tint Color, Radius Offset and Adjustments panel.
This adds the layer adjustments back.
There is a the `Adjustment` panel under the layer properties with
the tint color, the tint factor, and the radius offset (now in meters).

The tint and radius offsets are stored as layer attributes.

For compatibility and the sake of not making the conversion code more complicated,
legacy layer adjustments are always converted to modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/126777
2024-10-01 19:04:32 +02:00
Pablo Vazquez
7b91f71ebf Grease Pencil: Move Layer selector and tool settings
Move the Layer selector to the header, centered, with icons and
without labels, to match other modes that display the source
there (such as Vertex Groups, Color Attributes, etc).

Additionally, move the tool settings from the header  to the right
hand side of the toolbar. Matching mesh and other modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/128439
2024-10-01 18:36:29 +02:00
Jonas Holzman
92d00678ac macOS: Add Image Clipboard Copy/Paste Support
This Pull Request adds support for image clipboard copy-pasting to the Image Viewer on macOS, accepting sources from both raw image data and image files.

Tracking Issue: #111404

Pull Request: https://projects.blender.org/blender/blender/pulls/126574
2024-10-01 18:32:32 +02:00
Julian Eisel
33b670a65d Sculpt/Paint: Automatically switch tools when activating brushes
As discussed in #128066, we want that activating a brush makes sure the
most appropriate tool is activated. For example activating an eraser
brush should activate an eraser tool, if available. This makes the
tool and brush binding two ways, which is more clear. Plus it means that
users don't have to care about tools at all if they don't want to, they
can just keep switching brushes and Blender takes care of the tool.

Implementation wise, this works by letting a Python operator lookup a
tool for a given brush type name, when activating a brush.

Design Task: https://projects.blender.org/blender/blender/issues/128066
2024-10-01 18:21:15 +02:00
Julian Eisel
3798852071 Sculpt/Paint: Bring back some brush tools for paint modes
Since brush assets were merged, all sculpt and paint modes have a unified
"Brush" tool that is used for all brushes. Based on feedback, this mixes brush
types a bit too much, so some specific tools that use brushes should be brought
back. These brush types just behave very different from the main brush types,
and users expect them to be easily accessible from the toolbar. This also makes
them more discoverable and having tools that remember their last used brush can
be useful too (e.g. assigning shortcut to eraser tool to switch back to last
used eraser, rather than a specific eraser brush).

Note that further changes are planned, to get a true "best of both worlds"
design, where people can use a global brush library without having to worry
about tools, but brushes can also be accessed via tool categorization.
The new design works well with both mental models without being a compromise
in-between.

a79f9100a6 already brought back some tool for grease pencil draw mode, with this
commit the design is now applied to all sculpt & paint modes.

See PR for a list of tools that were brought back.

Design Task: https://projects.blender.org/blender/blender/issues/128066
Pull Request: https://projects.blender.org/blender/blender/pulls/128038
2024-10-01 18:03:33 +02:00
Nika Kutsniashvili
d70b10dcd4 UI: Add missing items & reorganize grease pencil menus
Some important operators & menus (like gesture select & animation)
were missing from grease pencil menus, and some of them had
inconsistent labels/placements.

Pull Request: https://projects.blender.org/blender/blender/pulls/128427
2024-10-01 17:04:50 +02:00
Pablo Vazquez
e9bce13bfb UI: Fix case in Grease Pencil Auto-Masking
Every word should be capitalized, as established in the guidelines.

Matches mesh sculpt Auto-Masking.
2024-10-01 16:37:20 +02:00
Campbell Barton
a7ab81d927 PyAPI: remove use of BaseException
BaseException was used as a catch-all in situations where it
didn't make sense and where "Exception" is more appropriate
based on Python's documentation & error checking tools,
`pylint` warns `broad-exception-caught` for e.g.

BaseException includes SystemExit, KeyboardInterrupt & GeneratorExit,
so unless the intention is to catch calls to `sys.exit(..)`,
breaking a out of a loop using Ctrl-C or generator-exit,
then it shouldn't be used.

Even then, it's preferable to catch those exceptions explicitly.
2024-10-01 13:18:46 +10:00
Campbell Barton
58fe7c9b22 Cleanup: remove unused imports, exception values 2024-10-01 10:24:22 +10:00
Campbell Barton
4c36f9a566 Cleanup: simplify attribute access
Avoid getattr(..) when values are know to exist.
2024-10-01 10:23:04 +10:00
Campbell Barton
0afce08c20 Cleanup: use Python format specifiers 2024-10-01 10:14:48 +10:00
Campbell Barton
6cbdf0223b Cleanup: defer imports on startup 2024-10-01 10:01:16 +10:00
Colin Basnett
22d78c5a8e Geometry Nodes: add Matrix Determinant node
Pull Request: https://projects.blender.org/blender/blender/pulls/128212
2024-09-30 21:30:10 +02:00
Jacques Lucke
b22a1499a4 Geometry Nodes: remove "Zone" from menu entries
This was accepted in #128384. The term "zone" is known well enough now
that it's not really necessary to show it in the menu anymore.
2024-09-30 17:09:00 +02:00
Jacques Lucke
70cdfabf79 Geometry Nodes: shorten foreach zone menu entry
This changes the name from `For Each Geometry Element` to just `For Each
Element`. While we might have more foreach zones in the future, it's not clear
yet whether the longer name will be necessary to differentiate the zones. So
better just use the better looking name for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/128384
2024-09-30 17:04:36 +02:00
priera
ce7667f3b1 GPv3: Join Operator
Adds the `Join` operator in edit mode to connect the selected strokes
by their endpoints.

Resolves #113582 and #113570.

Pull Request: https://projects.blender.org/blender/blender/pulls/117916
2024-09-30 12:16:40 +02:00
Pablo Vazquez
05a398cf45 UI: Preferences: Align new Editor properties
Place all Editor properties in an aligned column on top of other
more general widget properties.
2024-09-27 18:03:47 +02:00
Falk David
19465bec19 GPv3: Add canvas options to the overlay settings
This adds the color, subdivisions, scale, and offset options to the canvas overlay.

Pull Request: https://projects.blender.org/blender/blender/pulls/128259
2024-09-27 16:58:38 +02:00
Falk David
954f723421 Cleanup: GPv3: Remove duplicated "Add Extra" menu
This got duplicated by mistake during a merge.
2024-09-27 16:53:31 +02:00
Lorenzo-Carpaneto
29c6e6c5b2 GPv3: "Select Similar" operator
Implements the "Select Similar" operator for Grease Pencil v3.

Several modes are available. Each mode has a dedicated "distance" metric:
- layer, material: compared by index
- radius, opacity: simple value difference
- vertex color: euclidian float4 distance metric

The implementation uses a `Set` to find selected values first, then compare each point attribute value to each value in the set until a distance below the threshold is found. This could be optimized by using a KD-Tree in the future. Layer comparison is a special case because points are already separated into drawings by layer, so any drawing in a "selected" layer is becomes fully selected.

Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/111410
2024-09-27 16:51:19 +02:00
casey bianco-davis
a75259fa14 GPv3: Make the Remove button work with groups.
This makes the `remove` delete groups when active.
The items inside of the group will not be deleted (i.e. `ungroup`)

Pull Request: https://projects.blender.org/blender/blender/pulls/128002
2024-09-27 16:39:59 +02:00
Christoph Lendenfeld
85e4bd19f6 Anim: Separate Slots operator
This adds an operator that splits all slots of the action on the active object,
into separate actions.

The newly created actions will be named `slot_name+Action`.
All users of those slots will be reassigned to this new action.

The exploded action will not be deleted, but will end up with 0 users
unless a fake user is set.

------

For the review, does that operator name make sense?

Pull Request: https://projects.blender.org/blender/blender/pulls/128251
2024-09-27 16:39:29 +02:00
Sybren A. Stüvel
ad2207243a Anim: invisible UI tweak for Action and Slot selectors in Properties Editor
Set `use_property_decorate = False` in the Animation panels in the
Properties editor. This has no visual effect right now, but if we ever
decide to add labels to the selectors, this will ensure that the layout
remains correct.

Context: `layout.template_action()` and `layout.template_search()` respond
differently to the default of `use_property_decorate = True`.
2024-09-27 16:33:27 +02:00
casey bianco-davis
04a3916a3a GPv3: Add Add Group button under the Add Layer button
This adds a button for creating a new group/folder.
Having this as an exposed button makes it faster to create groups.

This also removes the entry for adding a group in the extra menu
since it's no longer needed there.

Pull Request: https://projects.blender.org/blender/blender/pulls/128000
2024-09-27 16:23:11 +02:00
Campbell Barton
a9dee36974 Cleanup: remove unused variables, imports 2024-09-27 23:37:18 +10:00
Christoph Lendenfeld
95b6cf0099 Anim: operator to move Slots to new action
This adds an operator that moves slots of slot channels selected in
the channel box to a new action.

All slots are moved together into that new action instead of
moving them into separate actions.
I think that's more reasonable because that way the "move slots into separate actions" is
still possible by selecting the slots one by one.
The "explode action" operator that does just that can be a separate operator.

The new action is named after the slot for the case when only one slot is moved.
When multiple slots are moved, the name "CombinedAction" is used.

This also adds a menu entry "Action" to the action editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/128171
2024-09-27 14:34:24 +02:00
Pratik Borhade
59aaf322ba GPv3: Select operations in sculpt mode
Select panel is missing when any selection mask is selected.
Also fix the poll function so operators can be accessed.

Pull Request: https://projects.blender.org/blender/blender/pulls/128177
2024-09-27 13:23:02 +02:00
Falk David
53b9594ee2 Geometry Nodes: Add "Merge Layers" node
This patch improves working with grease pencil layers in geometry nodes.
* Allow layers to have duplicate names in geometry nodes. In original data, unique names are enforced.
  * This allows e.g. duplicating layers and then merging them by name in the end.
  * It also resolves a big serial bottleneck when working with many grease pencil layers in geometry nodes. Enforcing unique names is inefficient.
* New `Merge Layers` node that can merge multiple layers by name or by a custom group id.
* Applying a grease pencil modifier now first merges all layers with the same name to ensure all names are unique.

Co-authored-by: Jacques Lucke <jacques@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/127873
2024-09-27 13:17:18 +02:00
Falk David
34f03b85e3 GPv3: Hide "Add Group" operator in dopesheet
This was changed in 9b0160ffb6 to make it
show in the 3D viewport, but this should still be hidden in the dopesheet.
2024-09-27 13:15:16 +02:00
Harley Acheson
28e5c1412e UI: Editor Edge Highlighting
Customizable highlighting of editor edges that can be used to help
differentiate between areas, indicate active area, and/or help users
with visual impairment. Can be completely removed as well. This
replaces the active area header highlighting, which doesn't work for
transparent headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/116684
2024-09-26 21:55:26 +02:00
Sybren A. Stüvel
147d8aad54 Anim: Show Action Slot type in panel + change type icon RNA prop
Anim: Show Action Slot type in panel + change type icon RNA wrapper name

This PR combines two changes, both necessary to properly show the
Action Slot ID type in the GUI:

1. Expose the slot's ID type as an RNA enum property `id_root`, in the
   same way that the DNA `Action::idtype` is exposed as
   `Action.id_root` in RNA. The only differences are that this
   property is read-only on slots (it is supposed to be correct, and
   if it's not, I'd prefer a bug report over people working around
   this), and that the default value is named differently (`ANY` on
   Actions, `UNSPECIFIED` on Slots). The latter is done to clarify
   that this is not a situation that will last for long; as soon as
   the slot is assigned to any ID, it will be locked to that ID type.

2. Rename the RNA property `ActionSlot.idtype_icon` to
   `ActionSlot.id_root_icon` to be consistent with the above.

And of course the type is drawn in the Slot properties panel in the
Action editor. This now replaces the icon in the slot name (in the
same panel), so that it's clearer that that is the slot name, and not
an object/material/whatevertype name.
2024-09-26 15:33:44 +02:00
Casey Bianco-Davis
9b0160ffb6 Cleanup: GPv3: Share layer menu drawing code
Share layer menu drawing code to reduce duplication
and guaranty they are the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/128005
2024-09-25 10:30:14 +02:00
Harley Acheson
8450aa275f UI: Area Docking as Regular Feature, Not Experimental
This PR makes "Interactive Editor Docking" a regular feature, available
by default, and removes the option from Experimental Preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/127810
2024-09-24 23:23:48 +02:00
Sean Kim
591f4c0e59 Sculpt: Add Mask from Boundary Operator
This commit adds the Mask from Boundary operator, which creates or
otherwise modifies a mask based on the the mesh boundary or the face
set boundaries of the mesh.

Conceptually, it behaves similarly to the corresponding automasking
options and the existing Mask from Cavity operator. When applying this
setting, it either uses the global scene value, the brush specific
value, or the operator-defined values. As such, it is exposed in the
existing automasking menus and inside the main Mask menu in Sculpt mode.

Based on this [1] RCS request.

[1] https://blender.community/c/rightclickselect/DYKy/

Pull Request: https://projects.blender.org/blender/blender/pulls/127787
2024-09-24 18:02:30 +02:00
casey bianco-davis
a0021ed862 GPv3: Move layer operator.
Add `move layer` operator and move UI to match the legacy Grease Pencil's UI.
This will also move groups when selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/127999
2024-09-24 14:59:11 +02:00
Falk David
c496ad20c8 GPv3: Draw Mode: Reorder tools in toolbar
These changes were discussed in the previous [module meeting](https://devtalk.blender.org/t/2024-09-23-grease-pencil-module-meeting/36748).
* The primitive tools are grouped together, the default is the box primitive.
* The order of draw tools now is 1) Draw 2) Erase 3) Fill 4) Primitives

Pull Request: https://projects.blender.org/blender/blender/pulls/128062
2024-09-24 13:41:05 +02:00
Jacques Lucke
6e5e01e630 Geometry Nodes: new For Each Geometry Element zone
This adds a new type of zone to Geometry Nodes that allows executing some nodes
for each element in a geometry.

## Features

* The `Selection` input allows iterating over a subset of elements on the set
  domain.
* Fields passed into the input node are available as single values inside of the
  zone.
* The input geometry can be split up into separate (completely independent)
  geometries for each element (on all domains except face corner).
* New attributes can be created on the input geometry by outputting a single
  value from each iteration.
* New geometries can be generated in each iteration.
    * All of these geometries are joined to form the final output.
    * Attributes from the input geometry are propagated to the output
      geometries.

## Evaluation

The evaluation strategy is similar to the one used for repeat zones. Namely, it
dynamically builds a `lazy_function::Graph` once it knows how many iterations
are necessary. It contains a separate node for each iteration. The inputs for
each iteration are hardcoded into the graph. The outputs of each iteration a
passed to a separate lazy-function that reduces all the values down to the final
outputs. This final output can have a huge number of inputs and that is not
ideal for multi-threading yet, but that can still be improved in the future.

## Performance

There is a non-neglilible amount of overhead for each iteration. The overhead is
way larger than the per-element overhead when just doing field evaluation.
Therefore, normal field evaluation should be preferred when possible. That can
partially still be optimized if there is only some number crunching going on in
the zone but that optimization is not implemented yet.

However, processing many small geometries (e.g. each hair of a character
separately) will likely **always be slower** than working on fewer larger
geoemtries. The additional flexibility you get by processing each element
separately comes at the cost that Blender can't optimize the operation as well.
For node groups that need to handle lots of geometry elements, we recommend
trying to design the node setup so that iteration over tiny sub-geometries is
not required.

An opposite point is true as well though. It can be faster to process more
medium sized geometries in parallel than fewer very large geometries because of
more multi-threading opportunities. The exact threshold between tiny, medium and
large geometries depends on a lot of factors though.

Overall, this initial version of the new zone does not implement all
optimization opportunities yet, but the points mentioned above will still hold
true later.

Pull Request: https://projects.blender.org/blender/blender/pulls/127331
2024-09-24 11:52:02 +02:00
casey bianco-davis
1b6220a4ba GPv3: Fill gradient tool
This adds a gradient tool allowing the user to specify a gradient by dragging from a start to a end point.
This behaves the same as most gradient tool in other softwares.

Pull Request: https://projects.blender.org/blender/blender/pulls/120121
2024-09-24 11:25:28 +02:00
Jeroen Bakker
5c8ce24d40 Preferences: Don't show preferred device in OpenGL
When overriding the GPU backend to OpenGL from the command line the
vulkan device was still visible in the preferences. This is fixed by
testing both the active backend and the backend in the preferences to be
vulkan.
2024-09-24 09:46:40 +02:00
Bastien Montagne
8c3a3bb9a3 Fix #128006: Liboverride objects can be renamed using batch rename.
Do not allow renaming liboverride IDs from batch-rename either.

Users who really want to rename liboverrides should use python/RNA API
instead, this should not be exposed to standard UI tools (as renaming
liboverride IDs can lead to quite some confusing setups).
2024-09-23 15:45:02 +02:00
Charlie Jolly
bf04513dec Geometry Nodes: new Integer Math node
Provide building block support for integer operations.

Manipulation of integer based data should not be limited to using float math nodes.
Using float math comes with accuracy issues for larger integers and requires unnecessary
type conversions.

The node also adds some integer specific operations like GCM and LCD.

Pull Request: https://projects.blender.org/blender/blender/pulls/110735
2024-09-23 15:01:31 +02:00
dupoxy
c07b89b329 Fix #127968: Add label to the grease pencil overlays Panel
Pull Request: https://projects.blender.org/blender/blender/pulls/127972
2024-09-23 13:11:22 +02:00