Commit Graph

2403 Commits

Author SHA1 Message Date
Falk David
3ca9396cc3 Fix #126613: GPv3: Python: Writing to stroke.curve_type crashes Blender
Writing to the `curve_type` attribute directly is not allowed as there are other
updates needed and otherwise will result in a crash.

The fix makes sure the `curve_type` is read-only. To change the curve type,
the `grease_pencil.set_curve_type` operator has to be used for now.
2024-08-23 18:24:37 +02:00
Christoph Lendenfeld
51fd355c01 Anim: UI template for Action selectors
This PR is just taken over from @dr.sybren with
minor comments addressed.

Original PR: #125493

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/126561
2024-08-23 11:07:16 +02:00
Campbell Barton
fdd0b93cfa Cleanup: spelling in comments 2024-08-23 10:19:53 +10:00
Philipp Oeser
65930d2a03 Fix #125800: AttributeError when maximized the 3d view with asset shelf
For a brief moment when switching to a maximized screen full area, the
screen context is missing its `object` it seems, until the context is
properly set up again.

Prevent the 'Context' object has no attribute 'object' by just checking
if it is available

Pull Request: https://projects.blender.org/blender/blender/pulls/125905
2024-08-22 15:07:38 +02:00
John Kiril Swenson
715129bf5b VSE: ability to connect and disconnect strips in the VSE.
Adds the ability to connect and disconnect strips in the VSE.

- Connected strips have an icon indicating their status, and attempting
  to select one connected strip selects all other connected strips in
  that chain.
- If the user attempts to connect a strip that is already connected to
  other strips, that strip will disconnect itself from others before
  connecting to new strips.
- Preview selection also works in bulk if multiple video strips are
  connected together in the timeline.
- When adding new strips from the Add menu or the File Browser, strips
  from the same file are connected by default. There's an option to
  turn this off in Editing > Video Sequencer user preferences.
- It is possible to individually tweak strips/handles and ignore
  connections with Alt+Click.
  - This shortcut overrides the old keymap item for "Linked Handle"
    selection. The property still exists if people want to use that
    shortcut for its old purpose.
- To make sure that connections remain valid even after duplication,
  I've added a condition to `seq_new_fix_links_recursive` that also
  updates connections using the `seq->tmp` var. (A note -- I've updated
  the comment for this field in `DNA_sequence_types.h` because the var
  is only used for duplication now. It was once present in
  `select_more_less_seq__internal` to be used for linked selection but
  is gone now).
  - There are also functions to cut one-way links and make sure that
    all strips are bidirectionally connected after duplicating.

Pull Request: https://projects.blender.org/blender/blender/pulls/124333
2024-08-22 14:54:42 +02:00
Dalai Felinto
0f2f9cd230 Extensions: Update the example license on the manifest template
Use GNU/GPL 3.0 or later instead of 2.0 or later.
2024-08-22 10:56:54 +02:00
Lukas Tönne
2e9fc8ef2d GPv3: Segment selection support
Support segment mode in Grease Pencil v3 selection operators.
This is a continuation of #109221.

Segment selection works in multiple stages:
1. When enabled, the 2D evaluated lines for all visible curves are
entered into a BVH tree. This tree is used to find intersections later
on. All the visible drawings are in the tree, an `OffsetIndices` array
is used to record ranges of BVH elements for each drawing.
2. Primary selection functions get alternative versions that produce an
`IndexMask` instead of writing directly to selection attributes. This
makes it possible to detect select actions on points that are already
selected. Using a delta of selection attributes for this is not enough
to detect such user actions (and inefficient).
3. In segment mode the `IndexMask` is extended to fully cover segment
points (or exclude them when deselecting respectively). This first
performs and intersection test using the BVH tree, then finds all point
range with selected elements.
4. Finally the extended index mask is applied to selection attributes as
usual.

Pull Request: https://projects.blender.org/blender/blender/pulls/126027
2024-08-21 13:35:26 +02:00
Amelie Fondevilla
625ef79f57 GPv3: Soft mode for the Eraser tool
Implementation of the soft mode of the eraser tool for GPv3.
In this mode, the eraser decreases the opacity of the points it hits.
If the opacity of a point falls below a threshold, then the point
is removed from the curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/110310
2024-08-20 17:24:03 +02:00
Christoph Lendenfeld
db6113048d Fix #126129: Bake Action not working
With layered actions, the bake action wasn't working.
More specifically it failed to create a slot on the action
and link that slot on the animation data.

The fix is to create the slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/126546
2024-08-20 16:45:34 +02:00
Lukas Tönne
400c738db9 GPv3: Import and export for SVG and PDF
Implements the SVG import/export and PDF export operators for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/123996
2024-08-20 11:41:37 +02:00
Falk David
850e316688 Refactor: Move Grease Pencil helper classes to _bpy_internal
This moves the helper python classes from `scripts/modules/grease_pencil_python.py`
to `scripts/modules/_bpy_internal/grease_pencil.py`.

It also cleans up the code a bit more. No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126403
2024-08-20 11:11:53 +02:00
Campbell Barton
9ab9aab3d7 Cleanup: use "Helper" suffix for mix-in panel classes
This clarifies that they aren't themselves panel types.
2024-08-20 14:25:56 +10:00
Campbell Barton
ec759b6caf Cleanup: suppress debug warning with unregistered Panel sub-classes 2024-08-20 14:25:55 +10:00
Campbell Barton
12549de989 Cleanup: remove unused menu definition 2024-08-20 14:25:53 +10:00
Bastien Montagne
c1aef6b4b0 Cleanup: make format 2024-08-19 14:26:53 +02:00
Bastien Montagne
d3589270d4 I18N tools: disable multi-processing for the time being.
Not sure why, but today I got almost systematic deadlocks in the
ProcessPoolExecutor calls (and similar issues with direct usage of
multiprocessing)... For now synchronous single process will do.
2024-08-19 13:52:48 +02:00
Casey Bianco-Davis
1a07c08718 GPv3: Eyedropper tool
This adds the Eyedropper tool to GPv3.

A few changes have been made:

- Added `Brush` mode.
- Set active color in palette.
- Show the palette in the UI.
- Add UI for setting material mode.
- Drag for color accumulation.

Pull Request: https://projects.blender.org/blender/blender/pulls/126211
2024-08-19 11:27:49 +02:00
Campbell Barton
8a7ff41a85 Cleanup: wrap long lines in Python scripts 2024-08-19 10:48:07 +10:00
Campbell Barton
fe6ab4f344 PyDoc: corrections to formatting and resolve warnings
Use RST formatting for doc-strings used in Python API docs
as well as minor corrections, also add links for foreach_get/set.
2024-08-19 10:48:06 +10:00
Harley Acheson
aa78d43a05 UI: Multicolor Autokeying Indicator
Show the autokeying indicator (record button) on the Timeline header in
red when enabled. With a white outline on dark theme, or with a black
outline on light theme. The red color is user changeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/126344
2024-08-16 23:16:40 +02:00
casey bianco-davis
8f386cd308 GPv3: Edit Mode: "Scale Thickness" option
This implements the `use_scale_thickness` setting for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/126213
2024-08-16 19:50:34 +02:00
Campbell Barton
f9a16c4cdb Fix failure to remove libraries when removing wheels
Disabling wheels wasn't removing the modules "*.libs" directories.
2024-08-16 18:12:57 +10:00
Campbell Barton
58c7237bbf Fix #125958: Disabling/uninstalling extensions doesn't remove wheels
Cleaning up wheels was skipped when there were no enabled extensions.

Now this is only skipped when there are no extensions on startup.
2024-08-16 18:12:57 +10:00
Campbell Barton
d777267982 Cleanup: use str.format instead of f-strings 2024-08-16 09:33:20 +10:00
Campbell Barton
d6c5010936 Cleanup: use deferred import for faster startup 2024-08-16 09:33:20 +10:00
Campbell Barton
d71d325692 Cleanup: spelling in comments, strings 2024-08-16 09:33:20 +10:00
Jacques Lucke
ab26dc5817 Nodes: add operator to get node width from parent
This operator sets the new default group node width (from e842966c5e) based on
the parent group node. This makes it easier to initialize the value. Without
this, one had to create and delete the group node potentially many times to find
a good default width.

Pull Request: https://projects.blender.org/blender/blender/pulls/126239
2024-08-15 17:54:56 +02:00
YimingWu
4f4add5406 Fix #125426: Update paths in animation when renaming IDProperty
Previously when renaming an IDProperty the existing paths in the
animation/driver system isn't updated, this leads to missing animation
after renaming the property. Now `BKE_animdata_fix_paths_rename_all`
will be called so the animation system records the updated name.

Pull Request: https://projects.blender.org/blender/blender/pulls/125474
2024-08-15 13:56:17 +02:00
Falk David
ed3c16624b GPv3: High level python API
This extends the `GreasePencilDrawing` rna type using python.
The goal is to add an API that allows developers to transition to
the new grease pencil API a bit more smoothly.

Adds the following endpoints to the `GreasePencilDrawing`:
* `drawing.strokes`: Returns a list/slice of `GreasePencilStroke`s in the drawing.

Adds a python class `GreasePencilStroke`:
* `stroke.points`: Returns a list/slice of `GreasePencilStrokePoint`s.
* Getters/Setters of attributes for this stroke:
   * `stroke.cyclic`
   * `stroke.material_index`
   * `stroke.select`
   * `stroke.softness` (used to be `hardness`)
   * `stroke.start_cap`
   * `stroke.end_cap`
   * `stroke.curve_type`: The type of curve: `POLY`,`BEZIER`,`CATMULL_ROM`,`NURBS`.
   * `stroke.aspect_ratio`
   * `stroke.fill_opacity`
   * `stroke.fill_color`
   * `stroke.time_start`
* High-level functions:
   * `stroke.add_points(count)`: Adds `count` points at the end of the stroke.
  * `stroke.remove_points(count)`: Removes `count` points from the end of the stroke. Note that this will not remove the stroke if the count is greater than the number of points in the stroke. A stroke has at least 1 point. Removing strokes can be done from the drawing.

Adds a python class `GreasePencilStrokePoint`:
* Getters/Setters of attributes for this point:
   * `position`
   * `radius`
   * `opacity`
   * `select`
   * `vertex_color`
   * `rotation`
   * `delta_time`

Note that `GreasePencilStroke` and `GreasePencilStrokePoint` are not stored in the file and don't have an RNA API. This means that they are not compatible with e.g. `layout.prop`.

This API should not be used for performance critical code. It's likely
even slower than the python API from 4.2.

There will be migration documentation for addon developers here:
https://developer.blender.org/docs/release_notes/4.3/grease_pencil/#python-api-changes

Pull Request: https://projects.blender.org/blender/blender/pulls/125599
2024-08-15 10:58:21 +02:00
Campbell Barton
74fae7f943 Presets: remove poll functions that scan the file-system
The poll functions for theme & key-map preset operators used functions
documented not to be used on redraw draw and could make the interface
slow when extensions (for example) are stored on a network file-system.

While the file-system lookups are typically cached, it can still cause
occasional stuttering or hanging. In general scanning the file-system
on poll should be avoided.
2024-08-15 16:06:17 +10:00
Campbell Barton
9e09351b5b Fix active theme behavior when adding/removing themes
Regression in [0] which displays the filename for the active
theme but still used the label internally.

This meant actions such as removing the theme would not always apply
to the name being displayed.

- Adding a new theme was not setting it active.
- Detecting if a theme was built-in used the run-time label as a lookup.
- Theme removal first require it to be re-selected.

[0]: 0bb6317035
2024-08-15 16:06:13 +10:00
Campbell Barton
9f931ee3d2 Presets: consider presets within the extensions repo to be "built-in"
It was possible to remove a preset defined within an extension,
the only way to restore it was to uninstall & re-install the extension.
2024-08-15 16:06:11 +10:00
Campbell Barton
f42713ab1d Fix unhandled permissions exception in bpy.utils.is_path_builtin
An excepting would be raised when the parent/child paths didn't
have permissions to access.
2024-08-15 16:06:10 +10:00
Campbell Barton
5f9be675f0 Cleanup: move bpy.utils parent-path check into a function 2024-08-15 16:06:08 +10:00
Pratik Borhade
8e771104d8 GPv3: Cursor panel not usable in paint modes
This is due to failing poll function. Use correct tool setting pointer
based on the active mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126279
2024-08-14 13:26:00 +02:00
Pratik Borhade
7bfdc6dfea GPv3: Invert weight operator
Port gp legacy "invert weight" operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/126275
2024-08-14 08:55:24 +02:00
Omar Emara
94d3b764e7 Geometry Nodes: Implement Gabor noise node
This patch ports the Gabor noise shader texture node into Geometry
Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/125718
2024-08-14 08:48:17 +02:00
Jacques Lucke
d81ba55ce4 Fix #124467: lazy-connect does not work with Capture Attribute node
The lazy-connect feature of node wrangler uses the built-in `connect_sockets`
function which automatically handles virtual sockets in group input and output
nodes already. However, it does not handle virtual sockets in other nodes.

The fix is to generalize this behavior. For that, a new `handle_dynamic_sockets`
boolean input is added to `tree.links.new`. When enabled, virtual sockets are
handled properly by internally calling the `bNodeType.insert_link` methods.

The new behavior is turned of by default for compatibility reasons.

Pull Request: https://projects.blender.org/blender/blender/pulls/126282
2024-08-13 16:25:20 +02:00
Sean Kim
64211aa8c6 Sculpt: Add polyline gesture submit on double click
Originally, the polyline gesture tools were intended to have the gesture
submit on clicking on the starting point and pressing enter only. It was
brought up that the knife tool which has similar behavior also exposes
this on double clicking. To better align expected behavior across tools,
this commit adds similar functionality for the polyline tools.

Implements #125249

Pull Request: https://projects.blender.org/blender/blender/pulls/125391
2024-08-12 17:06:25 +02:00
Hans Goudey
be53bd079f Cleanup: Formatting 2024-08-12 09:47:02 -04:00
Pratik Borhade
c89b878371 GPv3: Sculpt context menu
Similar to GP legacy context menu of sculpt mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126135
2024-08-12 13:05:13 +02:00
Bastien Montagne
473456323f I18N: Extraction tools: Add timeout to async multi-processing.
Once in a while these get (dead)locked for some reason, at least avoid
having to kill the whole Blender then.
2024-08-12 13:00:46 +02:00
Jacques Lucke
e842966c5e Nodes: add group node default width
This adds the ability to customize the default width of a group node that's
created for a node group. This feature works towards the goal of unifying the
features available to built-in nodes and node groups. We often customize the
width of built-in nodes from them to looks slightly better (e.g. to avoid
cut-off labels).

Pull Request: https://projects.blender.org/blender/blender/pulls/126054
2024-08-11 19:25:53 +02:00
Bastien Montagne
7d52265771 Fix several issues with i18n tools on non-linux platforms.
- Paths of C++-parsed files were not properly 'unixified' on Windows.
  This was bad both for changes noisyness in PO files, and broke on
  the un-escaping of `\n` and `\t` sequences.
- The `ProcessPoolExecutor` starts sub-processes differently on Linux
  than on Windows or OSX. While Linux's `fork` keeps the same
  environment (i.e. all Blender stuff remains available in workers
  subprocesses), the 'spawn' used on Windows (and reportedly OSX) starts
  a new bare python interpreter. This means that code executed by these
  needs to be Blender-agnostic to be portable.

The only thing that is currently known broken on non-Linux platforms is
the RTL processing of some languages like Arabic or Hebrew.
2024-08-10 17:35:28 +02:00
Omar Emara
f2fcbc3330 Cleanup: Format 2024-08-08 17:36:23 +03:00
Pratik Borhade
9ca6e049a7 GPv3: Draw Mode: Context menu
Right click context menu has been missing in gpv3 draw mode.
Similar to gp legacy, this includes color picker, active layer etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/125964
2024-08-08 16:03:09 +02:00
Omar Emara
f40cf759c7 Compositor: Add experimental option for new CPU compositor
This patch introduces a new experimental option for the new CPU
compositor under development. This is to make development easier such
that it happens directly in main, but the compositor is not expected to
work and will probably crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/125960
2024-08-08 15:40:06 +02:00
Christoph Lendenfeld
a451971026 Fix #124691: Custom bone wire rendering broken on Mac
This issue occurred only on Mac which has to circumvent
geometry shaders lacking support for them.

This patch reverts the vertex shader for Mac devices to
how it was before f9ea64b0ba. (and uses the frag shader from before that commit)
In order to communicate that to the user I added a label
in the GUI when the platform is Mac.

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/125967
2024-08-08 11:19:12 +02:00
Pablo Vazquez
000d34c398 EEVEE: Add toggle for Fast GI Approximation
Add a toggle for Fast GI Approximation in the header of the panel,
following Cycles layout.

Move the `Max Roughness` setting inside the panel, and rename to
Threshold.

Since Fast GI Approximation only has any effect when Threshold/
Max Roughness is below the max (1.0), gray out the rest of the
panel when at that value.

Co-authored-by: Clément FOUCAULT <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/125452
2024-08-06 14:28:56 +02:00
Campbell Barton
f8e06a5f5f Fix #125763: Uninitialized extension repos printing warnings on startup
Since [0] missing repository directories printed a warning on startup.

When checking for blocked extensions on startup, skip directories
that don't exist & don't print any warnings if the repository data
hasn't been downloaded.

[0]: 656fe6d3e4
2024-08-06 20:53:41 +10:00