Commit Graph

655 Commits

Author SHA1 Message Date
Omar Emara
6c62fb5ff6 Compositor: Turn Color Balance options to inputs
This patch turns the options of the Color Balance node into inputs.

In the process, each of the wheels were split into two inputs, a base
float and a color. For instance, Gain is controlled using both a Base
Gain and Color Gain, the former controls the gain for all channels while
the latter controls it per channel.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138610
2025-05-23 15:42:54 +02:00
Campbell Barton
99a4c93081 Cleanup: inline array sizes in code-comments
Use a similar convention for struct member identifiers,
(the identifiers without surrounding spaces). This allows the values
to be scanned and validated.
2025-05-23 00:41:39 +10:00
Jacques Lucke
afe57f6598 Fix: unintentional fall-through in switch statement 2025-05-22 04:56:05 +02:00
Campbell Barton
e5deeafe92 Cleanup: spelling in comments (make check_spelling_*) 2025-05-22 11:11:48 +10:00
Campbell Barton
0bd62779e8 Cleanup: various non-functional changes for C++ 2025-05-22 01:01:08 +00:00
Campbell Barton
d603d872b9 Cleanup: quiet missing-declarations warning 2025-05-22 01:01:06 +00:00
Bastien Montagne
4397fa5056 Refactor: Convert Node Socket Default Value and Storage readfile code to typed DNA handling.
For default values, the fairly complex reasoning for the code is explained
in details in comments. The TL;DR: would be that this code is needed to
safely load blendfiles older than 2.83, which were saved without any DNA
type information for these default value data.

Storage data have always been written with DNA info (added in commits
3bae60d0c9 and 9d91bc38d3), so no need to add special handling for them.
Just use regular DNA struct reading.

Pull Request: https://projects.blender.org/blender/blender/pulls/139175
2025-05-21 18:47:31 +02:00
Omar Emara
14f7faf283 Compositor: Turn Crop node options to inputs
This patch turns the options of the Crop node into inputs.

Instead of specifying the bounds of the crop, the inputs now specify the
Width and Height of the crop region. The Crop Image Size option was
renamed to Alpha Crop and inverted, so it now defaults to actual
cropping. The Relative option was removed, as it is now superseded by
the Relative To Pixel node, and removal was done to facilitate the
options to inputs project.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/139163
2025-05-21 11:01:25 +02:00
Omar Emara
79d37720de Nodes: Add Factor and Percentage subtypes for vector sockets
This patch adds support for the Factor and Percentage subtypes for
vector sockets. This is needed by the compositor, since it has some node
inputs that specify locations and sizes relative to image size, and
having factor and percentage subtypes for those improves the UX quite a
bit according to user feedback.

Pull Request: https://projects.blender.org/blender/blender/pulls/138805
2025-05-15 08:29:41 +02:00
Omar Emara
0cee690de3 Fix: String file path interface socket has wrong type
The string interface sockets with a file path subtype are assigned a
vector translation type, which is probably a typo in the original
implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/138803
2025-05-13 10:56:56 +02:00
Jacques Lucke
23d5ae7da5 Refactor: Nodes: decentralize node storage blend read/write
Previously, whenever a node had a non-trivial storage struct, there would have
to be code for it in `node.cc`. Now there is a general callback that new node
types can use to implement their blend read/write behavior.

Some existing nodes were converted to use this decentralized method. However,
some older nodes can't use it in the same way, because the node types were
introduced before there were node idnames. It's also somewhat hard to reason
about special cases that versioning code might have for these nodes, so they
remain unchanged.

The node callback only writes the non-trivial data, while the main node storage
struct is written automatically by relying on `bNodeType::storagename`. This
simplifies the callback in many cases or makes it unnecessary for trivial types.

Some nodes have specific handling for forward-compatibility. This
forward-compatibility code is kept in `node.cc` for now, because it also affects
the main storage struct and therefore has to be changed before that struct is
written.

Pull Request: https://projects.blender.org/blender/blender/pulls/138722
2025-05-13 07:00:03 +02:00
Omar Emara
fd3ca68b5e Compositor: Turn Bokeh Blur options to inputs
This patch turns the options of the Bokeh Blur node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138664
2025-05-09 14:15:14 +02:00
Campbell Barton
fd6ac498b0 Cleanup: spelling in comments, strings (make check_spelling_*)
Also replace some triple-quoted non-doc-string strings with commented
blocks in examples.
2025-05-06 00:18:39 +00:00
Jacques Lucke
e09ccc9b35 Core: add templated version of BKE_id_new_nomain to reduce explicit casting
This adds a version of `BKE_id_new_nomain` that takes the ID type parameter as
template argument. This allows the function the return the newly created ID with
the correct type, removing the need to use `static_cast` on the call-site.

To make this work, I added a static `id_type` member to every ID struct. This
can also be used to create a similar API for other id management functions in
future patches.

```cpp
// Old
Mesh *mesh = static_cast<Mesh *>(BKE_id_new_nomain(ID_ME, "Mesh"));

// New
Mesh *mesh = BKE_id_new_nomain<Mesh>("Mesh");
```

Pull Request: https://projects.blender.org/blender/blender/pulls/138383
2025-05-05 18:41:03 +02:00
Omar Emara
1f51172692 Compositor: Turn Alpha Over options to inputs
This patch turns the options of the Alpha Over node into inputs.

In the process, Convert Premultiplied option was renamed to Straight
Alpha.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138441
2025-05-05 14:16:27 +02:00
Habib Gahbiche
987fc14ada Cleanup: simplify logic in node tree iterator
Return separately for each node tree type.

This patch originally started as a refactor to change the logic of
iterating through compositing node trees but we ended up choosing
a different solution so only the small cleanup part is submitted here.

Pull Request: https://projects.blender.org/blender/blender/pulls/138205
2025-05-01 11:08:13 +02:00
Omar Emara
510130de07 Compositor: Turn Bilateral Blur options to inputs
This patch turns the options of the Bilateral Blur node into inputs.

In the process, the Sigma Space and Iterations were joined into a single
Size input, previously they were just added together then ceiled to get
the blur size. Furthermore, Sigma Color was renamed to threshold and now
represents the average color difference, not the sum, so it was
previously multiplied by 3.

Versioning and RNA compatibility is not perfect due to joining the two
size options.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138249
2025-05-01 09:57:57 +02:00
Omar Emara
f216b3ca62 Compositor: Turn Directional Blur options to inputs
This patch turns the options of the Directional Blur node into inputs.

In the process, the node now allows scaling down, not just scaling up.
The transformation options were renamed to Translation, Rotation, and
Scale as opposed to Distance, Spin, and Zoom. Finally, scaling is now
defined as a scale instead of a delta. So 1 is identity, 2 means scale
up two times, and so on. While previously, 0 was an identity scale, 1
means scale up by two types.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138198
2025-04-30 14:40:13 +02:00
Damien Picard
a4669e3a8f Fix: Bring back UI translation of node header labels
Translation of node header labels was removed in cleanup
commit 02281dd26a, likely by mistake.

Issue reported by Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/138052
2025-04-30 12:29:00 +02:00
Omar Emara
7a6acfac62 Compositor: Turn Sun Beams options to inputs
This patch turns the options of the Sun Beams node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138184
2025-04-30 11:46:36 +02:00
Omar Emara
93408e03a4 Compositor: Turn Ellipse Mask options to inputs
This patch turns the options of the Ellipse Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138130
2025-04-29 15:20:54 +02:00
Omar Emara
3d4900f412 Compositor: Turn Box Mask options to inputs
This patch turns the options of the Box Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138129
2025-04-29 14:34:23 +02:00
Omar Emara
ddc0f9460d Compositor: Turn Lens Distortion options to inputs
This patch turns the options of the Lens Distortion node into inputs.

The Projector option was turned into an enum between two options.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138113
2025-04-29 09:54:12 +02:00
Omar Emara
39aa73628d Compositor: Turn Color Correction options to inputs
This patch turns the options of the Color Correction node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138003
2025-04-28 12:19:42 +02:00
Omar Emara
ad49181f90 Compositor: Turn Plane Track Deform options to inputs
This patch turns the options of the Plane Track Deform node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137949
2025-04-24 12:47:15 +02:00
Omar Emara
290c015a75 Compositor: Turn Stabilize node options to inputs
This patch turns the options of the Stabilize node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137911
2025-04-24 09:34:30 +02:00
Omar Emara
f4e46b3fdd Compositor: Turn ID Mask node options to inputs
This patch turns the options of the ID Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137905
2025-04-23 16:31:27 +02:00
Omar Emara
8c616a8a00 Compositor: Turn Keying node options to inputs
This patch turns the options of the Keying node into inputs.

In the process, some options were renamed for clarity and consistency
with other nodes.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137900
2025-04-23 15:33:22 +02:00
Omar Emara
8bb1ebb5f7 Compositor: Turn Keying Screen options to inputs
This patch turns the options of the Keying Screen node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137851
2025-04-22 15:57:46 +02:00
Omar Emara
730cb40f4c Compositor: Turn Color Spill options to inputs
This patch turns the options of the Color Spill node into inputs.

In the process, the Ratio option was renamed to Limit Strength, the
unspill option was renamed to Spill Strength.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137848
2025-04-22 14:51:26 +02:00
Omar Emara
5e93b6a2cd Compositor: Turn Luminance Key options to inputs
This patch turns the options of the Luminance Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137823
2025-04-22 09:09:51 +02:00
Omar Emara
d791ea7cc2 Compositor: Turn Distance Key options to inputs
This patch turns the options of the Distance Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137817
2025-04-21 19:28:57 +02:00
Omar Emara
3c9f33ad07 Compositor: Turn Difference Key options to inputs
This patch turns the options of the Color Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137816
2025-04-21 17:59:24 +02:00
Omar Emara
fa7d58ab4c Compositor: Turn Color Key options to inputs
This patch turns the options of the Color Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137815
2025-04-21 16:40:17 +02:00
Omar Emara
4f3413ff80 Compositor: Turn Chroma Key options to inputs
This patch turns the options of the Chroma Key node into inputs.

In the process, the minimum and maximum angles were renamed to Minimum
and Maximum for consistency with other matte nodes.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137812
2025-04-21 15:28:37 +02:00
Omar Emara
89b268bf0c Compositor: Turn Channel Key options to inputs
This patch turns the options of the Channel Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137806
2025-04-21 14:02:15 +02:00
Omar Emara
e115467f8a Compositor: Turn Vector Blur node options to inputs
This patch turns the options of the Vector Blur node into inputs.

In the process, the factor input was renamed to Shutter and was remapped
to match the shutter in Cycles/EEVEE.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137725
2025-04-18 15:09:27 +02:00
Omar Emara
54a8ab9a97 Compositor: Turn Anti-Alias node options into inputs
This patch turns the options of the Anti-Alias node into inputs.

In the process, the [0, 1] limit of the Contrast Limit input was lifted
to allow normalized arbitrary positive limits.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137717
2025-04-18 12:48:08 +02:00
Omar Emara
24379b8243 Compositor: Turn Denoise node options into inputs
This patch turns the options of the Denoise node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137669
2025-04-17 16:39:11 +02:00
Omar Emara
96761b8df2 Compositor: Turn Despeckle node options into inputs
This patch turns the options of the Despeckle node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137656
2025-04-17 13:21:36 +02:00
Omar Emara
293e2ed833 Compositor: Turn Kuwahara node options into inputs
This patch turns the options of the Kuwahara node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137609
2025-04-17 10:23:24 +02:00
Omar Emara
7f02fd3192 Compositor: Turn Pixelate node options into inputs
This patch turns the options of the Pixelate node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137603
2025-04-16 15:34:50 +02:00
Omar Emara
55cc96b556 Compositor: Turn Inpaint node options into inputs
This patch turns the options of the Inpaint node into inputs.

The Distance options were renamed to Size for consistency with other
nodes.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137597
2025-04-16 14:56:00 +02:00
Omar Emara
e361054df4 Compositor: Turn Dilate node options into inputs
This patch turns the options of the Dilate node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137593
2025-04-16 12:50:46 +02:00
Omar Emara
e7778593f8 Compositor: Turn Tone Map node options into inputs
This patch turns the options of the Tone Map node into inputs.

In the process, a few changes were made. Input ranges were adjusted to
remove artificial limits. The papers indeed mention those limits, but
they were only mentioned as typical values, not valid ranges.

- The Key option is no longer limited to 1.
- Gamma is no longer limited to a value of 3.
- Intensity is no longer limited to [-8, 8].
- Contrast is no longer limited to [0, 1].

A few renames were done to clarify options and match the reference
papers.

- Offset was renamed to Balance, since it is not really an offset, but
  balances between shadows and highlights. This can be looked up in the
  paper.
- Correction was renamed to Chromatic Adaptation, since it doesn't
  really correct anything.
- Adaptation was renamed to Light Adaptation to distinguish from
  Chromatic Adaptation and now default to global tone mapping, since
  this is more useful by default.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137589
2025-04-16 11:59:04 +02:00
Omar Emara
4940418317 Compositor: Turn Z Combine node options into inputs
This patch turns the options of the Z Combine node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137534
2025-04-15 15:20:02 +02:00
Omar Emara
ab81cd7bbb Compositor: Turn Invert node options into inputs
This patch turns the options of the Invert node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137527
2025-04-15 14:18:04 +02:00
Omar Emara
a4e7028b4c Compositor: Turn Split node options into inputs
This patch turns the options of the Split node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137518
2025-04-15 11:43:20 +02:00
Omar Emara
f71358d281 Compositor: Turn Switch node options into inputs
This patch turns the options of the Switch node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137512
2025-04-15 11:04:20 +02:00
Omar Emara
bc9176e5e1 Compositor: Turn Mask options into inputs
This patch turns the options of the Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137479
2025-04-14 17:00:44 +02:00