Commit Graph

1084 Commits

Author SHA1 Message Date
Hans Goudey
f4867c0d70 Geometry Nodes: Add Rotate Rotation node
This is meant as a replacement for the Rotate Euler node. Overall it
should be more performant, and the clarity given by the separate socket
type should help distinguish its purpose.

The Rotate Euler node is removed from search and the add menu by this
commit. In the future it can be versioned away. That isn't done now to
avoid a breaking API change and to make this commit less risky.

Pull Request: https://projects.blender.org/blender/blender/pulls/116106
2024-02-01 14:29:30 +01:00
casey bianco-davis
1b6e3d46a9 GPv3: Add stroke_reorder operator
This implements the `stroke_arrange` operator for grease pencil v3.
This behaves the same as `GPENCIL_OT_stroke_arrange` but renamed to `stroke_reorder`.
It should be more clear what the operator does.

Note: This also adds new key binds.

Co-authored-by: Falk David <filedescriptor@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/116682
2024-02-01 13:15:23 +01:00
Campbell Barton
c9ad858d9d Extensions: update manifest to bl_info conversion
Update extension to bl_info conversion to account for recent changes.
2024-02-01 22:42:24 +11:00
Campbell Barton
fb29925158 Extensions: support addon_utils.module_bl_info() for enabled extensions
Add-ons "bl_info" was supported for add-ons which weren't registered,
however the real modules weren't handled causing module_bl_info()
to return dummy values when an extensions add-ons module was passed in.

This caused the minimum Blender version check after enabling an add-on
to do nothing.

Now the "bl_info" from extension modules is ignored and the bl_info
is created on demand from the manifest.
2024-02-01 17:11:15 +11:00
Campbell Barton
355fd2313d Extensions: detect time-stamp changes to extensions manifest on refresh
- Add a warning when an extensions meta-data is missing.
- Remove the time-stamps from message that time-stamps have changes
  since knowing the exact times isn't helpful.
2024-02-01 17:03:47 +11:00
Campbell Barton
3906bf0174 Extensions: only hide the add-ons UI when the panel has been extended
Now disabling the extensions add-on restores the original UI.
2024-02-01 17:03:44 +11:00
Campbell Barton
dd641d15d0 Fix is_extended method for UI classes (menu, panel, headers... etc)
Appending then removing a draw function caused the is_extended()
method to return true afterwards, resolve by checking if there are
multiple draw functions.
2024-02-01 17:03:42 +11:00
Campbell Barton
a8e73616b9 Cleanup: rename add-on related variables for clarity
- Rename info to bl_info, to avoid confusion with extensions manifest,
  which should eventually be accessible in a similar way.
- Rename module_name to addon_module_name to avoid confusion with
  extension repositories name-spaced modules.
- Clarify naming for TOML manifest.
2024-02-01 17:03:40 +11:00
Harley Acheson
93562a1cc5 UI: Image Rotate
Operator to rotate images in 90 degree increments.

Pull Request: https://projects.blender.org/blender/blender/pulls/117352
2024-01-31 23:36:28 +01:00
Lukas Tönne
7e7165b085 GPv3: Basic vertex group operators
Adds vertex groups and basic operator support to the `GreasePencil` data
block.

Vertex groups in the `GreasePencil` ID are used as the source of truth
for vertex groups names and ordering in the UI. Individual drawings also
have vertex group lists, but they should not be modified directly by
users or the API. The main purpose of storing vertex group names in in a
drawing's `CurveGeometry` is to make it self-contained, so that vertex
weights can be associated with names without requiring the
`GreasePencil` parent data.

Vertex group operators are implemented generically for some ID types.
Grease Pencil needs its own handling in these operators. After
manipulating `vertex_group_names` the `validate_drawing_vertex_groups`
utility function should be called to ensure that drawings only contain a
true subset of the `GreasePencil` data block.

Operators for assigning/removing/selecting/deselecting vertices are also
implemented here. To avoid putting grease pencil logic into the generic
`object_deform.cc` file a number of utility functions have been added in
`BKE_grease_pencil_vgroup.hh`.

Fixes #117337

Pull Request: https://projects.blender.org/blender/blender/pulls/117476
2024-01-31 17:45:59 +01:00
Lukas Tönne
53da2b2d48 Support for enum items parameter in rna_idprop_ui_create
This is an optional parameter for int properties, which then show up as
enum properties.

Included fix: reset ID properties' enum items when the `items` parameter is `None`.

Example usage:
```python
import rna_prop_ui
# Add a regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=123, min=-3, max=500)
# Change to an enum property with items (min/max are ignored).
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=0, min=-10, max=10, items=[("APPLES", "Apples", ""), ("ORANGES", "Oranges", "")])
# Switch back to regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=1, min=0, max=10)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/117289
2024-01-31 13:27:15 +01:00
Campbell Barton
fb16dbf9ae Extensions: support authors as a list from the TOML manifest
Also fix blank errors caused by catching assertions which resulted
in empty strings.
2024-01-31 17:43:44 +11:00
Scurest
f87cc8ca8f Addon: catch certain ZIP packaging errors in addon_install
One error that occurs when packaging a multi-file addon into a ZIP is
zipping the contents of the addon, instead of the addon directory.
When installing the ZIP using addon_install, the files that should be
inside a directory instead get extracted into the top-level of the
script directory. There was also no user feedback about what went wrong.

Detect this case and fail with an error.

Ref: !117664
2024-01-31 10:01:50 +11:00
YimingWu
4722c801c5 GPv3: Thickness modifier
Thickness modifier ported to Grease Pencil v3.

Note: Uniform thickness range and UI step changed to better
match new thickness of blender unit.

![image](/attachments/2e9c9bfa-d869-4bec-a529-c3833390a201)

Pull Request: https://projects.blender.org/blender/blender/pulls/117631
2024-01-30 13:04:30 +01:00
Lukas Tönne
0daa426739 GPv3: Mirror modifier
Implements the mirror modifier from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/117637
2024-01-30 12:10:33 +01:00
Philipp Oeser
5a6034654c Fix #117547: RBD Bake to Keyframes no longer working
Since a99e419b6e, we now have to use `keyframe_insert_by_name` when
inserting keyframes with a specified keying set.

Pull Request: https://projects.blender.org/blender/blender/pulls/117624
2024-01-30 10:54:05 +01:00
Campbell Barton
6ab800c5a8 Extensions: remove additional Extensions section in the preferences
Now extensions reuse the add-ons, renaming this section when
the experimental extensions option is enabled.
2024-01-30 17:59:53 +11:00
Campbell Barton
2cf993f9a0 Refactor: extract add-on preferences drawing into a static method
This allows it to be used by the extensions UI.
2024-01-30 16:55:38 +11:00
Sean Kim
a2b3fe5e01 Sculpt: Add per-brush input samples
This pull request adds the ability for users to specify input samples
on a per brush basis. The existing field in the main `Paint` struct
forces all brushes of a particular tool type to use the same value.
A new field was added to the `Brush` struct to allow for this value
to be specified there instead, and a corresponding unified value in
`UnifiedPaintSettings` has been created to allow users to use the
same value across all brushes.

Addresses #108109

Pull Request: https://projects.blender.org/blender/blender/pulls/117080
2024-01-30 05:08:23 +01:00
Campbell Barton
dd7362d6e2 Cleanup: use a dictionary for add-on lookups
Replace the set of known add-ons with a dictionary to avoid a slower
string lookup for add-on preferences.
2024-01-30 14:30:03 +11:00
Campbell Barton
67cc9da7ba Extensions: move repositories into a popover
Part of changes proposed in #117285.

Unfortunately layout panels aren't supported in popovers, so this has
been worked around using a kludge that stores the expanded state as a
class member, toggled via "wm.context_toggle".
2024-01-30 13:17:58 +11:00
Campbell Barton
73214e9b26 Extensions: change the manifest filename
Use the name "blender_manifest.toml" for clarity.
2024-01-30 09:42:01 +11:00
Hans Goudey
4fa780d334 Fix: Sort Index Switch node alphabetically in add menu 2024-01-29 16:33:12 -05:00
YimingWu
56439d88f5 GPv3: Noise modifier
This ports the noise modifier to GPv3.
There should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/117057
2024-01-29 16:49:16 +01:00
Sean Kim
c61d1bcb54 Sculpt: Add global automasking propagation steps
This pull request adds the ability for the `propagation_steps` value
for certain automasking settings to be applied globally instead of
using the per-brush attribute.

Previously, while the flag settings were stored at the brush and global
level,  the `propagation_steps` value would always change the brush
attribute even when using the global menu.

Addresses #102377

Pull Request: https://projects.blender.org/blender/blender/pulls/117316
2024-01-29 15:39:34 +01:00
Brecht Van Lommel
cbb0a96443 Cleanup: make format 2024-01-28 11:59:10 +01:00
Hans Goudey
e8b7731d7c UI: Use icon for curves surface UV map property
Also just show the button inactive rather than disabling it,
as done elsewhere in the UI.
2024-01-26 19:06:32 -05:00
Falk David
73e5e975e2 Cleanup: GPv3: Add fixme comment to _defs_paint_grease_pencil 2024-01-26 15:24:00 +01:00
Falk David
cb9fef3841 Cleanup: GPv3: Default keymap definitions 2024-01-26 15:24:00 +01:00
Lukas Tönne
5ad49f4142 Geometry Nodes: Menu Switch Node
This patch adds support for _Menu Switch_ nodes and enum definitions in
node trees more generally. The design is based on the outcome of the
[2022 Nodes Workshop](https://code.blender.org/2022/11/geometry-nodes-workshop-2022/#menu-switch).

The _Menu Switch_ node is an advanced version of the _Switch_ node which
has a customizable **menu input socket** instead of a simple boolean.
The _items_ of this menu are owned by the node itself. Each item has a
name and description and unique identifier that is used internally. A
menu _socket_ represents a concrete value out of the list of items.

To enable selection of an enum value for unconnected sockets the menu is
presented as a dropdown list like built-in enums. When the socket is
connected a shared pointer to the enum definition is propagated along
links and stored in socket default values. This allows node groups to
expose a menu from an internal menu switch as a parameter. The enum
definition is a runtime copy of the enum items in DNA that allows
sharing.

A menu socket can have multiple connections, which can lead to
ambiguity. If two or more different menu source nodes are connected to a
socket it gets marked as _undefined_. Any connection to an undefined
menu socket is invalid as a hint to users that there is a problem. A
warning/error is also shown on nodes with undefined menu sockets.

At runtime the value of a menu socket is the simple integer identifier.
This can also be a field in geometry nodes. The identifier is unique
within each enum definition, and it is persistent even when items are
added, removed, or changed. Changing the name of an item does not affect
the internal identifier, so users can rename enum items without breaking
existing input values. This also persists if, for example, a linked node
group is temporarily unavailable.

Pull Request: https://projects.blender.org/blender/blender/pulls/113445
2024-01-26 12:40:01 +01:00
Sybren A. Stüvel
848f83e210 Anim: bone collections, add 'un-solo all' operator
Add an operator that clears the 'solo' flag from all bone collections.
2024-01-26 11:09:06 +01:00
Sybren A. Stüvel
f623c8f7bc Anim: remove 'Solo Visibility' bone collections operator
Remove the 'Solo Visibility' operator that singles out a bone collection.
It was a workaround for not having a true 'solo' flag, which is there
now.
2024-01-26 11:05:00 +01:00
Christoph Lendenfeld
d05d6f500b Fix: Consistency for appearing menu when applying keying sets
The recently landed PR #115798has made it so the
hotkey `K` would call `anim.keyframe_insert_menu` with the property
`always_prompt` set to `True`.
This property still defaulted to `False` when called
from the menu leading to inconsistent
behavior when a keying set is active.

Fix it by setting `always_prompt` to `True` for the menu entries.

Pull Request: https://projects.blender.org/blender/blender/pulls/117511
2024-01-25 16:18:05 +01:00
Christoph Lendenfeld
87fc8e8ddd Anim: Add hotkey for keying set operators
This is in response to feedback to the changes from #113504
While it does simplify inserting keyframes,
sometimes artists want to insert keys only to e.g. Location.
This takes longer to do now, since the option is in a menu.

This PR changes the following:

* new `K` hotkey to bring up the "Keying Set" menu.
This will always show the menu, even if a keying set is active.

* `Shift + K` will open a menu to set the active keying set

* with "Pie Menu on Drag" enabled in the user preferences,
hitting `I` and moving the mouse will bring up a pie menu
to insert only specific transform channels

Conceptually this separates the keying set behavior from the
insert keyframe behavior.
`I` will always add keyframes.
While `K` always shows keying set options.

Pull Request: https://projects.blender.org/blender/blender/pulls/115798
2024-01-25 14:46:04 +01:00
Campbell Barton
8841990764 Extensions: use the TOML manifest as a source for extensions bl_info 2024-01-25 14:36:20 +11:00
Campbell Barton
b686f2a536 UI: show the version as a string for extensions
Extensions use SEMVER, not a tuple of numbers.
2024-01-25 14:36:20 +11:00
Campbell Barton
f212be48ee Cleanup: reduce right shift in add-ons UI 2024-01-25 14:36:20 +11:00
Campbell Barton
4e3d24d7b5 Cleanup: assign variables for items in the add-ons UI 2024-01-25 14:36:20 +11:00
Campbell Barton
6aede44fb7 PyAPI: remove checks for add-ons pre 2.8x
This made sense when migrating from 2.7x, now 2.8x add-ons may also
have issues in 4.1 so this check isn't so relevant.
2024-01-25 13:00:48 +11:00
Campbell Barton
b8b1189bc4 Cleanup: assign a variable for the extension module with a trailing "."
This is used in enough places to simplify checks.
2024-01-25 13:00:48 +11:00
Campbell Barton
0ea0573349 PyDoc: remove unnecessary newlines which caused invalid syntax
Resolves all warnings building Python docs.
2024-01-25 10:22:15 +11:00
Sun Kim
d8fbf38808 UI: Show user-oriented tooltip for extra options panel
Show "Extra options" as tooltip for the Tool Settings Extra Options item.

Pull Request: https://projects.blender.org/blender/blender/pulls/117193
2024-01-24 17:25:39 +01:00
Lukas Tönne
7e87513368 GPv3: Offset modifier
Ported the Offset modifier from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/117446
2024-01-24 16:57:58 +01:00
YimingWu
b6e5b02ede Cleanup: GPv3: Use consistent modifier RNA names
"GREASEPENCIL_" changed to "GREASE_PENCIL_".
2024-01-24 21:20:42 +08:00
Sean Kim
1e4f133950 Sculpt: Add brush settings for view & normal automasking values
This pull request adds the ability for the `Limit` and `Falloff` values for the View and Normal automask modes to be applied per-brush instead of modifying the global tool value.

Previously, while the flag settings were stored at the brush and global level, the values would always change the global value even when using the advanced tab of the brush menu.

## Testing
* `make test` results in 3 failures (49 - io_wavefront, 134 - compositor_distort_cpu, 323 - imbuf_save), but these tests appear to fail even prior to any changes being applied when running locally
* Manual testing with older version blend files to ensure that the value is defaulted correctly.
* Visual testing to verify that brush values are favored over global values.

Addresses #115174

Pull Request: https://projects.blender.org/blender/blender/pulls/117433
2024-01-24 10:59:50 +01:00
Campbell Barton
56ccc9cdd9 Fix missing import in 9cc6ee75e7 2024-01-24 17:06:57 +11:00
Campbell Barton
9cc6ee75e7 Extensions: support using a default local user directory
This is needed so extensions repositories can reference
user-script directories without them having hard-coded paths
which will be invalid when upgrading a Blender version.
2024-01-24 16:50:32 +11:00
YimingWu
f54348edc9 GPv3: Smooth modifier
Smooth modifier ported to Grease Pencil 3.0

Exposed `smooth_curve_attribute()` from `grease_pencil_edit.cc`
to achieve the smoothing effect. It will not be the exact same result
as the old algorithm.

Pull Request: https://projects.blender.org/blender/blender/pulls/116975
2024-01-24 04:36:36 +01:00
Campbell Barton
53a8570aec Extensions: enable the package management add-on when enabled
Package management has been moved into addons_contrib so the addon
can be enabled when enabling extension repositories.

This means users can test extension repositories without having to
install a separate add-on.

Additional work is still needed with the server before this is ready
for general testing though.

Part of #117286.
2024-01-24 13:25:27 +11:00
Hans Goudey
0284715ab4 Cleanup: Make format 2024-01-23 07:56:49 -05:00