Commit Graph

1506 Commits

Author SHA1 Message Date
Jacques Lucke
f4b9ca758a Nodes: add color tag to node groups
This allows setting a color tag for node groups which affects the header
color of group nodes. With this, node groups can look even more similar
to built-in nodes. The only remaining difference is the node group icon in
the node header.

Blender has quite a few different built-in color tags. Most of those are
exposed with very few exceptions. For example, the layout, interface
and pattern categories are not exposed because they are only for built-in
nodes or are not used anymore.

It's generally agreed upon that the set of different color tags is likely too
large. Some differences between color make more sense in some contexts
than in others. In the interest of consistency, it was decided to expose all
these categories anyway. If we ever decide to consolidate them, the worst
that can happen is that a group looses it's category, which wouldn't be too bad.

Pull Request: https://projects.blender.org/blender/blender/pulls/121385
2024-05-08 22:00:35 +02:00
Jacques Lucke
2f289857af Object: add Shade Auto Smooth operator
Based on the design in #120230.
* Replaces the `Shade Smooth by Angle` operator with `Shade Auto Smooth`
  in the object context menu menu.
* The new operator automatically adds and removes the modifier instead
  of being a destructive operation.
* The `Shade Smooth` and `Shade Flat` operators now remove the
  `Smooth by Angle` modifier automatically.
* Add a pin option to modifiers, which limits dragging and keeps the
  modifier after newly added modifiers in the list.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121494
2024-05-08 20:24:10 +02:00
Clément Foucault
0e4e05ec97 EEVEE-Next: Make volume light-probe surfel density scale dependant
This avoids wrong default values and make setup easier.

This changes the RNA and DNA to create a new nice default
depending on resolution.
2024-05-08 18:22:44 +02:00
Jacques Lucke
125afb20d3 Nodes: reorganize node group properties UI
The initial motivation for this came from #121334, because now there
are two description inputs which look very alike and not's not obvious
at a glance where they belong to. Additionally, I find myself sometimes
looking for node properties in the group properties panel because of the same panel name.

This patch does the following changes to improve the situation:
* Reorder the node group properties and socket interface panel.
* Rename `Properties` panel to `Group` (similar to `Node` in the corresponding tab).
* Rename the `Interface` panel to `Group Sockets`.
* Add a `Name` field for the node group. This makes it even more obvious that
  one is looking at the group properties. Also it makes it possible to rename
  the group without having to go up one level to change the name in the group node.
* New layout-panel for the different usages. This only exists for geometry nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/121564
2024-05-08 18:03:49 +02:00
Sergey Sharybin
149e547de6 Compositor: Remove quality setting from DNA and UI
It was meant to be included into the previous commit in the area,
but was forgotten due to some technicalities.

Also remove the DisplaceSimpleOperation, which is now not used.

Pull Request: https://projects.blender.org/blender/blender/pulls/121580
2024-05-08 16:56:32 +02:00
Sergey Sharybin
6db8091f45 Compositor: Remove Two Pass option
There are few issues with the logic and implementation of this option:

- While the first pass is faster in the terms of a wall-clock time, it
  is often not giving usable results to artists, as the final look of
  the result is so much different from what it is expected to be.

- It is not supported by the GPU compositor.

- It is based on some static rules based on the node type, rather than
  on the apparent computational complexity.

The performance settings are planned to be moved to the RenderData, and
it is unideal to carry on such limited functionality to more places. There
are better approaches to quickly provide approximated results, which we can
look into later.

Pull Request: https://projects.blender.org/blender/blender/pulls/121558
2024-05-08 14:34:11 +02:00
Jacques Lucke
25c134fd08 Geometry Nodes: new Axes to Rotation node
This adds a new `Axes to Rotation` node which creates a new rotation.
In many cases, the primary and secondary axis inputs are a normal and
tangent of a mesh or curve. This provides a simpler and more direct way
to create this rotation compared to using two `Align Rotation to Vector` nodes.

This more direct way of computing the rotation also allows us to optimize
the case better.

The node rotates one axis (X, Y or Z) to the given primary axis direction. Then
 it rotates around that primary direction to align the second axis to the given
secondary direction. Ideally, both input axes are orthogonal. However, the node
still creates the "best" rotation when they are not orthogonal. If one or the axes
is zero or both are (close to) parallel, the resulting rotation is unstable. There is
not too much the node can do to make it more stable.

Pull Request: https://projects.blender.org/blender/blender/pulls/104416
2024-05-08 13:34:14 +02:00
Campbell Barton
3d84a1170f Extensions: ensure extensions "site-packages" precede Python's
Ensure extensions modules aren't overridden to the systems modules.
Without this, installing a system module could break an extension.
2024-05-08 21:32:16 +10:00
Campbell Barton
e64d067c78 Docs: document why the eventstate is cleared while refreshing a popup
Also correct a comments grammar.
2024-05-08 20:44:36 +10:00
Pratik Borhade
5f1a31c88a GPv3: Change "active" property to "active_layer"
Rename layer property `active` -> `active_layer` to distinguish
between active layer and active layer group.
The active group property was introduced in d1710f7232.

Pull Request: https://projects.blender.org/blender/blender/pulls/121563
2024-05-08 12:18:00 +02:00
Jacques Lucke
d740d6b942 Fix: node group description only available for geometry nodes 2024-05-08 11:42:00 +02:00
Jacques Lucke
6176e66636 Nodes: add node group description
This allows node groups to have a description that is shown in the add menu
or when hovering over the node header.

This new description is stored in `bNodeTree.description`. Unfortunately, it
conflicts a bit with `ID.asset_data.description`. The difference is that the latter
only exists for assets. However, it makes sense for node groups to have
descriptions even if they are not assets (just like `static` functions in C++ should
also be able to have comments). In some cases, node groups are also generated
by addons for a specific purpose. Those should still have a description without
being reusable to make it easier to understand for users.

The solution here is to use the asset description if the node group is an asset,
and to use `bNodeTree.description` otherwise. The description is synced
automatically when marking or clearing assets.

A side benefit of this solution is that appended node group assets can keep their
description, which is currently always lost.

Pull Request: https://projects.blender.org/blender/blender/pulls/121334
2024-05-08 11:25:00 +02:00
Aras Pranckevicius
d66598c16f VSE: Text shadow blur / outline
Text strips in VSE got:
- Configurable shadow angle and offset (previously shadow location relative to
  text was fixed). Currently the shadow position is rounded to integer pixel
  locations; sub-pixel positioning might come later.
- Optional shadow blur amount.
- Optional outline, with color and outline width controls. Outline is
  implemented using jump flooding algorithm.

Images and more detail in pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/121478
2024-05-08 11:13:20 +02:00
Philipp Oeser
5817553105 Fix: python errors due to missing shadow resolution scale prop
Was moved (as different prop) to the sampling panel in 826d2ed4ec

Pull Request: https://projects.blender.org/blender/blender/pulls/121561
2024-05-08 10:31:43 +02:00
Hans Goudey
ba9286706a Geometry Nodes: Sample Grid Index node
This (experimental, for now) node retrieve's voxel values
at specific voxel indices for a grid input. It's similar to the
Sample Grid node (77cba3d551), but there is
no interpolation, and it uses indices instead of positions.

Pull Request: https://projects.blender.org/blender/blender/pulls/118690
2024-05-07 21:53:22 +02:00
Clément Foucault
a7eb1a13d4 Cleanup: EEVEE-Next: Make format 2024-05-07 16:36:09 +02:00
Clément Foucault
d9915b86a6 EEVEE-Next: Remove shadow softness factor parameter
This parameter was introduced to mitigate shadow tracing
artifacts. These are no longer present since #121317 and
leaving this parameter breaks PBR rules which opens other
issues with shadow disconnected from shading.
2024-05-07 15:49:49 +02:00
YimingWu
504c233d19 Fix #121485: Add EEVEE legacy in light influence panel
While options are moved in 0c50ec866f, these influence values are not
assigned to EEVEE legacy in the influence panel, now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121510
2024-05-07 11:22:40 +02:00
Hans Goudey
42210342ca Cleanup: Remove outdated references to UV_SCULPT
See e3894f0a07
2024-05-06 17:44:51 -04:00
Iliya Katueshenock
968b98be56 Geometry Nodes: new Input Rotation node
This adds a new node input node for a constant rotation.
Similar nodes exist for vector, integer, boolean, etc. already.

Pull Request: https://projects.blender.org/blender/blender/pulls/120345
2024-05-06 19:04:30 +02:00
Guillermo Venegas
89c1f7e0c3 IO: Use file handler in space VSE
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
2024-05-06 17:44:50 +02:00
Campbell Barton
98f319ce02 Cleanup: spelling in comments 2024-05-04 15:24:46 +10:00
casey bianco-davis
3f15c244f4 GPv3: Draw tool: "Draw on back" option
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
2024-05-03 18:04:38 +02:00
Julian Eisel
a6ebfb05ad UI: Option to store enabled asset shelf catalogs in preferences
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
2024-05-03 10:20:01 -04:00
Campbell Barton
95fcffed4a Cleanup: remove debug print 2024-05-03 23:23:35 +10:00
Sybren A. Stüvel
424032b5e5 Grease Pencil: Fix Python error when built without experimental features
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
2024-05-03 15:23:03 +02:00
Campbell Barton
ad16a843c1 Cleanup: format, single quote enums & indentation 2024-05-03 11:33:23 +10:00
Hans Goudey
f585aa7612 Refactor: Move BrushAssetShelf to properties_paint_common
Make BrushAssetShelf more easily reusable accross different space_*
UI definition files.
2024-05-02 20:53:28 -04:00
Nika Kutsniashvili
38fcaf9ab9 Fix: Python error when no active object and hitting F3
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
2024-05-02 21:34:43 +02:00
Julian Eisel
05b125f399 Asset Shelf: Add default preview size option
Allow changing the size of previews in a new asset shelf
when registering a new asset shelf type.

Pull Request: https://projects.blender.org/blender/blender/pulls/121358
2024-05-02 12:56:53 -04:00
Nika Kutsniashvili
a3627fe88e UI: Tweaks to Object > Modifier menu
- 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
2024-05-02 18:13:41 +02:00
Sebastian Parborg
221951657b VSE: Make cache overlay visible to non "Developer extras" users
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
2024-05-02 16:36:11 +02:00
Hans Goudey
9209255f43 Cleanup: Make format 2024-05-02 08:52:07 -04:00
Amelie Fondevilla
725408e842 GPv3: Extrude operator
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
2024-05-02 12:51:30 +02:00
Philipp Oeser
7629ef218e Fix #121134: Hide Proportional Editing for armature editmode
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
2024-05-02 09:23:10 +02:00
Campbell Barton
f6b7464b4c Cleanup: spelling in comments 2024-05-02 16:44:10 +10:00
Campbell Barton
0a17f4a711 Extensions: add an extensions-local site-packages
This will be used as the destination location for wheels.
Currently this is only added to the `sys.path` if it already exists.
2024-05-02 12:49:02 +10:00
Iliya Katueshenock
831e91c357 Geometry Nodes: support working with raw matrix values
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
2024-05-01 21:31:08 +02:00
Clément Foucault
ab30784076 EEVEE-Next: Implement spherical harmonic deringing
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
2024-05-01 16:18:51 +02:00
Pratik Borhade
a42e2a5a29 GPv3: Mask toggle in dopesheet channel
Add `use_mask` property in dopesheet layer channel.
Also add an icon to the `use_mask` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/121259
2024-05-01 15:10:22 +02:00
Clément Foucault
826d2ed4ec EEVEE-Next: Move shadow resolution scale to the sampling panel 2024-05-01 14:45:51 +02:00
Hans Goudey
e63c8bb3c2 UI: Add Modifiers submenu to 3D view header
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
2024-05-01 14:15:53 +02:00
Sean Kim
d4a61647bf Sculpt: Add Line Trim tool
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
2024-05-01 14:10:26 +02:00
Clément Foucault
303f91a09c EEVEE-Next: Add slab thickness and thickness from shadow options
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
2024-04-30 20:32:46 +02:00
Sybren A. Stüvel
10c00b6390 Anim: Add RNA enum for animation bindings + operator to un-assign
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:

![image](/attachments/ac357f32-d50a-481b-8b3c-9c0be07424b6)

Pull Request: https://projects.blender.org/blender/blender/pulls/121269
2024-04-30 17:37:16 +02:00
Hans Goudey
efea8c000f Cleanup: Make format 2024-04-30 09:56:13 -04:00
Hans Goudey
462e7aeedd Geometry Nodes: Add Align Rotation to Vector node
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
2024-04-30 15:52:11 +02:00
Sybren A. Stüvel
0da53b5e62 Anim: Change how names of Bindings work, and how Bindings are created/assigned
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
2024-04-30 15:51:47 +02:00
Sergey Sharybin
ad8cb0cff3 Use the redirect.b.o website for bug reports
There should be no functional changes on user level, just allows
to more easily do tweaks to the bug report template without worrying
about compatibility with Blender.

With this change it is only GPU, OS, and such are passed to the URL,
without actual text.

Ref infrastructure/blender-projects-platform#78

Pull Request: https://projects.blender.org/blender/blender/pulls/121215
2024-04-30 14:56:33 +02:00
Matias Mendiola
66a5eda33e Cleanup: GPv3: UI Menu updates
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
2024-04-30 14:03:31 +02:00