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
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
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.
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
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
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
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
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
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
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.
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
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
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
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
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
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.
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
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
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