Commit Graph

106628 Commits

Author SHA1 Message Date
Falk David
1fb113848e Fix: GPv3: Draw tool overwrites hardness value
The draw tool didn't skip over the hardness attribute when
initializing the rest of all the attributes with default values.
2024-02-09 11:30:26 +01:00
Sergey Sharybin
aa051f788d Cleanup: New line at the end of file
Pull Request: https://projects.blender.org/blender/blender/pulls/118032
2024-02-09 11:08:16 +01:00
Sergey Sharybin
a18324ff10 Fix compilation error when WITH_COMPOSITOR_CPU is OFF
The render only uses `ProfilerData` for which it is enough to only
have header. No linking is needed to the bf_compositor for things
to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118030
2024-02-09 10:55:23 +01:00
Pratik Borhade
69e0e9f19f GPv3: Assert drawing before first frame
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
2024-02-09 10:48:23 +01:00
Omar Emara
e20b2d2fb9 Merge branch 'blender-v4.1-release' 2024-02-09 11:37:43 +02:00
Omar Emara
bf94b454c4 Fix: Crash in Inpaint node for large images
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.
2024-02-09 11:35:24 +02:00
Bastien Montagne
bdbaff9b31 Merge branch 'blender-v4.1-release' 2024-02-09 10:26:01 +01:00
Andrej730
8144252aa9 Fix return types in docs for matrix.zero, quat's .negate and .identity
Noticed in mathutils docs (and in python type hinter for mathutils) some methods doesn't return anything though docs stated that they return themselves and fixed the docs.
Related to 9c81833430

Pull Request: https://projects.blender.org/blender/blender/pulls/118011
2024-02-09 10:24:44 +01:00
Sergey Sharybin
467a132166 Compositor: Implement per-node execution time report
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
2024-02-09 10:19:24 +01:00
Christoph Lendenfeld
afa4391eeb Fix: Issue with Cycle aware keying when inserting second key
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
2024-02-09 10:13:28 +01:00
Campbell Barton
67e3704a45 Merge branch 'blender-v4.1-release' 2024-02-09 18:20:21 +11:00
Campbell Barton
5affe322cc Correct version bump from 41b63ebda2 2024-02-09 18:15:05 +11:00
Campbell Barton
41b63ebda2 Versioning: add missing version update for renamed key-map
Account for the renamed key-map when loading older saved key-maps &
stored user preferences. [0] missed these changes.

[0]: 661e7e451a
2024-02-09 18:11:12 +11:00
Miguel Pozo
ca259f751d Cleanup: Remove unused parameter 2024-02-08 21:13:14 +01:00
Hans Goudey
b2d9f08d5c Merge branch 'blender-v4.1-release' 2024-02-08 14:56:18 -05:00
Hans Goudey
2e6223d90f Geometry Nodes: Move instance reference indices to a builtin attribute
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
2024-02-08 20:55:34 +01:00
Hans Goudey
7f5f37ea65 Cleanup: Simplify asset metadata copying
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.
2024-02-08 14:51:01 -05:00
Miguel Pozo
7e8fd2cc2c Fix: GPU: Fix closure evaluation order
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:
![image](/attachments/0c56613f-3515-40a2-bf0e-282a8a99d64e)
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
2024-02-08 20:43:50 +01:00
Miguel Pozo
a1ceeef2f9 Merge branch 'blender-v4.1-release' 2024-02-08 19:58:07 +01:00
Miguel Pozo
bf0ac755e2 Fix: EEVEE: Volumes don't render
OrcoTexCoFactors were wrong.
Regression from
fa3bd17ae8
2024-02-08 19:57:18 +01:00
Clément Foucault
63a4c03b09 Refactor: EEVEE-Next: Light-probe management and structure
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
2024-02-08 19:48:28 +01:00
Hans Goudey
30f8dfc474 Cleanup: Fix string format warning after recent commit 2024-02-08 12:21:33 -05:00
Falk David
fb6324bdd0 Fix: GPv3: Draw tool not writing hardness attribute 2024-02-08 17:43:19 +01:00
Miguel Pozo
01fbca876d Revert "Disable EEVEE-Next"
This reverts commit a8f29e8e36.
2024-02-08 17:38:18 +01:00
Miguel Pozo
cf27e0f3e1 Merge branch 'blender-v4.1-release' 2024-02-08 17:38:09 +01:00
Miguel Pozo
a8f29e8e36 Disable EEVEE-Next 2024-02-08 17:37:53 +01:00
Pablo Vazquez
25b71bc9c1 Merge branch 'blender-v4.1-release' 2024-02-08 17:18:06 +01:00
Sybren A. Stüvel
756ae1eb3e Cleanup: run make format
No functional changes.
2024-02-08 17:16:56 +01:00
Jacques Lucke
2e4a3bae67 Geometry Nodes: use Still mode by default in Bake node
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
2024-02-08 17:04:38 +01:00
Sergey Sharybin
4196cbd175 Merge branch 'blender-v4.1-release' 2024-02-08 17:03:19 +01:00
Sean Kim
fdf37275b6 Fix: Prevent erroneous values for detail_size and detail_percent
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
2024-02-08 17:02:55 +01:00
Hans Goudey
a39e8a4ab9 Cleanup: Use StringRef instead of C strings in CustomData API
This simplifies some code. It may improve performance slightly too,
because of faster string comparisons with a known length.

Pull Request: https://projects.blender.org/blender/blender/pulls/117996
2024-02-08 16:56:42 +01:00
Miguel Pozo
74b8f99b43 Render: Merge EEVEE and Cycles motion blur settings
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
2024-02-08 16:49:18 +01:00
Lukas Tönne
1f35dc9d48 Grease Pencil: Fix zero default hardness created by the opacity modifier
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
2024-02-08 16:45:38 +01:00
Jacques Lucke
7b44c2ffb3 Merge branch 'blender-v4.1-release' 2024-02-08 16:20:58 +01:00
Jacques Lucke
faaa8d4c79 Fix: crash when separating grease pencil in geometry nodes 2024-02-08 16:03:05 +01:00
Lukas Tönne
2c8de207b7 GPv3: Dash modifier
Reimplements the "Dash" (aka Dash-Dot) modifier of GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/117758
2024-02-08 15:35:20 +01:00
Brecht Van Lommel
f312c07a1d Merge branch 'blender-v4.1-release' into main 2024-02-08 15:09:03 +01:00
Brecht Van Lommel
2b0caf00a8 Refactor: RNA property undo push only when there is an owner ID
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
2024-02-08 15:08:09 +01:00
Sean Kim
4df5bcfea9 Sculpt: Disable sculpt brushes on invisible objects
* 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
2024-02-08 15:06:17 +01:00
Philipp Oeser
137802e6bd Merge branch 'blender-v4.1-release' 2024-02-08 14:49:57 +01:00
Philipp Oeser
cdf5265f69 Fix #117971: wrong indices in sculpt undo/restore colors
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
2024-02-08 14:49:25 +01:00
Philipp Oeser
98bf7a8d7a Fix #116188: hair puff works incorrect with symmetry
Originally caused by 1b19f62917 .

Solution is the same as ff7b8f3412
Only this time it does the same thing `Sphere` falloff (whereas
ff7b8f3412 fixed it for `Projected` falloff)

Pull Request: https://projects.blender.org/blender/blender/pulls/117987
2024-02-08 14:48:45 +01:00
Julian Eisel
a46d968a8c Merge branch 'blender-v4.1-release' 2024-02-08 14:38:46 +01:00
Sergey Sharybin
8303bb167b Add runtime field on the Scene
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
2024-02-08 14:30:14 +01:00
Julian Eisel
83dbbf9aec Fix #117572: Top vertical scrollbar tool not working properly
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
2024-02-08 14:25:47 +01:00
Lukas Tönne
da2d3be202 GPv3: Lattice modifier
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
2024-02-08 14:09:11 +01:00
Campbell Barton
9c0bb3d8f9 Merge branch 'blender-v4.1-release' 2024-02-08 23:47:36 +11:00
Campbell Barton
252ae7029d Fix building FreeStyle with Python 3.12
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.
2024-02-08 23:45:21 +11:00
Lukas Tönne
dfec8171cc Modifiers: Increase the length of name strings in ModifierTypeInfo
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
2024-02-08 12:34:27 +01:00