Commit Graph

3492 Commits

Author SHA1 Message Date
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
Nika Kutsniashvili
5a0b50e0a6 Anim: Reorganize items in 'View' menus in animation and video editors
View menu in animation and video editors are too
different from each other and unorganized.
Same operators appear in different places in different editors.
That makes navigating them harder, because for example
you expect framing operators at the bottom because they're
at the bottom in graph editor, but they're at the top in Sequencer
and 3D Viewport. It's important that ordering of operators
match as well as possible, so that users can expect certain
operators in certain places and dont spend time searching
for buttons in messy menus.

I tried to match ordering to 3D viewport menu
as much as possible, and also to use separators right,
so that grouping of items is logical and can be shareable between editors.

This grouping also looks better and makes navigation easier,
because it splits huge pile of toggles at the top of the menus
in smaller chunks and puts operators between them,
so they're esier to separate them in one glance.

Split off from #116492

Pull Request: https://projects.blender.org/blender/blender/pulls/117162
2024-01-23 12:11:22 +01:00
Campbell Barton
c80a6d5b0f UI: remove addons categories when extensions are enabled
Part of #117285.
2024-01-23 17:33:22 +11:00
Campbell Barton
25e15660ac UI: rename extension repositories panel and close by default
Ref #117285.
2024-01-23 15:22:55 +11:00
Campbell Barton
b4e869e2fc Cleanup: quiet warnings when reloading scripts
Some UI classes weren't unregistered which caused a warning when
reloading scripts (since [0]). Register/Unregister these classes along
with the classes of other sub-modules.

[0]: c5e2ec8a1a
2024-01-23 14:17:02 +11:00
Campbell Barton
8a9db8cfa7 Cleanup: remove redundant iface_ call 2024-01-23 14:06:41 +11:00
Campbell Barton
1fa896bb9a Cleanup: move bl_description to doc-strings
This is already done almost everywhere, prefer doc-strings unless
there is a reason for the tool-tip and Python doc-string to differ.
2024-01-23 13:59:15 +11:00
Sybren A. Stüvel
9e5cdf52f6 Cleanup: fix indent in anim.py 2024-01-22 16:45:29 +01:00
Sybren A. Stüvel
a7354fb2af Anim: add operator to remove unused bone collections
Add an operator to remove all unused bone collections. This is added to
the bone collections "specials" menu and the tree view context menu.

A bone collection is considered "unused" when it has no bones assigned,
and also no child collection that has bones assigned.
2024-01-22 13:34:25 +01:00
Sybren A. Stüvel
6b8c64fc69 Anim: create new bone collections as next sibling of active one
Bone collections created via the `bpy.ops.armature.collection_new`
operator now always become the next sibling of the active bone
collection. If there is no active one, the new one is added at the end
of the list as root.

This removes the `.parent_index` property of the operator, as it is now
always created relative to the active bone collection.
2024-01-22 10:34:30 +01:00
Campbell Barton
a1761b7c8c UI: adjust the add-ons interface when extensions repositories enabled
- Group Extensions with Add-ons in preferences.
- No more official/community/testing, install and refresh.
- No more showing category on the headers
  (there are no categories for extensions).

Changes proposed in #117285.
2024-01-22 17:47:33 +11:00
Campbell Barton
c866c93b06 Cleanup: import UIList, following the convention for other UI classes 2024-01-22 12:44:56 +11:00
Campbell Barton
829d08ca42 Cleanup: move addon_category_name into an internal class method 2024-01-22 12:44:54 +11:00
Campbell Barton
f0357220c0 Cleanup: don't pass UI text through iface_ twice 2024-01-22 12:44:53 +11:00
Guillermo Venegas
d7aa1988d1 UI: Replace list of workspace add-ons with a UIList
The list of add-ons could be long without the ability to search or
scroll the list. Using a UI-list.

Resolves #111272

Ref !112684
2024-01-22 12:44:37 +11:00
Brecht Van Lommel
2afd9e530a Fix: wrong name in bpy_extras.object_utils, causing API doc build failure 2024-01-19 19:03:33 +01:00
Lukas Tönne
baeb4d7753 GPv3: Tint and Color modifiers
Implements the Tint and Color (aka. "Hue/Saturation") modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/117297
2024-01-19 16:59:39 +01:00
Christoph Lendenfeld
5e28601d69 Anim: Separate keying flags
Splits the flag `..._FLAG_INSERTNEEDED` between autokey and
manual keying. The fact that this flag was shared between the two
systems has been the cause of issues in the past. It wouldn't
let you insert a keyframe even though you explicitly used an operator
to do so.

In order to be clearer what options are used where, the user preferences
have been reordered.

By default "Only Insert Needed" will be enabled for auto-keying, but not for manual keying.
The versioning code will enable both if it was enabled previously.

# Code side changes

The keying system has flags that define the behavior
when keys are inserted. Some of those flags were shared
between keying and auto-keying. Some were only used for
auto-keying.
To clarify that, prefix flags that used exclusively in one or the other
system with `AUTOKEY`/`MANUALKEY`

Also the flag name on the user preferences and the tool settings was renamed.
Previously it was called `autokey_flag`. To indicated that it is not only used
for autokeying, rename it `keying_flag`.

Fixes: #73773

Pull Request: https://projects.blender.org/blender/blender/pulls/115525
2024-01-19 16:26:10 +01:00
Lukas Tönne
b157b80462 Grease Pencil: Use a "Color" modifier category for GP2 compatibility
This will be used for Opacity/Tint/Color modifiers which change color
attributes of grease pencil objects. The category is not shown for other
object types.
2024-01-19 11:35:26 +01:00
Campbell Barton
7daf900181 Cleanup: spelling in comments, remote debug print 2024-01-19 17:28:14 +11:00
Campbell Barton
665472a18b Extensions: changes to repositories are now accounted for by add-ons
Add-ons using the extension API now follow changes to their
repositories.

- Removing a repository disables and removes associated add-ons.
- Disabling a repository disables the add-on but keeps add-on &
  its preferences.
- Enabling a repository re-enables add-ons that use it.
- Renaming a repository updates the names of associated add-ons &
  it's preferences.
2024-01-19 17:19:09 +11:00
Campbell Barton
606562c12b Extensions: fix re-registered repos failing to include add-on modules
Enabling & disabling a repository removed it's module from sys.modules
but kept any sub-modules (in this case add-ons).

The problem with this is enabling the add-ons again could reuse the
cached modules which failed to include the add-on in the parent
modules name-space.

This meant `dir(bl_ext.repo_module)` couldn't be used to access
sub-modules.
2024-01-19 17:19:08 +11:00
Campbell Barton
3fe1097d24 Cleanup: lazily import bpy_extras.object_utils where possible 2024-01-19 11:52:08 +11:00
Harley Acheson
6d357dc60d UI: Dialog to Insert Unicode Characters for Text Objects
Dialog box that allows the entry of any Unicode character into a 3D
Text Object string by entering its hexadecimal codepoint value.

Pull Request: https://projects.blender.org/blender/blender/pulls/116966
2024-01-18 17:59:36 +01:00
Thomas Dinges
61d0f7e118 UI: Update whats new link and check version rather than hardcoding it 2024-01-18 16:49:38 +01:00
Thomas Dinges
64fc6d7890 Docs: Replace most wiki links with links to new developer docs
Exceptions:
* Links to personal wiki pages
* Pages that are not in the new developer docs yet (like Human Interface Guidelines)
* tools\check_wiki\check_wiki_file_structure.py needs a refactor
2024-01-18 16:49:38 +01:00
Alexander Gavrilov
b350d7a4c3 Shape Keys: support locking to protect from accidental editing.
It is very common for graphical editors with layers to support
locking individual layers to protect them from accidental edits due
to misclicks. Blender itself already supports locking vertex groups.
This adds lock toggles for shape keys, with lock/unlock all operators.

The flags are checked by sculpt brushes, edit mode transform tools,
and Smooth, Propagate and Blend From Shape operators. This selection
aims to cover operations that only deform the mesh, where the shape
key selection matters.

Topology changing operations always apply to all keys, and thus
incorrect shape key selection is less impactful. Excluding them
from the new feature greatly reduces the patch size.

Pull Request: https://projects.blender.org/blender/blender/pulls/104463
2024-01-18 13:17:24 +01:00
Jeroen Bakker
02d5b8d488 Cleanup: Make format 2024-01-18 13:05:38 +01:00
YimingWu
4d387843e9 GPv3: Subdivide Modifier
This ports the Subdivide modifier from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/117056
2024-01-18 13:02:53 +01:00
Bastien Montagne
f9c3d51322 I18N: utils: Fix invalid timestamp format in PO files.
Expected format is `%Y-%m-%d %H:%M%z`.

Previous code would not generate the expected format of timestamps for
PO files headers (specifically in the the `POT-Creation-Date` field).

This could lead to some parsers (like e.g. the `sphinx_intl.load_po`
function) failing to load these PO files.

Note: since `datetime` module requires additional gymnastic to get valid
timezone info,switched back to the simpler `time` module here.

All times are expressed in UTC (aka GMT) timezone, since these are also
the values stored for Blender buildtimes.

Reported by @hoanguk in the Blender translations chat, thanks.
2024-01-18 11:20:26 +01:00
Campbell Barton
54349d0287 UI: don't gray out "Revert to Saved Preferences" with factory startup
This made it seem as if it wasn't possible to load from saved
preferences when running Blender with '--factory-startup'.

This isn't a perfect solution as loading the saved
preferences doesn't clear `bpy.app.factory_startup`.
Even so, it's better not to gray out a menu item which is functional.
2024-01-18 13:37:15 +11:00
Damien Picard
8564e03cdf Fix FPS menu in "Format" panel not following translation setting
The FPS menu was using a cached value which wasn't being refreshed
when translation changed.

Add `bpy.app.handlers.translation_update_post` handler which runs
when translation changes, this can be used to clear any cached UI
values.

Ref !117049
2024-01-18 11:31:38 +11:00
Campbell Barton
d068407a00 Fix #114801: Scene.use_audio value flipped
Regression in [0] caused the value to be flipped.

[0]: e37dc17991
2024-01-18 11:01:13 +11:00
Harley Acheson
8ba7e40bb4 Revert #106653: Cleanup Dialog to Manage Orphaned Data
Reverting 58e1e88dc3 because of concerns by reviewer.

Pull Request: https://projects.blender.org/blender/blender/pulls/117241
2024-01-17 17:05:24 +01:00
Campbell Barton
5149aed4ac PyAPI: improve warnings when addons from extensions repos fail to load 2024-01-17 18:30:16 +11:00
Harley Acheson
58e1e88dc3 UI: Cleanup Dialog to Manage Orphaned Data
Creates a new "Cleanup" dialog that allows purging unused data blocks,
as well as a window used for managing unused data blocks.

Pull Request: https://projects.blender.org/blender/blender/pulls/106653
2024-01-17 01:09:12 +01:00
grady
796577d76e Outliner: Double-click on item icon to select contents/hierarchy
Allow double-clicking on Outliner items to select all child items.

Pull Request: https://projects.blender.org/blender/blender/pulls/110151
2024-01-17 00:45:43 +01:00
Campbell Barton
0d7225bf0c Cleanup: remove outdated comment
String suggestion now allow the operator list to be searched.
2024-01-17 10:30:04 +11:00
Lukas Tönne
c02f3c94d9 GPv3: Opacity modifier
Opacity modifier implementation based on GP2.
Functionality is largely unchanged.

_Color Mode_ is either `Stroke` or `Fill` for modifying color opacity or
`Hardness`.
_Uniform Opacity_ does two things at once (!):
- Sets the same opacity value for every point in a stroke.
- Sets opacity as an absolute value rather than a factor.

_Weight as Factor_ (button to the right of Opacity Factor): Use the
vertex group as opacity __factor__ rather than an overall __influence__.
This is confusing and hard to convey, but copies behavior from GP2.

The _Influence_ panel contains the same filter settings as the GP2
modifier, with some small changes:
- _Layer_ selects only strokes in the respective layer (with an _Invert_
  option)
- _Material_ selects only points with the respective material (with an
  _Invert_ option)
- _Layer Pass_ and _Material Pass_ select only strokes/points which are
  rendered in the respective pass.
  _Note 1: Layers don't have UI for setting a pass yet, this will be a
  generic layer attribute. This can be set through the API for testing._
  _Note 2: In GP2 a pass value of zero was used to disable pass filters.
  Since zero is a valid pass ID an explicit flag has been added for the
  purpose of turning pass filters on and off._
- _Vertex Group_: This can be used as an additional influence filter on
  points. If _Weight as Factor_ is enable the vertex group instead
  replaces the opacity factor. In _Fill_ mode the vertex group weight of
  the stroke's first point is used as influence for the entire stroke.
- _Custom Curve_ is another possible influence factor per point. The
  curve input value is the relative position of a point along its
  stroke.

The Influence settings have been moved into a separate DNA struct, which
should help with reusability in various modifiers. Various utility
functions can be found int `MOD_grease_pencil_util.hh` for handling
influence settings and generating `IndexMasks` for modernized C++ code.

Pull Request: https://projects.blender.org/blender/blender/pulls/116946
2024-01-16 16:56:14 +01:00
Pedro A
6d63da40ee Fix: error when custom socket has no 'draw' function
This `draw` method is optional. The same check is also done elsewhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/117061
2024-01-16 15:41:03 +01:00
Lukas Tönne
53e34dba80 Fix #115727: Draw panel buttons in the node editor side bar
In 13fac109 the node panels got support for individual option button
callbacks, but these were not included in the node editor side bar.
Only the older top-level buttons are drawn there.

The panel structure is currently not accessible in python since it is
part of the `NodeDeclaration` system. To draw node input sockets and
buttons in the correct panel order as they appear on the node, a new
template function `uiTemplateNodeInputs` has been added. This iterates
over declared panels and their contents in the appropriate order and
draws the buttons before sockets in the same panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/116936
2024-01-16 13:37:57 +01:00
Campbell Barton
489408e8d3 PyAPI: handle sys.exit() from the Python console
This would raise a SystemExit, showing it's stack trace into Python's
code module, then a syntax error on any input immediately afterwards.

Now exception is printed & the input for the Python console is reset.

Address some issues raised by #109435.
2024-01-16 17:17:54 +11:00
Sybren A. Stüvel
acbb91b192 Fix: Anim, replace last arm.collections.all with arm.collections_all
Replace the last occurrences of `arm.collections.all` to
`arm.collections_all`. This has been the API since
015555b07a.
2024-01-15 11:36:48 +01:00