Commit Graph

2618 Commits

Author SHA1 Message Date
Falk David
89e3ab2a45 Fix: GPv3: Error when calling add_points or remove_points
The `drawing.resize_curves` function had been renamed in
1899ea25d5 but this wasn't
updated in the strokes API.
2024-10-14 10:40:52 +02:00
Julian Eisel
d177388979 Sculpt/Paint: Tag brushes for unsaved changes for UI indication
Part of the brush assets project followups, see #116337.

Based on feedback, it seems important to indicate to the user when a brush has
unsaved changes.

There's no reliable updating mechanism we can use or hook into here, except for
RNA "update" callbacks. Brush data gets changed in many places in code, the only
way to do this seems manual tagging every time a brush property gets changed.
This PR introduces `BKE_brush_tag_unsaved_changes()` for this. I spent some time
going through all brush properties to ensure changes call the tagging function.

A known limitation with this will be that changes to dependencies won't be
indicated in the brush. E.g. Changing the texture attached to a brush won't make
the brush be indicated as changed.

The UI to indicate the changed brushes is being discussed still, see #128846.

Pull Request: https://projects.blender.org/blender/blender/pulls/128845
2024-10-11 22:08:14 +02:00
Campbell Barton
3f7e14295f Cleanup: format 2024-10-11 11:00:24 +11:00
YimingWu
87f227ef7a Fix #128838: Extension: Support _universal2 suffix for Mac
Some python wheels can have `_universal2` suffixes which are built for
both intel and arm architectures. This fix takes care of that.
2024-10-10 21:15:33 +08:00
Sybren A. Stüvel
a564e678f0 Fix #128797: Custom property Data-Block Type only has Object ID Type
In the WindowManager code, use `bpy.types.ID.id_type` enum property to
get all valid ID types, instead of using a property on the `Action`
type.

Pull Request: https://projects.blender.org/blender/blender/pulls/128834
2024-10-10 14:33:31 +02:00
Campbell Barton
b0fb6a1b2c Fix #128840: extension build asserts when "type" is missing
Building an extension when the manifest didn't define a "type"
would assert instead of reporting the missing field.

Return earlier when there are errors to prevent the assertion.
2024-10-10 23:28:11 +11:00
Philipp Oeser
9baf082dc5 Fix #128760: NLA bake action throws error
Caused by db6113048d

Above commit was accessing action properties which are only available if
experimental baklava is enabled.
Now check for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/128762
2024-10-10 13:54:58 +02:00
Philipp Oeser
58eff16cad Fix #128758: Error Message when using old Shortcut for Crease Brush
In essential brush assets, the "Crease" brush was replaced with two
crease brushes ("Crease Polish" and "Crease Sharp"), but the keymap
wasnt respecting that.

So to resolve now point Shift+C to "Crease Polish" (seems closer to what
the former "Crease" brush was.

Pull Request: https://projects.blender.org/blender/blender/pulls/128765
2024-10-10 13:54:26 +02:00
Germano Cavalcante
75ffda39b2 Fix #126665: Reintroduce 'Absolute Grid Snap' (now 'Absolute Increment Snap')
The 'Absolute Grid Snap' feature remains useful even alongside
'Snap to Grid', so this option is being reintroduced, partially
reverting commit f0479e915f.

Pull Request: https://projects.blender.org/blender/blender/pulls/128135
2024-10-09 22:52:28 +02:00
Philipp Oeser
ee3fdf4099 Fix: curves editmode operators available in pointcloud editmode
Poincloud editmode support was added in f89b32382a.
Then fd9d22ba57 added geonode operator support.
But 01ee34ebd1 & 6c25c66194 added operators not meant for
pointclouds.

To resolve, check modes more carefully.

Pull Request: https://projects.blender.org/blender/blender/pulls/128794
2024-10-09 16:10:06 +02:00
Bastien Montagne
e2705a432a Fix #128767: Regression: Batch Rename failed to rename bones.
Regression from 8c3a3bb9a3, did not realize all items were not
necessarily actual IDs.
2024-10-09 15:57:19 +02:00
Pratik Borhade
b5c3bc5caa Fix #128759: Asset-shelf popup missing in Curves sculpt mode
`VIEW3D_AST_brush_sculpt_curves` added in wrong keymap list.

Pull Request: https://projects.blender.org/blender/blender/pulls/128779
2024-10-09 13:23:06 +02:00
Pratik Borhade
337f364f1a UI: scrolling treeview with trackpad
Invoke tree-view scroll operation for trackpad event.

Pull Request: https://projects.blender.org/blender/blender/pulls/128747
2024-10-09 13:22:23 +02:00
Philipp Oeser
3b9a07d49a Fix #128746: SequenceCache modifier not available in dropdown for Curves
In a Curves (not Curve) object, the MeshSequenceCache modifier is not
available from the "Add Modifier" dropdown.

However, the Alembic importer adds such a modifier onto the Curves
objects it creates. It is also possible to transfer such a modifier from
another object, regardless of its type.
Thus, this seems not to be an issue of compatibility of the modifier
with the Curves object type, but an UI/UX oversight.

`BKE_object_support_modifier_type_check` already has a correct check for
this, so just adding CURVES support to the appropriate menu.

Same is true for the POINTCLOUD type, so adding that as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/128756
2024-10-09 13:02:15 +02:00
Lukas Tönne
5c57e24fea Cleanup: GPv3: Remove unused BKE functions from GPv2
Removes unused GPv2 functions in blenkernel.

Notes:
-  Functions for layer masks are still in use, but annotations never
  have layer masks in the first place. Would be good to remove the data
  structures so we can remove the functions too.
- Some multi-frame edit functions are also still nominally used, but
multi-frame editing is not an active feature for annotations. This
  should also be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/128709
2024-10-09 10:27:45 +02:00
nutti
e7747c0d93 PyAPI: add type of bpy.types.NodeSocket.links
Ref !128626
2024-10-09 17:41:09 +11:00
Pratik Borhade
79ae0f86da Fix: GPv3: Missing topbar layer panel in weight/vertex paint
Caused by 7b91f71ebf.

Pull Request: https://projects.blender.org/blender/blender/pulls/128603
2024-10-08 18:27:28 +02:00
Jordan Henshaw
70a429bb18 UI: Fix missing hyphen in "Addon Tags" label
Add missing hyphen for consistency with rest of UI,
following the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/127822
2024-10-08 18:23:58 +02:00
Falk David
09ca5a4c5f Fix: Python: Empty list of drawing.strokes doesn't have length of 0
The API would return `None` if the number of strokes in the drawing was `0`.
Instead this should return a slice that has a length of 0 to be consistent.
2024-10-08 11:43:56 +02:00
Aaron Carlisle
dc652aeedb Fix: UI: Restore GP3 Join operator in menu
This was accidentally removed in https://projects.blender.org/blender/blender/commit/d70b10dcd4
2024-10-07 20:08:44 -04:00
Lukas Tönne
a57206dd59 GPv3: Remove unused legacy editor functions for GPv2
Removes all unused functions in ED_gpencil_legacy.hh

Pull Request: https://projects.blender.org/blender/blender/pulls/128597
2024-10-07 18:21:28 +02:00
Falk David
68c665ffa1 Fix #128646: Wrong selection results using the high-level python API
The issue was that the API assumed that the `.selection` attribute
was always on either the point domain for points or the stroke domain
for strokes.
Internally the attribute domain depends on the current selection mode.

To fix the issue, the API now checks for the domain of the attribute
and handles it accordingly.

If the selection attribute is on the `'POINT'` domain:
* Reading the `stroke.select` property will check if *any* of the points of
the stroke are selected and return `True` or `False`.
* Writing to the `stroke.select` property will write `True` or `False` to *all* the
points in the stroke.

Also resolves #128645.

Pull Request: https://projects.blender.org/blender/blender/pulls/128687
2024-10-07 18:17:45 +02:00
Campbell Barton
ea2d27cf84 Fix #128567: file selector automatically creates paths & warns
Regression in [0] which didn't account for entering paths in the
file selector which would create paths without confirming,
warning that the "confirm" property was missing.

Entering `*.*` would create `_._` for e.g in the users CWD for example.

Ref !128568

[0]: 6dd0f6627e.
2024-10-05 16:58:21 +10:00
Aaron Carlisle
522a21c58b Docs: Update RNA to user manual URL mapping 2024-10-05 00:51:36 -04:00
Falk David
5f5b1b83d0 GPv3: Rename mode enum names and python identifiers
This renames the mode identifiers to be consistent with e.g. the context mode identifiers and other names used for the new Grease Pencil.

For `object.mode`:
* `PAINT_GPENCIL` -> `PAINT_GREASE_PENCIL`
* `SCULPT_GPENCIL` -> `SCULPT_GREASE_PENCIL`
* `VERTEX_GPENCIL` -> `VERTEX_GREASE_PENCIL`
* `WEIGHT_GPENCIL` -> `WEIGHT_GREASE_PENCIL`

For the internal `ob->mode` flag:
* `OB_MODE_PAINT_GPENCIL_LEGACY` -> `OB_MODE_PAINT_GREASE_PENCIL`
* `OB_MODE_SCULPT_GPENCIL_LEGACY` -> `OB_MODE_SCULPT_GREASE_PENCIL`
* `OB_MODE_VERTEX_GPENCIL_LEGACY` -> `OB_MODE_VERTEX_GREASE_PENCIL`
* `OB_MODE_WEIGHT_GPENCIL_LEGACY` -> `OB_MODE_WEIGHT_GREASE_PENCIL`

Resolves #127374.

Pull Request: https://projects.blender.org/blender/blender/pulls/128604
2024-10-04 19:20:00 +02:00
Lukas Tönne
9e70c6de4e Cleanup: Delete accidentally committed .orig file
This was a sloppy addition during #128521.

Pull Request: https://projects.blender.org/blender/blender/pulls/128596
2024-10-04 16:16:29 +02:00
Falk David
12eecb1504 Cleanup: GPv3: Don't show snap increment menu in topbar
In addc0ecb13, this also enabled
the `VIEW3D_PT_sculpt_snapping` menu which is not used
in Grease Pencil weight painting.
2024-10-04 16:03:59 +02:00
Philipp Oeser
addc0ecb13 GPv3: Add vertex group selector to topbar
Allows for switching the vertex group to be painted in weight paint mode
without having to have the Properties Editor open (same as for meshes).

Pull Request: https://projects.blender.org/blender/blender/pulls/128590
2024-10-04 15:55:07 +02:00
Falk David
e848bcdbbe Fix: GPv3: Flip primary and secondary toggle and shortcut missing
The `paint.brush_colors_flip` option was not exposed in the vertex color
panel.

This adds the toggle in the panel and also adds the keymap `X` to flip
the colors.
2024-10-04 14:48:09 +02:00
Falk David
9433ffe80a Fix: GPv3: Tint color property and panel
The tint color and panel was not used consistently.
In Vertex Paint mode we're using the unified paint settings,
but in Draw mode, we only use the brush color for tinting.

This fixes the issue by using the unified paint settings
for all the uses of the vertex color.
2024-10-04 14:41:45 +02:00
Lukas Tönne
3d6a142162 GPv3: Remove unused GPv2 operators
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
2024-10-04 13:05:09 +02:00
Julian Eisel
7191608a98 Sculpt/Paint: Hide asset shelf by default in a few modes
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.
2024-10-04 12:27:04 +02:00
Pratik Borhade
bd4f7acce5 GPv3: Display layers when properties tab is pinned
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
2024-10-04 11:58:12 +02:00
Falk David
effa8fbb7a GPv3: Material Isolate Operator
This ports the `gpencil.material_isolate` operator to GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/128549
2024-10-04 10:38:04 +02:00
Jesse Yurkovich
cd74a279cc Cleanup: make format 2024-10-03 22:09:02 +02:00
Julian Eisel
71dee64743 Sculpt/Paint: Asset shelf option to filter brushes by the active tool
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
2024-10-03 18:56:40 +02:00
Chris Clyne
5a27280916 EEVEE: Light & Shadow linking
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
2024-10-03 18:41:06 +02:00
Sean
47c9520bcc Fix #128430: GPv3: Crash using "Shrink/Fatten" operator
The operator was called with the legacy `mode` setting for Grease Pencil.
New mode should be `CURVE_SHRINKFATTEN`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128532
2024-10-03 18:14:58 +02:00
Falk David
6b78894740 Fix: GPv3: Radial controls not working in some modes
The radial controls to set the brush size were not working in sculpt and
vertex paint mode.
This was because of a collision with the  `cyclical_set` operator in edit mode.
The issue was that the poll function for the edit mode keymaps also
passed in sculpt and vertex paint mode.

To solve this, add a keymap for these common selection operators and
separate them from the general edit mode keymap.

Pull Request: https://projects.blender.org/blender/blender/pulls/128542
2024-10-03 17:45:04 +02:00
Lukas Tönne
7cb0e8a558 Cleanup: GPv3: Separate weight paint context menu class
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
2024-10-03 13:42:54 +02:00
Lukas Tönne
c986aa03b9 GPv3: Remove unused GPv2 keymap entries
This should free up references to GPv2 types and operators and should
in turn make their removal easier.

- Remove keymaps for GPv2 operators from `blender_default.py` and
  `industry_compatible_data.py`
- Remove keymap poll callback assignment from `gpencil_ops.cc`
- Remove keymap handler registration from `area.cc:ed_default_handlers`

Pull Request: https://projects.blender.org/blender/blender/pulls/128480
2024-10-03 11:18:31 +02:00
Campbell Barton
1563ba7e6c Fix #128175: Updating extension can remove the extension on WIN32
On Windows an entire directory may be locked when any files inside it
are opened by another process. This can cause operations that
recursively remove a directory (uninstalling & updating) to fail
with a partially removed extension.

The case of uninstalling was already handled, where failure to remove
a directory would stage the extension for later removal.
In the case of updating however, the user could be left with a broken
(partially removed) extension where some files were removed, as the
directory was locked, the update would fail to extract new files.

Address this issue by renaming the directory before recursive removal.

The following logic has been implemented:

- If any files in the directory are locked, renaming will fail.
  So even though the operation fails the extension is left intact.

- If renaming succeeds, it's possible to apply the update.

  While it's possible (albeit unlikely) recursive removal fails,
  which could be caused by file-system permissions issues corruption or
  a process could open a file between rename & removal.

  In this case the renamed directory is staged for later removal.

Other changes:

- Resolve a related problem where the user could install an
  extension previously staged for removal, now installing an extension
  ensured it's not removed later.

  This would occur if uninstalling failed, the user resolves
  directory-lock, uninstalls again, then re-installs the extension.

- When an extension fails to be removed, don't attempt to remove
  user configuration for that extension.

  Prefer to keep the extension & it's settings in their "current state"
  if it can't be removed.
2024-10-03 12:15:27 +10:00
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
Julian Eisel
78e330923d UI: Tree-view scrolling and resizing support
Implements scrolling support for tree-views, as well as changing the size of the
scroll-able tree-view. This is important to be able to place them in many places
in the UI, where a compact layout is preferred over an every expanding one
(causing following contents to be scrolled out of view). UI-lists would use
scrolling and resizing to ensure this, now tree-views are on par.

Enables scrolling and resizing for:
- Bone collection UI (`UILayout.template_bone_collection_tree()`)
- Grease Pencil layer UI (`UILayout.template_grease_pencil_layer_tree()`)
- Light link collection UI (`UILayout.template_light_linking_collection()`)
- UI to define a node tree interface (`UILayout.template_node_tree_interface()`)

These are all cases where compact UIs make more sense than expanding ones.

Internally this is enabled by calling the `set_default_rows()` method of the
tree-view, although the API might change still. It shouldn't be quite simple to
implement this for grid-views too if necessary, or other potential view types.

Although I'd like to do some smaller code quality improvements still, this
feature is important for some other modules (e.g. grease pencil module for the
layers UI in grease pencil v3), so I decided to prioritize merging this.

Pull Request: https://projects.blender.org/blender/blender/pulls/119668
2024-10-02 11:19:49 +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