Uses `FileHandlers` to handle file drag-n-drop in the space Sequencer, drop-boxes
still remain since they handle Images ID drag-n-drop.
This also allows to open/drag-n-drop multiple files at once.
When drag-and-drop is performed with a single image/movie/sound
file and only the internal `FileHandler` can be used, is used
the internal drop-box api for drag and drop, since it has a nice
drag-and-drop preview.
Pull Request: https://projects.blender.org/blender/blender/pulls/119927
This adds the `Draw on back` option to GPv3.
Note:
In the legacy system the stroke being drawn would be displayed
in front and only moved to the back upon finishing the operator.
Whereas this will display the stroke on back throughout the
drawing operation.
Pull Request: https://projects.blender.org/blender/blender/pulls/120894
Adds a new asset shelf option (`STORE_ENABLED_CATALOGS_IN_PREFERENCES`
option in RNA) to use the Preferences for storing the enabled catalogs.
This way asset shelf types can decide if for their use-case, they want
to synchronize the enabled catalogs over Blender sessions and files, or
keep the stored locally in the file.
This is important because for example on one hand, it would be annoying
if for brush assets you'd have to enable the visible catalog tabs for
every 3D View and every file, while on the other hand you need that
level of control for the pose library where the catalogs the rigger/
animator cares about varies from project to project, character to
character and shot to shot.
Conceptually this also makes some sense: The new brush assets workflow
synchronizes brush assets and their catalogs across Blender sessions
and files, basically making them globally accessible independent of
the current file/project, so treating the enabled catalogs the same
is consistent.
Previously reviewed in #120264
Pull Request: https://projects.blender.org/blender/blender/pulls/121363
When Blender is built using `WITH_EXPERIMENTAL_FEATURES=OFF`, the GP
custom properties panel still tries to access `bpy.types.GreasePencilv3`,
which then doesn't exist.
This is a very simple, local fix that checks whether that type exists,
and only then defines `DATA_PT_grease_pencil_custom_props`.
Pull Request: https://projects.blender.org/blender/blender/pulls/121394
Since a3627fe88e Object menu in 3D viewport checks for
active_object.type, but if there is no context.active_object it
results in annoying python error. This PR checks for
active_object before checking type to avoid the error.
This won't be necessary once check for legacy GPENCIL is removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/121370
- Moved Modifier menu above Constraints, so that order matches Properties panel
- Added icons for Modifier and Constraints menu (same ones as Properties)
- Renamed "Add" to "Add Modifier", so that it's easier to search for it with F3
- Renamed "Copy Modifiers" operator to match similar operator in constraints menu
- "Add Modifier" operator now doesn't appear if active object type doesn't support
modifiers. I completely removed it because otherwise it was showing menu with
empty items even on greyed out
Lastly, I added check for legacy GPENCIL object type, because it doesn't support
new modifier menus, and instead when active object is grease pencil instead of
menu it shows old Add Modifier operator, same one that is in properties panel.
After legacy grease pencil is removed that check won't be necessary anymore and
can be removed, but for now it's needed, otherwise it shows empty menu for grease pencil.
Pull Request: https://projects.blender.org/blender/blender/pulls/121344
This also moves the option to be a per editor space setting so you can
have different cache visualization options in different editor spaces
at the same time.
A quick toggle for the cache visualization is now available in the
overlays popover.
Pull Request: https://projects.blender.org/blender/blender/pulls/119428
Implementation of the extrude operator for Grease Pencil v3.
If an endpoint is selected, the extrusion will extend the stroke.
If an inner point is selected, the extrusion will create a new stroke tied to the one that is selected.
Change of behavior from gpv2: the endpoints of a cyclic curve follow the same behavior as inner points.
Pull Request: https://projects.blender.org/blender/blender/pulls/121249
When transforming, both `TransConvertType_EditArmature` /
`TransConvertType_Pose` get disabled from proportional editing
(`TransInfo` gets flagged `CTX_NO_PET` in `init_proportional_edit`).
This is intentional.
UI checks the mode and showing proportional editing properties was
already skipped for 'POSE' mode, but armatures in 'EDIT' mode would
still show them.
To resolve, also skip the UI for `EDIT_ARMATURE` mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/121205
These nodes allow working with the raw values that make up a matrix.
This can be used to construct a 4x4 matrix directly, without using the
`Combine Transform` node. This allows building transforms with arbitrary
skew, or projection matrices.
Pull Request: https://projects.blender.org/blender/blender/pulls/121283
This avoids negative color darkening caused by strong
directionnal lighting.
However, this reduce the contrast a lot since the
deringing is done on the unclampped spherical harmonics
which is itself extracted from unclamped values from
the world.
The solution to this is to add the parameter for
clamping the world light. This setting will be
reused for #68478.
Fix#116036
Pull Request: https://projects.blender.org/blender/blender/pulls/121303
Add a menu similar to the "Object > Constraints" menu that allows adding,
copying, and clearing modifiers. The "copy all modifiers to selected" and
"clear modifiers" operators are new, to mirror the functionality we already
have for constraints.
The "Add" menu is the same that's used in the property editor. In the 3D
view, modifiers are always added to all selected objects.
Part of #120230
Pull Request: https://projects.blender.org/blender/blender/pulls/121286
This PR adds the *Line Trim* tool to Sculpt mode. It is exposed via
the toolbar along with the other *Trim* tools and as an entry in the
*Sculpt* menu.
## Technical Approach
Line gestures are represented as two points in screen space: the `start`
and `end` of the gesture. Trim tools work by taking a set of screen
points as the top face of a volume, projecting a copy of the face into
the scene, then using that as the operand shape for boolean operations.
To behave as users would expect, the *Line Trim* tool does the following
steps to make the initial face:
1. Take the sculpted object's bounding box.
2. Project the bounding box into screen space
3. Take the magnitude of the diagonal line made from the bounding box
4. Use the magnitude multiplied by an arbitrary factor to ensure the
initial line is long enough to fully divide the object.
5. Create two points by moving in a perpendicular direction from start
and end points.
6. Use the resulting four points as vertices of the quad in screen space.
## Differences with Other Trim Tools
* Line Trim **only** supports the **Difference** mode. As such, the
corresponding tool options have been disabled in the header.
## Alternatives
* Instead of using a boolean operation, this could be achieved by using
a bisect operation when using the *Fixed* projection mode. While this
may result in a better performing tool, it is not guaranteed and
requires extra work to integrate this approach.
Pull Request: https://projects.blender.org/blender/blender/pulls/120845
Implement the design discussed in #120384.
This adds two parameters. One for changing the approximation
method, and another to use the thickness from shadow map.
We pack the former in the gbuffer by dividing the 16bits
used for thickness by two and use one bit to store the
method.
The thickness from shadow map is now decoupled from the
light evaluation shader. This makes it more performant and
compatible with ray-tracing. This commit also uses the
same biases as shadow mapping to avoid aliasing artifacts
(fix#119339).
This refactors the light evaluation quite a bit to
remove unused bits bits and make the whole transmission
light evaluation without too much complexity.
Pull Request: https://projects.blender.org/blender/blender/pulls/121171
Add an RNA enum property `AnimData.animation_binding` that lists all the
bindings available in `AnimData.animation`.
The list of bindings is filtered to only contain the bindings suitable
for the animated ID. This prevents assigning a 'camera' binding to a
mesh.
Un-assigning is done via an operator, represented as an 'X' button in
the interface.
The enum property contains up to two special items:
- "New" to create a new binding for the ID.
- "(none/legacy)" to indicate that this ID doesn't have a binding
assigned. This one is conditional, and only appears when it is
necessary.
These two special items are experimental, and mostly exist because we're
still evaluating things and building a better UI. It is intended that
the binding selector will become as close to the ID selector as
possible.
-----------
Note that this PR also contains #121268 as it builds up from that one, and I didn't want to wait with testing on the buildbot until that one lands.
The new Baklava panel:

Pull Request: https://projects.blender.org/blender/blender/pulls/121269
A version of "Align Euler to Vector" with the rotation socket
instead of the vector Euler socket. Other than that, and a few
cleanups to use newer math functions, the node is the same.
The old node is just "Deprecated" for now. We could remove
it with versioning, but we can also wait to do that.
In a simple test this node is about 1.7 times faster than the old one.
Pull Request: https://projects.blender.org/blender/blender/pulls/118565
This cleans up some of the Animation/Binding API, and adds a distinction
between a binding's "name" and its "display name".
`name`: internal name that is unique within the `Animation`. As such, it
is also the key into the `anim.bindings` collection.
- To ensure the uniqueness, `name` is always prefxed with the ID
identifier, like `OBCube` and `CACamera`.
- A binding that was not created to animate a specific ID will be
called `XXBinding`.
`name_display`: display name that strips the first two characters, so in
the above examples would be `Cube`, `Camera`, and `Binding`.
### RNA setter behaviour
`name`: always sets the name, emitting a warning when the name's prefix
doesn't match the ID type of the Binding. This implicitly changes the
display name (as they are two views into the same string).
`name_display`: sets `name = prefix_for_ID_type + name_display`. So even
when the old name was `QQSomethingWeird`, setting `binding.name_display
= "NewName"` would effectively set `binding.name = "OBNewName"`
(assuming it was already bound to some object earlier).
Bindings now also **always have a name**. Previously it was possible to
create bindings named `""`, but that's no longer possible.
Bindings used to be **renamed automatically** when they were first
assigned, for example from `XXBinding` to `OBCube`. This behaviour has
been removed, as it could potentially cause confusion.
Pull Request: https://projects.blender.org/blender/blender/pulls/120941
This patch updates GPv3 menus to expose new added operators, rearranges menus to follow GPv2 on other minor changes
- Moves Point menu before Stroke menu to be consistent with Mesh menu order (Mesh, Vertex, Edge...)
- Adds Vertex Group menu to Point menu
- Adds Close operator to Stroke Menu
- Moves Copy & Paste operators together with Duplicate operator in Point and Stroke conextual menus
Pull Request: https://projects.blender.org/blender/blender/pulls/121263
This changes the menu switch socket to use the socket-items system
(`NOD_socket_items.hh`) that is already used by the simulation zone, repeat
zone, bake node and index switch node. By using this system, the per-node
boilerplate can be removed significantly. This is especially important as we
plan to have dynamic socket amounts in more nodes in the future.
There are some user visible changes which make the node more consistent with
others:
* Move the menu items list into the properties panel as in 0c585a1b8a.
* Add an extend socket.
* Duplicating a menu item keeps the name of the old one.
There is also a (backward compatible) change in the Python API: It's now
possible to directly access `node.enum_items` and `node.active_index` instead of
having to use `node.enum_definition.enum_items`. This is consistent with the
other nodes. For backward compatibility, `node.enum_definition` still exists,
but simply returns the node itself.
Many API functions from `NodeEnumDefinition` like
`NodeEnumDefinition::remove_item` have been removed. Those are not used anymore
and are unnecessary boilerplate. If ever necessary, they can be implemented back
in terms of the socket-items system.
The socket-items system had to be extended a little bit to support the case for
the menu switch node where each socket item has a name but no type. Previously,
there was the case without name and type in the index switch node, and the case
with both in the bake node and zones. The system was trivial to extend to this
case.
Pull Request: https://projects.blender.org/blender/blender/pulls/121234
This has some benefits:
* Nodes with dynamic socket amounts can remain more self-contained
(2 fewer files to edit with this patch).
* It's easier to reuse existing C++ code, reducing redundancy.
One new thing I'm doing here is to define operators in node files. It seems
reasonable to register operators that belong to a node together with that
node. Without this, code spreads out further than necessary without any real benefit.
This patch affects the simulation zone, repeat zone, bake node and index switch node.
The UI is slightly affected too. Since we had the UI defined in Python before,
it wasn't possible to integrate it into the node properties panel. That is possible
now and looks better anyway. The previous UI was an artifact of technical limitations.
Pull Request: https://projects.blender.org/blender/blender/pulls/121178
The Bone 'length' property is not shown in the Bone Properties Panel in Edit Mode, but it is shown in the N-Panel. This PR exposes it in Bone Properties Panel as well for UI consistency.
Pull Request: https://projects.blender.org/blender/blender/pulls/120815
Display layer properties in n-panel of dopesheet (grease pencil mode).
Draw code is moved inside separate classes then inherit them in actual panel drawing
class to avoid copy pasting the code in two places (in layer properties
panel and dopesheet side panel).
Part of #110056
Pull Request: https://projects.blender.org/blender/blender/pulls/120606
This PR adds a polyline hide operator for sculpt mode as well as the
necessary generic callback code to allow using this gesture in other
selection tools.
Added features include:
* *Polyline Hide* operator
* `WM_gesture_polyline_*` callback functions for other operators
* Status bar text while using the polyline modal
* Common *Gesture Polyline* keymap for usage with the modal
Unlike the *Box Hide* and *Lasso Hide* operators, the *Polyline Hide*
operator does not provide a simple shortcut to click and show all
hidden elements in a mesh. This is because the existing operators
operate on a click-drag action while the new operator is invoked by
just a click.
Design Task: #119353
Pull Request: https://projects.blender.org/blender/blender/pulls/119483
Transport rays that enter to another location in the scene, with
specified ray position and normal. This may be used to render portals
for visual effects, and other production rendering tricks.
This acts much like a Transparent BSDF. Render passes are passed
through, and this is affected by light path max transparent bounces.
Pull Request: https://projects.blender.org/blender/blender/pulls/114386
The goal of this PR is to remove any user facing parameter
bias that fixes issues that are caused by inherent nature of
the shadow map (aliasing or discretization).
Compute shadow bias in the normal direction to avoid
both shadow leaking at certain angles or shadow
acnee.
This bias is computed automatically based on the minimum
bias amount required to remove all errors. The render
setting is removed as of no use for now.
#### Normal bias
We do the bias in world space instead of shadow space
for speed and simplicity. This requires us to bias using
the upper bound of biases for the same location in space
(using biggest texel world radius instead of UVZ bias).
This isn't much of an issue since the bias is still less
than 2 texel. The bias is still modulated by facing
ratio to the light so surfaces facing the light have no
biase.
This fixes both self shadowing and flat occluders aliasing
artifacts at the cost of moving the shadow a bit on the
side. This is the blue arrow in the diagram.
We always bias toward the normal direction instead of the
light direction. This is alike Cycles geometric offset for
the shadow terminator fix. This is better since it does'nt
modify the shading at all.
#### Slope bias
To avoid aliasing issue on zero slope receiver, we still
have to use the slope bias with a size of 1 pixel.
#### PCF filtering
We now parametrize the filter around the normal instead of
using the shadow map local space. This requires to use
a disk filter instead of box, which is also more pleasant
for most light shapes (all except rectangle lights).
Setting the filter around normal avoid overshadowing from
zero slope occluders. This cannot be fixed by more slope bias
in light space PCF. We could fix it in light space by projecting
onto the normal plane but that gives an unbounded bias when `N.L`
is near 0 which causes either missing shadows or self shadow if
using an arbitrary max offset value.
To avoid overshadowing from any surface behind the shading
point, we reflect the offset to always face the light.
Doing so instead of using the perpendicular direction
is better for very sharp geometric angles, has less
numerical precision issue, is symetrical and is cheaper.
To avoid any self shadowing artifact on zero slope receivers
with angled neighbors (like a wall and the floor), we have
to increase the slope bias according to the filter size.
This might be overkill in most situation but I don't feel
this should become a setting and should be kept in sync
with the filter. If it has to become an option, it should
simply a factor between unbiased filter and best bias.
#### Shadow terminator
The remaining artifacts are all related to shadow terminator
one way or another. It is always caused by the shading
normal we use for biasing and visibility computation not
being aligned with the geometric normal.
This is still something we need a setting for somewhere.
Pull Request: https://projects.blender.org/blender/blender/pulls/121088
When passing strings to str.format(..) use `{:s}` format specifier
which only takes strings and wont run `.__str__()` on non-strings.
While `{!s}` is an equivalent to `%s`, for the most part `%s` was
used for strings, so using `{:s}` is clearer and more specific.
Part of modernizing scripts in Blender, where the previous convention
was to use percentage formatting which has become the "old" way to
format strings in Python.
See proposal for details #120453.
Ref !120552
Updates to refactor from [0].
- Rename "_context" as it's no longer unused.
- Remove call to `iface_` as the string no longer contains text.
- Remove redundant `enumerate(..)`.
- Use ternary operator instead of a tuple lookup.
- Assign a ratio variable for reuse.
[0]: 7e2075b809