Commit Graph

106486 Commits

Author SHA1 Message Date
Campbell Barton
f1a440abb6 Fix crash browsing file/directory properties within popups
Caused by [0] which closed all popups when adding a file selector event.

This was done so pressing "Open..." from the splash closes the splash
however it caused BUTTONS_OT_file_browse & BUTTONS_OT_directory_browse
to crash when changing the path of an RNA property within a popup.

Move the logic to close popups into the splash screen itself.
Since some actions such as opening a URL's should keep the splash open,
resolve by closing the splash when a file selector is opened.

[0]: b49abbec5f
2024-02-06 14:34:41 +11:00
Campbell Barton
c527056f0c Fix #117783: Allow Multiple Negatives in Numerical Inputs with Units
Support multiple unary operators before a number where only a single
negative value worked in the past.

Ref !117827.
2024-02-06 09:28:30 +11:00
Hans Goudey
72d324bd81 Fix #117865: "Create Face Sets" operator crashes for multires
The same implementation is used for meshes and multires grids,
since face sets are always stored per base mesh fast. We just need
to account for that in one place to avoid the crash.
2024-02-05 15:29:42 -05:00
Jesse Yurkovich
4797773604 Fix #117816: Import USD DistantLight as Blender Sun light
The UsdLuxDistantLight schema was being checked under the wrong
conditional.

Pull Request: https://projects.blender.org/blender/blender/pulls/117820
2024-02-05 21:03:18 +01:00
Hans Goudey
df8c85d3f9 Cleanup: UI Remove more unnecessary a1 and a2 parameters
Similar to 5155feeeb8. These had values without any meeting,
almost completely just 0 or -1 (which meant "find good values if possible"
anyway).
2024-02-05 14:38:11 -05:00
Alexander Gavrilov
3cf1c795ff Fix assertion when creating an override of a enum custom property.
Introduced in 92cf9dd2f2
2024-02-05 21:11:38 +02:00
Aras Pranckevicius
e1f8775807 VSE: default to new "Auto" image filter for strips
Part of "improve filtering situation" (#116980), now strip scaling filter defaults to "Auto" which has logic like:

- No scale, no rotation, integer positions: Nearest (fastest)
- Scaling up by more than 2x: Cubic Mitchell, so you get nicer blending between pixels than with bilinear,
- Scaling down by more than 2x: Box, so that many pixels are averaged properly without too much aliasing,
- Otherwise: Bilinear

Existing strips that use Bilinear (which is default) get switched to Auto when loading older files.

All of this has an advantage that unless you have some special needs for your look, you can leave it at default and it will look decently good at either large up-scaling or large down-scaling, but not waste performance if you don't use any scaling at all. Previously none of the choices were good in "all cases": box (née subsampled3x3) only looks good when scaling down, cubic only looks good when scaling up, default bilinear leaves performance on the table when you don't use any scale/rotation, etc.

On something like Gold movie current edit, most of the strips effectively use Nearest now, except some that are translated into non-integer pixel positions; those stay effectively Bilinear.

Pull Request: https://projects.blender.org/blender/blender/pulls/117853
2024-02-05 20:09:29 +01:00
Hans Goudey
e6188d0976 Camera: Make alpha a factor property
Removes the need to manually specify the slider state when defining the UI.
2024-02-05 12:26:00 -05:00
Hans Goudey
cfc68a1247 Fix #117813: Precision ignored for some slider buttons 2024-02-05 12:26:00 -05:00
Hans Goudey
945dc7c863 Cleanup: Use references and const in interface_layout.cc 2024-02-05 12:26:00 -05:00
Julian Eisel
bdfb1f6a04 Assets: Use inheritance for asset library class
Initial changes to make the asset library class polymorphic, plus using
that to cleanup some basic loading logic. I'm confident that this will
help us improve the asset library management code quite a bit, currently
it's quite confusing. Plus it will be extendable this way in future, so
new kinds of asset libraries (e.g. Blender project asset libraries or
arbitrary online asset libraries) can be added much easier.
2024-02-05 18:25:18 +01:00
Clément Foucault
b351638008 Fix: EEVEE-Next: Broken Normal and AO pass for emissive materials
The deferred combine pass was not rendered for these pixels
since they would not output any BSDF.

The check in pipeline sync have to be removed in order to
support emission only passes.
2024-02-05 18:15:09 +01:00
Hans Goudey
f63a776a40 Cleanup: Use this keyword to access class methods in UI views 2024-02-05 11:42:16 -05:00
Jacques Lucke
db4fd7060f BLI: support content based slicing in IndexMask
This allows slicing an `IndexMask` so that it only contains certain indices.

Pull Request: https://projects.blender.org/blender/blender/pulls/117857
2024-02-05 17:19:27 +01:00
Damien Picard
fa77e9142d UI: fix and improve a few messages
- "can not" -> "cannot" in many places (ambiguous, also see
  Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
  everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.

Some issues reported by Joan Pujolar and Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/117856
2024-02-05 17:08:17 +01:00
Sergey Sharybin
4f0ec384ce Fix incorrect update tag handling in inactive depsgraphs
The dependency graph builder takes the original data-block's recalc
flags to tag IDs after the dependency graph has been built, while
the evaluation of the graph only re-sets tho recalc flag to 0 only
for active dependency graph. This could have caused an inconsistency
of the handled tags: for example, if a headless render modifies some
object's properties and then renders the scene multiple times without
re-creating dependency graph (using Eevee or having Persistent Data,
and rendering multiple view layers, for example).

This change makes it so the recalc flags from the original ID are
only considered by active dependency graph, of when an ID is first
evaluated within a non-active dependency graph. This is a bit of a
conservative change to avoid possible breakage. In theory it should
be possible to never consider original recalc flags for render, and,
eventually, also ignore it for the active graphs. This needs to be
with more care and, so follow safer approach for now.

In practice this change fixes an issue with missing particle hair
when rendering second view layer of rlayer_flags_01.blend with Eevee.

Pull Request: https://projects.blender.org/blender/blender/pulls/117854
2024-02-05 16:59:14 +01:00
Julian Eisel
212d736842 Fix assert when setting default collapsed state of items
Would assert that the reconstruction phase is not completed. In this
case collapsing is modified as part of the construction, so the assert
is wrong. Access the collapsed state directly without using the getter
that does the assert check.
2024-02-05 16:51:32 +01:00
Hans Goudey
cfb4e5a25d Cleanup: Store asset shelf types in vector of unique_ptr
This avoids the need for manual memory management/raw pointers,
improves const correctness, improves type safety, simplifies iteration,
and simplifies the process of registering a new asset shelf type.

Pull Request: https://projects.blender.org/blender/blender/pulls/117770
2024-02-05 16:23:57 +01:00
Jacques Lucke
bb915ae9bd BLI: improve finding elements in IndexMask
Previously, it was only possible to `find` a specific index in an `IndexMask`.
Now it's also possible to find the closest larger/smaller index if an exact
match doesn't exist. This could be used for slicing the mask so that it only
contains certain indices.

Pull Request: https://projects.blender.org/blender/blender/pulls/117852
2024-02-05 16:07:53 +01:00
Nika Kutsniashvili
ff3f396103 UI: Add missing data-block icons in Outliner
Add data-block icons to Outliner's "Blend File" mode for:

* Color Palette
* Particles System
*  Vector Font

Pull Request: https://projects.blender.org/blender/blender/pulls/117850
2024-02-05 15:26:11 +01:00
Lukas Tönne
76e877eaf9 Curves: fix incorrect brackets in assert.
The conditional should be a single expression.
2024-02-05 15:20:34 +01:00
Falk David
b37ee403b2 GPv3: Move to layer: Add popup for entering new layer name
In the `move_to_layer` operator, add a popup when moving to a new layer
to enter the new layers name.

This is consistent with GPv2.
2024-02-05 14:52:54 +01:00
Lukas Tönne
d7127dea02 Fix crashes when connecting cyclic grease pencil curves
Curves draw buffer updates and operations like resampling access the
evaluated lengths cache of curves. However, when the curve has only one
point the evaluated lengths will be empty. This is not a problem for
open curves, because they skip calculation of the last point, but cyclic
curves expect to have as many length entries as there are points.

This crashes in certain cases:
- Grease Pencil v3 edit mode "Toggle Cyclic" operator
- Geometry nodes resampling of cyclic, single-vertex curves

Checking for the single-point case when building draw buffers handles
these corner cases.

Fixes #117833
Fixes #117838

Pull Request: https://projects.blender.org/blender/blender/pulls/117842
2024-02-05 14:47:05 +01:00
Michael Kowalski
ecbf3385c5 USD: basic support for on_import USD hooks
Added support for defining an on_import() function in
bpy.types.USDHook subclasses.  If on_import() is defined
on a given USD hook, it will be invoked in import_endjob().

The implementation closely follows the existing design of
export hooks.  USDHook.on_import() takes as an argument
an instance of an internally defined USDSceneImportContext
class which provides an accessor to the USD stage.

Also updated the USDHook documentation with an example
on_import() callback implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/117822
2024-02-05 14:26:02 +01:00
Falk David
42fa5fa27f Cleanup: GPv3: Use scoped defer to free allocated string 2024-02-05 13:52:20 +01:00
Lukas Tönne
83ac606088 Curves edit mode: Finish "cyclic" attribute after duplicating. 2024-02-05 13:48:33 +01:00
Brecht Van Lommel
ab75440847 Fix: Missing owner ID in color ramp and sequencer metadata pointers
Found while refactoring for #117640.
2024-02-05 13:43:37 +01:00
Brecht Van Lommel
c14e9fc95b Cleanup: Compiler warnings 2024-02-05 12:59:30 +01:00
Jacques Lucke
1ce2ae3c1a LibOverride: don't compare PoseBone.is_in_ik_chain property
The is a derived property, so overriding it doesn't make sense.

I found this to cause a severe bottleneck when saving a file that creates
overrides for a large number of bones. In my test file this reduces the
save-time from 1200ms to 202ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/117802
2024-02-05 12:40:38 +01:00
Pratik Borhade
0228994d6d GPv3: Isolate Layers
This ports the legacy operator to grease pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117784
2024-02-05 12:30:24 +01:00
Pablo Delgado Krämer
e5b7768830 MaterialX: Add remaining float/vector math operations
Ref #112864

Pull Request: https://projects.blender.org/blender/blender/pulls/117764
2024-02-05 12:28:22 +01:00
Brecht Van Lommel
8fcc7aab46 Fix: Build error when not using unity build 2024-02-05 12:14:30 +01:00
Matias Mendiola
dcc5725741 GPv3: Move to Layer
This PR adds the Move to Layer operator from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/117244
2024-02-05 12:02:51 +01:00
Pablo Delgado Krämer
6f0e27abad MaterialX: Enable blackbody and randomfloat nodes
These are supported now with MaterialX 1.38.8 in Blender 4.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/117762
2024-02-05 11:42:22 +01:00
Pablo Delgado Krämer
a669fd870e Fix: MaterialX export of less than math node slightly off
Pull Request: https://projects.blender.org/blender/blender/pulls/117763
2024-02-05 11:39:51 +01:00
Clément Foucault
77ef7d102b Fix: EEVEE-Next: Artifacts caused by volumes and Motion blur
There seems to be a driver bug on Linux + Mesa + AMD

The bug only appears in renderdoc if looking at the film pass
but not in the motion blur pass nor the volume pass.

Adding a clear event seems to fix the issue.
2024-02-05 11:18:22 +01:00
Aras Pranckevicius
4cf2d95bb5 Cleanup: more C++ constructs in VSE render.hh and friends
- enum class StripEarlyOut instead of raw integer defines
- SeqRenderState default initializer instead of seq_render_state_init
- Vector<Sequence*> instead of manually sized arrays of pointers
- some const to several function arguments

Pull Request: https://projects.blender.org/blender/blender/pulls/117829
2024-02-05 11:10:43 +01:00
Omar Emara
3d7e84f57d Compositor: Unify Bilateral Blur across CPU and GPU
This patch unifies the implementation of the Bilateral Blur node across
CPU and GPU. The difference is due to two things. First, the CPU code
had a bug where the upper limit of the blur window was not included in
the accumulation. Second, CPU ignored pixels outside of the image while
GPU clamped them to the nearest boundary pixel. The latter difference
was aligned with GPU until we eventually add an option to control
boundary handing.

A few utilities were added to the node operation and memory buffer
classes to do clamped pixel reading.

Pull Request: https://projects.blender.org/blender/blender/pulls/117751
2024-02-05 08:48:20 +01:00
Campbell Barton
d73628a3cd UI: use consistent naming for an extensions "Remote" repository 2024-02-05 11:24:54 +11:00
Campbell Barton
80906eb02e Cleanup: various non-functional C++ changes 2024-02-04 23:42:18 +11:00
Jacques Lucke
47cf827049 Cleanup: add forward declaration header for IndexMask and VArray
This avoids duplicating the declaration in multiple places.
2024-02-04 11:55:45 +01:00
Pratik Borhade
3566a9e8de UI: Tooltip when bone collections are linked
Linked bone collections are disabled in b79419914a
Include 'Disabled' tooltip for `move and assign to collection`
operation when bcol are linked.
In poll functions all other cases are already handled and also not
possible to get the index of hovered collection so just include
`poll_msg_set` in the end.

Pull Request: https://projects.blender.org/blender/blender/pulls/117715
2024-02-04 07:01:05 +01:00
Campbell Barton
faeab05395 UI: edit-source operator prints the location to the output again
This can be useful to open the location in other editors.
2024-02-04 15:16:48 +11:00
Campbell Barton
77b49e1373 Fix text editor exceptions showing twice in the console 2024-02-04 15:16:47 +11:00
Campbell Barton
c2444131f4 Cleanup: quiet GCC undef warning 2024-02-04 15:16:46 +11:00
Aras Pranckevicius
4b108959ba Cleanup: remove accidental include leftovers 2024-02-03 23:29:13 +02:00
Jacques Lucke
442429a97c BLI: support formatting StringRef with the fmt library
People were manually converting it to `std::string_view` in many places already.
It's easy enough to allow using `StringRef` directly by providing a `format_as` function.

Also see https://fmt.dev/latest/api.html#udt.

Pull Request: https://projects.blender.org/blender/blender/pulls/117788
2024-02-03 19:14:51 +01:00
Aras Pranckevicius
f6276ec163 Fix: 2D tri/quad vs point intersection tests edge cases
isect_point_tri_v2 and isect_point_quad_v2 are handling tris/quads
in either clockwise or counter-clockwise vertex orderings. However,
for clockwise order it was considering points that lie on the edges
or vertices as "inside", whereas for counter-clockwise it was treating
them as "outside".

Visibly affected place is VSE: it has an optimization that checks
whether a fully opaque strip image fully covers the rendered area.
When the strip was scaled up to *exactly* cover the rendered area,
the check was failing since isect_point_quad_v2 was saying that a
point is outside the rect.

As far as I can tell, the functions have been "slightly wrong" in
this way for at least 15 years; harder to see through earlier
history in git.

Added a bunch of unit tests to cover this. Without the fix, "edge"
and "corner" cases against "cw" tri/quad were failing.

Performance (checked on clang15 on M1 Max):
- isect_point_tri_v2 is pretty much the same performance (assembly
  several instructions shorter),
- isect_point_quad_v2 is about three times *faster* (assembly 2x
  shorter), seemingly the compiler is able to use some SIMD now.

Pull Request: https://projects.blender.org/blender/blender/pulls/117786
2024-02-03 19:03:21 +01:00
Ray Molenkamp
fc409e4388 Cleanup: CMake: Modernize extern_fmtlib dependencies
Pretty straightforward

- Remove any fmtlib paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/117787
2024-02-03 18:55:09 +01:00
Jacques Lucke
444e148976 Geometry Nodes: support baking volume geometry
This adds support for baking the volume component of a geometry. Previously,
volumes were just removed in the simulation and bake node.

On disk, each volume geometry is written to a separate `.vdb` file that is stored in
the bakes `blobs` directory and referenced from the corresponding meta `.json` file.

Technically, it would also be easy to write the volume data to the same `.blob`
files that we also write e.g. mesh attributes to. However, since `.vdb` is a well
known file format, it seems reasonable to just store it as a separate file. The
serialization code doesn't really care whether it's a separate file or embedded into
a bigger file, so this decision could be made at a higher level.

Just like with other geometry types, materials are preserved. Just note that when
using the written stand-alone .vdb files, materials are not preserved.

Currently, volume grids are not deduplicated on disk. This could be added in the
future if necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/117781
2024-02-03 18:13:34 +01:00