Commit Graph

2411 Commits

Author SHA1 Message Date
Campbell Barton
d497452a73 Cleanup: typo, spaces in comments, comment blocks & use double quotes 2024-08-29 17:16:44 +10:00
Alaska
2fd2af86e8 Fix incorrect export FBX time
Ref: !125717
2024-08-28 12:30:56 +10:00
YimingWu
c5bdaaf96c Python: Add a note for clarifying GreasePencilDrawing::strokes() validity
When point/curves count of a `GreasePencilDrawing` is changed, prior stroke
slices are no longer valid. This is not obvious when using the `stroke()`
call since it is meant to provide a easier access to the drawing data and
did not represent the actual data layout in the drawing, hence we need an
additional note in the document to tell users to be more careful.

Pull Request: https://projects.blender.org/blender/blender/pulls/126815
2024-08-27 17:51:30 +02:00
Alaska
6ccb33e9fe Shader: Add Metallic BSDF Node
Add Metallic BSDF Node to the shader editor.

This node can primarily be used to create more realistic looking
metallic materials than the existing Glossy BSDF node.

This commit does not add any new closures to Cycles, it simply exposes
existing closures that were previous hard to access on their own.

- Exposes the F82 fresnel type that is currently used by the
metallic component of the Principled BSDF. Results should match
between the Metallic BSDF and Principled BSDF when using the same
settings.
- Exposes the Physical Conductor fresnel type that was previously
limited to custom OSL scripts. The Conductor fresnel type accepts
IOR and Extinction coefficients to define the appearance of the
material based off real life measurements.

EEVEE only supports the F82 fresnel type with internal code to convert
the the physical conductor inputs in to a colour format for F82,
which can lead to noticeable rendering differences with
some configurations.

Pull Request: https://projects.blender.org/blender/blender/pulls/114958
2024-08-27 17:20:46 +02:00
Sybren A. Stüvel
f8af00e61b Anim: Action editor, only show Action selector if there is an active object
In the Action editor, only show the Action selector (and the matching
separator) if there actually is an active object to select it for.
2024-08-27 15:13:17 +02:00
Andrej730
798fbe7dbd Fix: Typo in extensions repository lock info message
`Fore` -> `Force`

Pull Request: https://projects.blender.org/blender/blender/pulls/126778
2024-08-26 12:28:52 +02:00
Campbell Barton
5cb29528e6 Cleanup: spelling in comments 2024-08-26 11:50:15 +10:00
Campbell Barton
780686f885 Cleanup: correct code-comment 2024-08-26 11:50:14 +10:00
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