This patch adds a new Image Coordinates node for the compositor. The
Texture Coordinates and Pixel Coordinates outputs were removed from the
Image Info node and were added to the new node instead. Additionally, a
new Normalized Coordinates output was added.
The Pixel Coordinates output now no longer includes half pixel offsets.
Pull Request: https://projects.blender.org/blender/blender/pulls/138935
Nowadays, Geometry Nodes is not only evaluated by a modifier, but also by an
operator and in the future potentially by brushes. Therefore, the old name was
misleading because it sounded like it was specific to the modifier.
Pull Request: https://projects.blender.org/blender/blender/pulls/139378
This is used as base class for the compute contexts for group and evaluate
closure nodes. Furthermore, in the future this can be used for the compute
context that is passed into field evaluation.
Pull Request: https://projects.blender.org/blender/blender/pulls/139377
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
- Add a custom Iterator, so it can be iterated as a 1D list.
- Add missing functions like `first`, `is_empty`, `clear`, and
subscript operator.
- Add a `size_` member variable for faster `size` calls.
- Add compile-time asserts to ensure the Capacity sizes are valid.
- Add unit tests.
See #138947 for the motivation behind this.
Pull Request: https://projects.blender.org/blender/blender/pulls/139102
Node sockets have many different aspects that affect their visibility and
whether they are grayed out. This patch cleans up the methods used to check if
sockets are visible and adds descriptions that should make it more obvious which
ones should be used.
This also fixes a few places where the wrong method was used which is more
obvious now.
Pull Request: https://projects.blender.org/blender/blender/pulls/139251
The main goal of this patch is that the column widths and ordering is not reset
every time one switches between different contexts.
It does that by keeping track of multiple `SpreadsheetTable`. There is one for
each table that is viewed (so e.g. the point and edge domain of the same mesh
are two different tables). Each table has an identifier and an array of columns.
There is some garbage collection in place so that the number of stored tables
does not increase unbounded.
This also comes with an updated Python API:
```python
import bpy
spreadsheet = bpy.context.screen.areas[...].spaces.active
active_table = spreadsheet.tables.active
print(active_table.id.type)
print(active_table.id.attribute_domain)
print(active_table.columns[0].id.name)
```
In the future, we might add some smarter logic to keep tables with different
identifiers more in sync. We don't have a great heuristic for that yet.
Pull Request: https://projects.blender.org/blender/blender/pulls/139205
Use a similar convention for struct member identifiers,
(the identifiers without surrounding spaces). This allows the values
to be scanned and validated.
When enabled, this normalize the strength by the light area, to keep
the total output the same regardless of shape or size. This is the
existing behavior.
This is supported in Cycles, EEVEE, Hydra, USD, COLLADA.
For add-ons, an API function to compute the area is added for conversion,
in case there is no native support for normalization.
area = light.area(matrix_world=ob.matrix_world)
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/136958
Similar to other renderers, this adds a temperature property to set the
light color using blackbody emission. This can be more convenient than
using nodes, and can improve interop with other software.
This is supported in Cycles, EEVEE, Hydra, USD, COLLADA and FBX.
Pull Request: https://projects.blender.org/blender/blender/pulls/134303
Similar to other renderers, this adds an exposure property to multiply
the light power by 2^exposure. This can be more convenient to control
a wide range of values.
This is supported in Cycles, EEVEE, Hydra, USD, COLLADA and FBX.
Pull Request: https://projects.blender.org/blender/blender/pulls/134528
This patch adds snapping options for the playhead to all animation editors.
The options can be modified through a new dropdown in the editor header.
All editors will show all those options, and they are shared,
so toggling the option in on editor will change it for all other editors too.
Some options are not working/relevant in some editors for example
Strips in the Dope Sheet. However for consistency the option is still shown.
This is a separate menu from the transform snapping menu because
you can toggle the snapping for transform and playhead separately.
Putting it in the existing snapping transform menu would imply that it can
be turned off with the magnet which is not the case.
Playhead snapping is explicitly disabled for the drivers editor
because there is no playhead to drag around.
Snapping to Frame/Second intervals takes the scene start as a starting point.
That means you can snap to the n-th second of the animation even though
it might not start at frame 1. The preview range is NOT taken into account
by design since the use case is working on a sub-section of the animation
in which case the snap target should not change.
Snapping is toggled by pressing CTRL as indicated by the status bar.
Snapping to Frames/Seconds is absolute, meaning no matter
how far away your cursor it will snap to the closest snap point.
All others only snap to things if they are close to the cursor in pixel values.
When mixing those two behaviors, it prefers relative snapping.
If no point is close enough to snap relative,
it will fall back to absolute snapping.
Based on the prototype #135913
Part of #135794
Pull Request: https://projects.blender.org/blender/blender/pulls/137278
For IDProperties, this flag is mostly used only to controll whether
IDProperty code should also handle ID refcounting or not (through
`LIB_ID_CREATE_NO_USER_REFCOUNT`).
Without this fix, IDProp Group Merge could end up trying to modify ID
refcount of its data-block properties (via `IDP_FreeProperty`), which
can lead to data corruption or even crashes (e.g. when used in readfile
code, before lib-linking process).
Issue discovered while working on the system IDProperties split project
(!135807).
Pull Request: https://projects.blender.org/blender/blender/pulls/139230
Previously, when a socket was detected to be unused, it was just grayed out.
This patch adds support for automatically hiding unused sockets based on this
convention: Menu inputs control visibility while other inputs only control
whether something is grayed out.
More specifically, an input is visible if any of these conditions is met:
* It affects the output currently.
* It never affects the output. In this case its usage does not depend on any
menu input.
* It is used if all non-menu inputs are considered to be unknown.
In the future, we could support customizing which inputs are allowed to control
visibility. For now it's good to use the convention that Blender generally
follows itself.
As before, panels are grayed out if they only contain grayed out sockets and
panels are hidden when they don't contain any visible sockets.
Hiding inputs works in group nodes, the Geometry Nodes modifier and node
operators. In theory it will work for all node tree types, but since only
Geometry Nodes supports the Menu Switch node currently, this patch currently
only makes a difference there.
The implementation reuses the existing `SocketUsageInferencer` with a different
sets of inputs. So no new core-inferencing logic was needed.
Design task: #132706.
Pull Request: https://projects.blender.org/blender/blender/pulls/138186
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
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
This commit adds the `BKE_brush_duplicate` function that performs a deep
copy of a brush ID and all associated IDs into the current Main
database.
Unit tests are added with this case to ensure that grandchildren and
embedded data is handled correctly for both Sculpt and Grease Pencil
brushes, as the latter contains more ID references than other brush
types.
Related to #138105
Pull Request: https://projects.blender.org/blender/blender/pulls/138629
This improves implicit node inputs in multiple ways:
* Fix crash when switching a group input socket type from e.g. vector to
integer, while the default input is set to "position". Now, the default input
type is reset automatically if it's invalid.
* Add Left/Right Handle as possible implicit vector inputs (next to Position and
Normal). Those were the only ones that we used internally that were not
exposed yet.
* When creating a new group input from an existing socket, also initialize the
default input based on the socket. E.g. when grouping a `Set Position` node,
the `Position` input of the group will now also use the position attribute by
default.
In addition to these user-level changes, some internal changes were done too:
* Use unified `NodeDefaultInputType` in node declaration instead of function
pointers which were hard to propagate to node groups.
* Use a new reusable `socket_type_supports_default_input_type` function in rna
to filter the list of possible input items.
Pull Request: https://projects.blender.org/blender/blender/pulls/139139
This patch removes the Relative option from the Translate node. This is
now superseded by the Relative To Pixel node, and removal was done to
facilitate the options to inputs project.
Pull Request: https://projects.blender.org/blender/blender/pulls/139147
Check if either the memory is zero or already matches the default value,
and copy. This simplifies a common pattern to a single line.
Preparing for default initializers in DNA (#134531).
Pull Request: https://projects.blender.org/blender/blender/pulls/138830
* Move colorband and theme DNA to own headers
* Move some anim, curve, modifier and space enums to new headers
* Move data transfer enums to DNA
* Duplicate imbuf proxy and GPU backend enums
For a few reasons:
* Reduce number of includes in DNA headers
* Don't define enums used in DNA outside of DNA
* Move theme settings to separate header for userdef_default_theme.c
* Prepare for using default initializers in DNA headers. (#134531)
Pull Request: https://projects.blender.org/blender/blender/pulls/138831
It's not common for object data to reference it's object type
so name the struct member to make this clear.
Also remove BKE_curve_type_get which is no longer needed.
- Make Curve::type the source of truth for the curve type,
instead of Curve::vfont, since it's possible for this to be
set to null from RNA which effectively changed it's type.
See #138730.
- Update objects to match the curve type on file read.
Without this, an object may link to a curve in another file which
can be replaced by a curve data-block of a different type.
Note that updating the object type was already being done
when reloading library data and setting object data,
just not on file load.
Ref !139137
This function to get the active attribute currently returns a custom
data layer pointer. This doesn't work when we transition to the new
`AttributeStorage` system. Returning an optional string is a simple
alternative that also aligns with the idea of changing the source of
truth from an index to a string stored on the geometry.
Pull Request: https://projects.blender.org/blender/blender/pulls/139115
This field's usage was removed with the brush assets project, previously
it was used during runtime in the `PAINT_OT_brush_select` operator.
This commit tags the DNA field as deprecated and marks the overall
`brush.cc` file with `#define DNA_DEPRECATED_ALLOW` to follow a similar
pattern as other BKE files dealing with I/O of ID types.
The field was added in 147b4b13ba and
updated in 7b7aba31f2 to prevent invalid
pointers from remaining on the brush.
Pull Request: https://projects.blender.org/blender/blender/pulls/138578
This patch implements basic support for evaluating function nodes on volume
grids. Conceptually, a function node always creates a new grid for the output,
though the output is often a modified version of the input. The topology of the
output grid is a union of all the input grids.
All input grids have to have the same transform. Otherwise one has to use
resampling to make grids compatible.
Non-grid inputs are allowed to be single values or fields. The fields are
evaluated in a voxel/tile context, so they compute a value per voxel or per
tile.
One optimization is missing that will probably be key in the future: the ability
to merge multiple function nodes and execute them at the same time. Currently
the entire function evaluation is started and finished for every function node
that outputs a grid. This will add significant overhead in some situations.
Implementing this optimization requires some more changes outside of the scope
of this patch though. It's good to have something that works first.
Note: Not all function nodes are supported yet, because we don't have grid types
for all of them yet. Most notably, there are no color/float4 grids yet.
Implementing those properly is not super straight forward and may require some
more changes, because there isn't a 1-to-1 mapping between grid types and socket
types (a float4 grid may correspond to a color or vector socket later on).
Using grids with function nodes and fields can result in false positive warnings
in the UI currently. That's a limitation of our current socket type inferencing
and can be improved once we have better socket shape inferencing.
Pull Request: https://projects.blender.org/blender/blender/pulls/125110
#138747 adds a new interface item type for separators. Unfortunately, the
current code is not forward-compatible with those. This patch improves forward
compatibility by removing all unknown tree interface item types on-load.
Pull Request: https://projects.blender.org/blender/blender/pulls/139015
Previously, whenever the zone detection algorithm could not find a result, zones
were just not drawn at all. This can be very confusing because it's not
necessarily obvious that something is wrong in this case.
Now, invalid zones and links that made them invalid have an error.
Note, we can't generally detect the "valid part" of zones when there are invalid
links, because it's ambiguous which links are valid. However, the solution here
is to remember the last valid zones, and to look at which links would invalidate
those. Since the zone-detection results in runtime-only data currently, the
error won't show when reopening the file for now.
Implementation wise, this works by keeping a potentially outdated version of the
last valid zones around, even when the zone detection failed. For that to work,
I had to change some node pointers to node identifiers in the zone structs, so
that it is safe to access them even if the nodes have been removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/139044
Previously, internal links of node are only shown when the link is muted AND
when the corresponding output is linked to something else. I can't think of any
reason for why it's important whether the output is linked or not. It seems
showing the internal link is always useful.
This patch makes it so that all internal links are always shown when a node is
muted, regardless of whether the corresponding output socket is linked or not.
Pull Request: https://projects.blender.org/blender/blender/pulls/139086
Currently, there are some constraints on the interface of node groups:
* Sockets have to be above panels.
* Outputs have to be above inputs.
The current code that ensures these constraints wasn't able to handle the
case when there are more interface items without the same constraints.
This patch is extracted from #138747.