Commit Graph

3492 Commits

Author SHA1 Message Date
Philipp Oeser
9077a26ba2 Fix #138265: Ctrl+shift+left click to Preview socket inconsistency
There are two implementations:

- "Link to Viewer Node"
-- when clicking on a socket directly, link from that socket [done by
first selecting and then taking that selection state into account]
-- otherwise cycles through available sockets
- "Connect to Output" [python operator, made core from Node Wrangler]
-- does not take socket selection into account
-- only cycles through available sockets

So goal is to replicate behavior of "Link to Viewer Node" in "Connect to
Output" in terms of "which socket to link from"

This is done by
- exposing a sockets select state to python
- tweaking the call to bpy.ops.node.select so it does socket selection
as well
- take that selection into account

Pull Request: https://projects.blender.org/blender/blender/pulls/138323
2025-05-11 09:52:16 +02:00
Jacques Lucke
4de3172058 Nodes: support search weight in menu for searchable enum 2025-05-10 06:28:59 +02:00
Hans Goudey
8ac48880e7 Point Cloud: Move "Random" default primitive creation to operator
Previously all new point clouds created in the main database would
have the random 400 points. Now that's only the point cloud created
from the add menu.

Similar to f98d74c80d.

Pull Request: https://projects.blender.org/blender/blender/pulls/138685
2025-05-10 02:24:18 +02:00
Hans Goudey
bb8719030d Geometry: Initial replacement of CustomData with AttributeStorage
As described in #122398, implement read and write support for a new
attribute storage system. Currently this is only implemented to support
forward compatibility; the format used at runtime isn't changed at all.
That can be done one step at a time during the 4.5 and 5.0 development
cycles. A new experimental option for testing tells Blender to always
save with the new format.

The main benefit of the new structure is that it matches the attribute
system design, it allows for future attribute storage optimization, and
each attribute is an allocated struct, which will give pointer stability
for the Python API.

The next step is to connect the attribute API and the RNA API to
AttributeStorage for the simplest geometry type, point clouds.

Pull Request: https://projects.blender.org/blender/blender/pulls/133874
2025-05-09 17:27:07 +02:00
Campbell Barton
b9d4b3b9a4 Cleanup: unused import 2025-05-09 13:36:18 +10:00
Jacques Lucke
fb86bf0367 Nodes: support searching for color blend modes in Add menu
This is a follow up to #138534. It adds support for searching for all color blend
operations. It's supported in Geometry Nodes, Compositor and Shader Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138581
2025-05-09 04:02:50 +02:00
Alexandre-Cardaillac
921c2b9d61 Shader: New Volume Coefficients Shader
Add a new shader node to control volume coefficients (scattering,
absorption and emission) directly, making it easier to model existing
volumes with measured data.

Pull Request: https://projects.blender.org/blender/blender/pulls/136287
2025-05-08 19:19:35 +02:00
Nathan Vegdahl
e0beb7afe6 Templates for render output paths
This adds basic templating support to render output paths. By putting
"{variable_name}" in the path string, it will be replaced by the named
variable's value when generating the actual output path. This is similar
to how "//" is already substituted with the path to the blend file's
current directory.

This templating system is implemented for both the primary render output
path as well as the File Output node in the compositing nodes. Support
for using templates in other places can be implemented in future PRs.

In addition to the "{variable_name}" syntax, some additional syntax is
also supported:

- Since "{" and "}" now have special meaning, "{{" and "}}" are now
  escape sequences for literal "{" and "}".
- "{variable_name:format_specifier}", where "format_specifier" is a
  special syntax using "#", which allows the user to specify how numeric
  variables should be formatted:
  - "{variable_name:###}" will format the number as an integer with at
    least 3 characters (padding with zeros as needed).
  - "{variable_name:.##}" will format the number as a float with
    precisely 2 fractional digits.
  - "{variable_name:###.##}" will format the number as a float with at
    least 3 characters for the integer part and precisely 2 for the
    fractional part.

For the primary render output path: if there is a template syntax error,
a variable doesn't exist, or a format specifier isn't valid (e.g. trying
to format a string with "##"), the render that needs to write to the
output path fails with a descriptive error message.

For both the primary and File Output node paths: if there are template
syntax errors the field is highlighted in red in the UI, and a tooltip
describes the offending syntax errors. Note that these do *not* yet
reflect errors due to missing variables. That will be for a follow-up
PR.

In addition to the general system, this PR also implements a limited set
of variables for use in templates, but more can be implemented in future
PRs. The variables added in this PR are:

- `blend_name`: the name of the current blend file without the file
  extension.
- `fps`: the frames per second of the current scene.
- `resolution_x` and `resolution_y`: the render output resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/134860
2025-05-08 15:37:28 +02:00
Jacques Lucke
9e0e94e6e2 Nodes: simplify adding new empty node group
The main way to create a new node group right now is to select some nodes and
then press ctrl+G. This works well for the common case when one already has some
nodes to group. However, there is no good alternative currently for when one
wants to create a new group from scratch. A common workaround currently is to
add some dummy node, then press ctrl+G and then to delete the dummy node in the
group again. Obviously, we can do better than that.

This patch adds a `New Group` entry in the menu. It's available in geometry,
compositing and shading Nodes. The operator adds a new node group called
"NodeGroup" (the same default name we use for ctrl+G currently). Then it adds a
new group node and assigns the new group to it. The group itself does not have
any inputs or outputs by default because any such socket would just be a guess
that's likely wrong and more annoying than useful.

A nice side benefit of adding this operator is that the Group menu is not empty
in shading and compositing nodes initially which always looked a bit off.

Pull Request: https://projects.blender.org/blender/blender/pulls/138430
2025-05-08 10:17:56 +02:00
Jacques Lucke
156a405dd5 Nodes: support searching for specific math operations in Add menu
Previously, it was possible to search for specific math operations in
link-drag-search but not in the normal add menu. This patch adds support for
searching for specific operations in various math nodes.

A good trick for adding e.g. a vector add node is to search for `vadd`
(similarly with `iadd`).

The menu itself looks unchanged. This patch only adds additional elements to the
search.

Pull Request: https://projects.blender.org/blender/blender/pulls/138534
2025-05-08 04:28:22 +02:00
Martin-Vignali
9049645d0f FFmpeg: Add support for 10/12 bits FFV1 output
FFV1 supports more than 8 bits by pixel. Add support for 10 and 12 bit
depth (FFV1 encoder uses planar pixel format for these bitdepths).
Fix pixel format for 8 bit output. Previously it was always RGBA.

Co-authored-by: mvji <33432858+mvji@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/138192
2025-05-08 02:34:56 +02:00
Sergey Sharybin
d7aa98d07f Sequencer: Remove backdrop drawing in timeline
It always was functionality which got committed without proper review
by the module or UI/UX team. It has all sort of UX problems, but it is
also something that will be tricky to support for HDR drawing.

To brings things to a more manageable state the functionality is now
removed.
2025-05-07 16:21:06 +02:00
Pratik Borhade
ea439fdf0c Fix #91188: Change identifier prefix for some sculpt mode operations
With `MESH_OT` prefix, the shortcut was added to wrong
keymap ("object mode", see: `WM_keymap_guess_opname`).
idname of following operations has been changed, they are
only exposed in sculpt mode UI (also see their poll function:
`geometry_extract_poll`):
- `face_set_extract`
- `paint_mask_extract`
- `paint_mask_slice`

Pull Request: https://projects.blender.org/blender/blender/pulls/133852
2025-05-07 10:30:58 +02:00
Eitan Traurig
dd43ea4e9e UI: Add "Remove All Materials" operator
Added a new operator `OBJECT_OT_material_slot_remove_all`
that removes all materials from the material slots of selected objects

This was inspired by a request proposal on RCS.

Pull Request: https://projects.blender.org/blender/blender/pulls/138402
2025-05-07 08:06:52 +02:00
Campbell Barton
16c87b62e4 UI: include rip in the UV menu
The shortcut for this operator wasn't discoverable.
Show this in the menu as done with with edit-mesh rip.
2025-05-07 15:49:21 +10:00
Bartosz Kosiorek
899f8e370f UI: Further tweak fluid settings labels
Following #137490

Pull Request: https://projects.blender.org/blender/blender/pulls/138225
2025-05-06 19:02:57 +02:00
Richard Antalik
4a11be2656 VSE: Add option to translate pivot point
This feature allows you to change postion of origin/pivot for images
without changing their position.

It is implemented as property of transform operator. It is activated
by pressing `Ctrl + .` shortcut.
Move Origin item was also added to transform menu.

Origin can be snapped to 3x3 grid on strip image. This represents
most usual anchor points.

Ref: #134251
Pull Request: https://projects.blender.org/blender/blender/pulls/134206
2025-05-06 05:16:56 +02:00
Campbell Barton
509b39f90e UV: support sticky modes when edge sync-select is enabled
Previously sync-select in edge-select mode behaved in much the same
way as vertex selection, since a selected edge could cause a vertex
on an a disconnected UV island to be selected.

Now single vertices are no longer considered selected when the
Sticky-Mode is set to "Location" (the default).

Notes on changes when sync-select is enabled:

- The main change from a user perspective is edge & face select modes
  show the selected edges.

- This resolves a problem in edge & face selection modes where it wasn't
  possible to differentiate between a selected edge and two selected
  vertices on either side of an unselected edge.
2025-05-06 02:59:40 +00:00
Jacques Lucke
1363319844 Geometry Nodes: add Import VDB node
This adds an Import VDB node. It loads all the grids from a .vdb file and hence
outputs a Volume geometry instead of an individual grid.

The grids are cached through the existing volume grid file cache, so they are
automatically deduplicated when volume grids are loaded from files in other
ways.

Pull Request: https://projects.blender.org/blender/blender/pulls/138380
2025-05-06 04:13:11 +02:00
Sergey Sharybin
9477fa4eb0 Migrate existing files to Git LFS
The files that were binary and were committed prior to the
Git LFS configuration in the main repository.

override restrictions

Pull Request: https://projects.blender.org/blender/blender/pulls/138452
2025-05-05 17:18:42 +02:00
Falk David
a7d2b7850e Grease Pencil: Add initial support for Node Tools
This adds inital Grease Pencil support for node tools.

Node tools work in `Object Mode`, `Edit Mode`,`Sculpt Mode`,
and `Draw Mode`.

While Grease Pencil has many editing tools, including editing
multiple frames at the same time, for now, node tools only
allow editing the current frame.

Currently, the idea is that node tools can do arbitrary changes
to the drawings, but cannot do changes to the existing layer tree, e.g.
changing the order of layers, removing a layer or groups, etc.

All the node tool specific nodes like `Selection` and `Set Selection`
are adapted to work with Grease Pencil. In `Draw Mode`, we currently
interpret everything as selected.
The `Active Element` node has a `Layer` mode that provides the
index of the active layer (if there is one).

When `Auto-Key` is used, a new keyframe is created on the
current frame.
Locked/invisible layers cannot be edited with node tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/136624
2025-05-05 10:41:21 +02:00
Kevin C. Burke
d5b697b3f1 Python API: Grease Pencil: Add handle helper class to expose more handle attributes
Exposes bézier handle data through a new `GreasePencilStrokePointHandle`
class on each point, which provides `position`, `type`, and `select` for both
`point.handle_left` and `point.handle_right`.

Also removes the old separate point attributes:
* `handle_left_type`, `handle_right_type`
* `select_handle_left`, `select_handle_right`

Pull Request: https://projects.blender.org/blender/blender/pulls/137780
2025-05-05 10:32:18 +02:00
Nika Kutsniashvili
5dd53fdb29 Fix: Avoid relative imports in UI code
Relative imports are intentionally avoided in UI code (`scripts/startup/bl_ui`) because it makes it impossible to run individual files in isolation.

Common workflow for making mock-ups and quick UI edits is to load the UI file in Blender's text editor with "Edit Source" operator, make changes, and run the script to see the changes. But in the current version it's impossible because files include relative imports, which don't allow Python to run scripts individually.

Pull Request: https://projects.blender.org/blender/blender/pulls/138246
2025-05-04 13:26:03 +02:00
Aaron Carlisle
ebeb5cc2fc Fix: Missing UI class registration
This was missing in ad9b5a1b00
2025-05-03 22:38:08 -04:00
Mukhesh
5055a4e5a3 FIX: Select operators in Sequencer Preview
Behavior of select all operator invoked by shortcut was inconsistent
with menu. This was, because operator context was not set.

Also the selection in timeline is cleared when running this operator
as not doing it may cause unexpected behavior for users.
Selection invert also follows the same behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/137713
2025-05-03 02:20:56 +02:00
Campbell Barton
0d6a0dfa29 Cleanup: reduce right-shift in Python iterators 2025-05-03 08:57:44 +10:00
Andrej730
db78c031c5 PyDoc: add types to property doc-strings in bpy.types
Also correct type for Object.children_recursive.

Ref !138346
2025-05-03 08:45:53 +10:00
Andrej730
24dc0482ac PyAPI: minor optimization using iterators for contains checks
Avoid building a list to perform a __contains__ check.

Ref !138346
2025-05-03 08:45:14 +10:00
Julien Duroure
0fa57b7774 glTF Exporter: Restore animation hook after slots management 2025-05-02 16:19:59 +02:00
Julien Duroure
c52b5387ba glTF exporter: Add mapping parameter in gather_image_hook
This is a breaking change for this hook in 4.5
2025-05-02 16:03:22 +02:00
Sybren A. Stüvel
f6167aab31 Anim: name new action slots after the last-used slot
When creating a new action slot for a data-block, via the '+ New' button
of the slot selector, use the name of the slot that was last used by
that data-block. Previously, it would always use the name of the
data-block, interfering with slot auto-selection when toggling between
Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/138326
2025-05-02 16:03:00 +02:00
Julien Duroure
a5834743f3 glTF exporter: Refactor image uri management
Now uri is precalculated, to be able to change it in a hook
2025-05-02 15:58:46 +02:00
Julien Duroure
eee3c96a8f Fix: glTF: Avoid crash when object is another scene is not in object mode 2025-05-02 15:56:15 +02:00
Julien Duroure
61e6c91c4e Fix: glTF: Fix regression - bone flat hierarchy export 2025-05-02 15:53:53 +02:00
Julien Duroure
743a6ae2a5 Fix: glTF: Fix active/inactive UI for ShapeKeys animation panel 2025-05-02 15:49:16 +02:00
Julien Duroure
bc8a39fba0 glTF: Better error handling when image is not found 2025-05-02 15:42:33 +02:00
Julien Duroure
f879c37a06 glTF: Cleanup function name 2025-05-02 15:40:58 +02:00
Julien Duroure
caaf148d50 Fix: glTF Exporter: Fix Track export when Apply Modifier 2025-05-02 15:38:29 +02:00
Julien Duroure
ee6e978d07 Fix: glTF exporter: Fix exporting Vertex Color for Unlit Materials 2025-05-02 15:35:32 +02:00
Julien Duroure
23e16f3371 Fix: glTF: Fix crash in animation pointer when no SpecularColorFactor can be found 2025-05-02 15:32:57 +02:00
Julien Duroure
3e8aabcd0b glTF importer: add option to import scenes as Collection(s) or Scene(s) 2025-05-02 15:30:18 +02:00
Julien Duroure
6e689ec59c glTF exporter: Clamp Normalized Vertex Color values 2025-05-02 15:27:43 +02:00
Julien Duroure
705ba465bb glTF importer: New option to import unused materials & images 2025-05-02 15:25:04 +02:00
Julien Duroure
dbb2b01ff9 glTF Exporter: AO color can now be used as BaseColor 2025-05-02 15:20:40 +02:00
Hans Goudey
99c87fbf18 Fix #137299: Exception with batch rename of nodes outside node editor
I'm not sure when this stopped working. The function in question is
quite confusing since it's called twice with two different purposes.
Fixing the exception is simple though. Just checking the data type
for "None" prevents changing the data type to one that's invalid given
the context. I didn't find a simple way to add an error message though.

Pull Request: https://projects.blender.org/blender/blender/pulls/138287
2025-05-02 15:17:23 +02:00
Julien Duroure
cc3a131947 glTF exporter: Cache Sampler Output
Results to lighter file size
2025-05-02 15:15:16 +02:00
Julien Duroure
c3ab321d2a glTF exporter: Export Viewport Material
New option to export Viexport Material instead of Node tree:
- Very Fast
- Custom Properties of the material can still be exported

Is exported:
- Base Color
- Roughness
- Metallic
2025-05-02 15:12:56 +02:00
Pratik Borhade
3aea40b8cd Anim: Bone collection UI changes
Allow assign/select operators to execute when armature tab is pinned.
For assign operators, pinned armature should be active in 3D view
because we cannot assign bones of one armature to the bone collection of
different armature. Added extra condition in poll function to control
the above case.
For select operators, use `ED_armature_context` to obtain pinned Armature.
These operators are now hidden in object modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/137587
2025-05-02 11:52:33 +02:00
Sietse Brouwer
668aed18e9 Grease Pencil: Viewport option for showing onion skins of the active object only
This PR adds an option to only show the onion skins of the active
object. The option is added to the Grease Pencil overlay menu in the
3D viewport.
When enabled, only the onion skins of the active object are shown.
This keeps the viewport a lot cleaner when working with multiple
Grease Pencil objects.

This resolves #136820.

Pull Request: https://projects.blender.org/blender/blender/pulls/137405
2025-05-01 17:43:17 +02:00
Nathan Vegdahl
4e7dfcbe3f Modeling: Add Auto Normalize when Assigning vertex weights
Part of #135062.

This PR adds an Auto Normalize option in the Vertex Group panel that
when checked will normalize the other deform-bone vertex groups' weights
when assigning the weight of a deform-bone vertex group. For example if
a selected vertex has the following weights:

| Name    | Weight |
|---------|--------|
| Group 1 | 0.2    |
| Group 2 | 0.2    |
| Group 3 | 0.6    |

And the user selects Group 3, checks the Auto Normalize checkbox, sets
the weight to 0.8, and clicks Assign, the new weights will be:

| Name    | Weight |
|---------|--------|
| Group 1 | 0.1    |
| Group 2 | 0.1    |
| Group 3 | 0.8    |

Co-authored-by: Andy Beers <acbeers1@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/138133
2025-05-01 16:08:10 +02:00