Assert at `BLI_assert(active_layer.has_drawing_at(current_frame))`
New keyframe is not added when brush draws on a frame which is before
the first frame that actually contains the drawing.
Pull Request: https://projects.blender.org/blender/blender/pulls/117983
The Inpaint node crashes for large images. That's because the output
buffer was only allocated for a single chunk. So allocate the entire
output buffer in the tile initialization step.
Visually it is the same as the execution time implemented for the
geometry nodes, and it is to be enabled in the overlay popover.
The implementation is separate from the geometry nodes, as it is
not easy or practical to re-use the geometry nodes implementation.
The execution time is stored in a run-time hash, indexed by a node
instance key. This is similar to the storage of the mode preview
images, but is stored on the scene runtime data and not on the node
tree. Indexing the storage by key allows to easily copy execution
statistics from localized tree to its original version.
The time is only implemented for full-frame compositor, as for the
tiled compositor it could be tricky to calculate reliable time for
pixel processing nodes which process one pixel at a time.
Pull Request: https://projects.blender.org/blender/blender/pulls/117885
Caused by #113504
While basic cycle aware keying works, there is a special case
when inserting the first key. In that case, after the key has been inserted,
it is duplicated and moved around so the FCurve range from
first to last key is exactly the range of the action.
It also auto-creates the Cycle modifier on the FCurve .
Fix the issue by calling the function that does the key duplication
and cover with unit tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/116943
This means the array can be shared between geometries when unchanged,
reducing memory usage and increasing performance. It also means that
handling the data can be done more generically using the attribute
system. In the future the transforms can become attributes too.
Two other changes are related here:
- The "almost unique ids" are cached with a shared cache so they
are shared too.
- The reference indices are baked as an attribute now, making the process
more generic and potentially easier to optimize in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/117951
Use `BLI_strdupn` instead of repeating the same logic a bunch of times.
Use StringRef where StringRefNull isn't necessary, and use StringRefNull
instead of a std::string reference in one case.
EEVEE-Next can only store data for a single (global) closure at a time,
which, when combined with ShaderToRGB nodes, requires extra care in the
order that closures are evaluated.
For example:

Here, after `ntree_shader_shader_to_rgba_branch` there will be 2 Diffuse
nodes (the original and a copy for the ShaderToRGB branch).
However, the generated code order will be something like this:
```
Diffuse (original)
Diffuse (copy)
ShaderToRGB // This resets closures
Mix
```
So while the original node is technically "evaluated", the closure data
is reset after ShaderToRGB.
This patch updates the code generation to ensure closure evaluation is
ordered taking ShaderToRGB branches into account, so the generated code
looks like this:
```
Diffuse (copy)
ShaderToRGB // This resets closures
Diffuse (original)
Mix
```
This also fixes ShaderToRGB support for AOVs, removes unused code, and
fixes several bugs that I've found along the way that were harmless for
EEVEE but broke EEVEE Next.
Pull Request: https://projects.blender.org/blender/blender/pulls/117767
This cleanup and centralize lightprobe object management
into the LightProbeModule as it was always intended.
The other modules are kept for data / rendering management.
A few logic were simplified along the way.
Rename a lot of defines and classes for more consistency.
No functional change expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/117941
Currently, the geometry nodes modifier always creates a time dependency
if there is a bake animation node, even if there is no bake. Changing this is
not entirely trivial, because it is only known during evaluation if there is baked
data. Making `Still` the default works around that issue in many cases where
the Bake node is in a node group asset that does not depend on time.
Furthermore, it's nice to have the "cheaper" version of the node by default,
which is baking a single frame, instead of baking everything.
Pull Request: https://projects.blender.org/blender/blender/pulls/117999
This PR applies the UI range for the Dyntopo `detail_size` and `detail_percent` to the actual property range. Previously, 0 and negative values were allowed if manually entered into the field, the former leading to blender hanging upon the next stroke, and the latter leading to potentially odd or unwanted behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/117976
Merge duplicated motion blur settings between Cycles and EEVEE,
and move them to `RenderData`/`scene.render`:
* `scene.cycles.motion_blur_position` -> `scene.render.motion_blur_position`
* `scene.eevee.use_motion_blur` -> `scene.render.user_motion_blur`
* `scene.eevee.motion_blur_position` -> `scene.render.motion_blur_position`
* `scene.eevee.motion_blur_shutter` -> `scene.render.motion_blur_shutter`
On the C/C++ side, this also renames `RenderData::blurfac` to
`RenderData::motion_blur_shutter`.
Pull Request: https://projects.blender.org/blender/blender/pulls/117913
Opacity modifier can also change hardness. It was creating the curve
"hardness" attribute but using the default zero value. Hardness should
be 1.0 by default.
Pull Request: https://projects.blender.org/blender/blender/pulls/118000
RNA pointers should always have valid owner IDs. And most structs
using STRUCT_UNDO do not need it because the owner is a UI datablock
which already determines if undo is needed.
With this change, it is possible to have structs used both in UI and scene
datablocks and have undo work depending on the owner. This is needed for
collections storing operator properties for export (#116646).
Pull Request: https://projects.blender.org/blender/blender/pulls/117640
* Brushes no longer affect invisible objects or objects that are entirely
contained by hidden collections
* The brush cursor no longer highlights vertices of invisible objects and
the cursor circle remains view-aligned.
Resolves part of #112371
Pull Request: https://projects.blender.org/blender/blender/pulls/117746
Caused by 3e81f66998
Looks like we need to store the unique verts indices here, this goes in
line to what similar code in this area does (but havent checked the data
layout of an Undo node here in depth).
Pull Request: https://projects.blender.org/blender/blender/pulls/117986
For C it is an opaque pointer, for the C++ it is a class which is
defined in BKE_scene_runtime.hh.
The runtime field ensured to exist after file load, and after new
scene is added. The field is not copied when scene is copied, and
instead the copy of the scene has its own runtime field. If any of
the fields in the runtime are desired to be copied it needs to be
done explicitly.
Currently unused, but is planned to be utilized for the upcoming
compositor timing functionality,
Pull Request: https://projects.blender.org/blender/blender/pulls/117978
Remove ugly/fragile special case in `view2d_masks()` that would clamp
the scrollbar-masks by the scrubbing UI. It's now possible to pass
custom scrollbar-masks to `View2D` via `UI_view2d_scrollers_draw()`. So
use this instead, making region code control its own masks, rather than
relying on special case handling in generic `View2D` code.
Also update comment in `scroller_activate_init()` to make the implicit
relationship explicit.
Alternative to, and based on the investigation in !117685.
Pull Request: https://projects.blender.org/blender/blender/pulls/117984
Ported lattice modifier from GPv2.
The `LatticeDeformData` is no longer stored in the modifier data, but calculated on-the-fly like in the mesh deform modifier. This is quite trivial data and only stores deformed positions of the lattice, so not really worth the effort and complexity of caching it.
Pull Request: https://projects.blender.org/blender/blender/pulls/117955
Add helper functions for creating PyLong sup-types.
In Python 3.12 it's no longer practical to manipulate PyLongObject
values directly. Resolve by creating PyLongObject and copying the
values to a newly created sub-type.
These name fields run out of space for some of the new Grease Pencil
modifiers, like "GreasePencilEnvelopeModifierData". Only one of these
strings is stored for each modifier type, so this should have almost no
impact on size.
Pull Request: https://projects.blender.org/blender/blender/pulls/117980