Removes many of the operators, panels, and menus used exclusively by Grease Pencil v2 that are no longer needed in v3.
No functional changes are expected.
Some operators are still used by the annotations system and have to be kept around. These may be renamed in future.
Pull Request: https://projects.blender.org/blender/blender/pulls/128521
Hides the brush asset shelf by default in weight paint, grease pencil
weight paint and grease pencil vertex paint mode. These only have one
bundled brush per tool available.
After bringing back some tools for brushes in certain modes
(3798852071), we want to hide the asset shelf in modes where there's
only one brush bundled per tool. While having these tools support
brushes can be useful, we don't expect to bundle more brushes soon. So
avoid a mostly empty asset shelf for a single brush by hiding it by
default and keeping it hidden until the user expands it (bf52f6f723 made
it possible to remember the visibility per mode).
Part of #128066 and #116337.
Layer panel (also mask/ transform etc.) and other operators are gone
when properties tab is pinned and gpv3 object is non-active.
To fix this, get grease pencil pointer from `button_context()`
(done in `grease_pencil_context()`).
Continuation of cd476226d8
Pull Request: https://projects.blender.org/blender/blender/pulls/128475
Part of: https://projects.blender.org/blender/blender/issues/128066
Adds a "Filter by Active Tool" option for the brush asset shelves,
enabled by default. If enabled, the asset shelf only shows brushes
matching the brush type of the current tool. If the general "Brush" tool
is active, only brushes that are not covered by another tool are
displayed. The popup brush selector always shows all assets.
The option is stored in the Preferences, toggled in the "Display
Settings" popover of the asset shelf.
Note: This is committed to the 4.3 release branch, which was discussed
in advance.
Pull Request: https://projects.blender.org/blender/blender/pulls/128450
This adds feature parity with Cycles regarding light and shadow liking.
Technically, this extends the GBuffer header to 32 bits, and uses
the top bits to store the object's light set membership index.
The same index is also added to `ObjectInfo` in place of padding bytes.
For shadow linking, the shadow blocker sets bitmask is stored per
tilemap. It is then used during the GPU culling phase to cull objects
that do not belong to the shadow's sets.
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/127514
The paint, sculpt, and vertex-paint modes already have separate context
menu classes from GPv2. The GPv2 classes will be removed, this is just
a small refactor to prevent this change from getting lost in a big
cleanup PR. No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/128530
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
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
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
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.
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
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
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
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
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
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.
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
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
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
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`.
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
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
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
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
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.