Commit Graph

120055 Commits

Author SHA1 Message Date
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
Jacques Lucke
82d9b384e4 Fix: crash when adding geometry socket to Bake node while it's baked 2024-02-03 11:54:14 +01:00
Jacques Lucke
da99e62101 Geometry Nodes: avoid writing empty blob files when baking
This is achieved by only creating the file lazily when the first data is written.
2024-02-03 11:35:37 +01:00
Jesse Yurkovich
05f94ff8bb Cleanup: Use CLOG instead of printf for USD logging
These printfs were missed from the previous change 7bb78be256.

Same rationale as before for unifying these traces under the CLOG
infrastructure.

Pull Request: https://projects.blender.org/blender/blender/pulls/117777
2024-02-03 05:16:23 +01:00
Campbell Barton
63ce2fbc0c Extensions: default to paths in {BLENDER_RESOURCE_PATH_USER}/extensions
Replace: {BLENDER_RESOURCE_PATH_USER}/scripts/extensions
With:    {BLENDER_RESOURCE_PATH_USER}/extensions

This makes more sense as not all extensions are scripts.
2024-02-03 14:17:54 +11:00
Jesse Yurkovich
547516a3ba Cleanup: Use fmtlib instead of streams when creating USD collection name
Reduces direct dependence on large, slow to compile and run,
stream-based APIs for simple string manipulation.

Pull Request: https://projects.blender.org/blender/blender/pulls/117775
2024-02-03 04:02:06 +01:00
Jesse Yurkovich
f355b20262 Fix #106326: Add scale-bias processing for UsdUVTexture
This adds the processing required to import and export, simple, material
graphs utilizing the UsdUVTexture Scale and Bias inputs.

Since Blender does not have equivalent inputs on its Image node, a
Multiply-Add node is used instead. This matches the calculation as per
the UsdPreviewSurface spec[1]

A complicating factor here is when these two inputs are used for normal
map textures. The Scale and Bias inputs are authored in such a way to
take the [0, 1] image data and expand into the [-1, 1] tangent space
range as per the spec. However, the Blender Normal Map node expects to
do this transformation itself. The processing in this patch needs to
account for this. For the case of normal maps it will:
- Apply the Scale-Bias calculation directly as authored
- Apply an additional transform to move from [-1, 1] back into [0, 1]
- Feeds this into the Normal Map node

This processing extends to Export as well. During material graph
traversal we need to "skip" the middle adjustment transform and only
export the "real" Scale-Bias data. Traversing the graph like this can be
error prone but is probably the best we can do without having a native
Scale-Bias concept on Blender's Image node.

[1] https://openusd.org/release/spec_usdpreviewsurface.html#texture-reader

Pull Request: https://projects.blender.org/blender/blender/pulls/115224
2024-02-02 23:23:29 +01:00
Jacques Lucke
586fadd6d2 Geometry Nodes: deduplicate arrays in baked data
This adds hash-based data deduplication when baking in
geometry nodes. All arrays that are written to `.blob` files
are hashed. If an array is detected to have the same hash
as a previously written array, it is not written again. Instead
the same memory is reused.

We already have a similar optimization, but that only worked .with data that was already implicitly shared. Doing this kind
of deduplication with implicitly shared data has the benefit,
that the equality check is constant time. The hash based
approach implemented here requires linear time in the size
of the array, but works on all kinds of data. Both optimizations
work together. So the hashing is skipped if possible.

The hash-based deduplication primarily benefits cases where
the data is regenerated on each frame, so the data between .frames is not shared. One example  used to require 2.9 GB
disk space. Now it only requires 542 MB. Additionally, the
duplicate arrays will now be implicitly shared between frames
when reading the baked data later.

An extended version of this approach which also detects partial
duplicates is implemented in #117749.

Pull Request: https://projects.blender.org/blender/blender/pulls/117768
2024-02-02 22:33:00 +01:00
Sean Kim
17f075222f Fix: Adjust Grease Pencil invert icon
Fixes the icon used for indicating that a grease pencil mask layer is inverted

Pull Request: https://projects.blender.org/blender/blender/pulls/117769
2024-02-02 21:37:15 +01:00
Hans Goudey
f78d3a807a Cleanup: Store space types in vector of unique_ptr
- Use unique_ptr instead of raw pointers
- Use Vector instead of a linked list
- Use a destructor instead of a free function
- Remove the space type template-- it's much clearer to copy functional code

Pull Request: https://projects.blender.org/blender/blender/pulls/117766
2024-02-02 20:59:20 +01:00
Aras Pranckevicius
5ff0feee52 VSE: tweak look of Vectorscope to match upcoming Image vectorscope
Image vectorscope is getting some visual updates (#116974), here make the
Sequencer vectorscope match the look fairly closely:

- Use same scaling factor for both U & V, instead of trying to use all
  the texture space.
- Instead of drawing hexagonal area between color primary "pure" and
  "75% saturation safe" points, draw a circle with colored background
  and five inner rings.
- Indicate "75% saturation primaries" as wire rectangles with a text label.

Images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/117738
2024-02-02 20:59:01 +01:00
Hans Goudey
eb71d9f7bc Fix: Exception thrown when displaying spreadsheet
Problem in 660867fa00.
Comment out the offending assert for now until it can be fixed later.
2024-02-02 14:07:27 -05:00
Jacques Lucke
319b911784 Cleanup: move hash and ghash utils to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/117761
2024-02-02 19:55:06 +01:00
Philipp Oeser
9aa20a0979 Fix #54554: missing colorspace calling paint.image_paint() from python
Without doing a stroke "manually", colorspace initialization on
UnifiedPaintSettings was never done.

This lead to wrong colors in the past, since modern CS code with OIIO
this also crashes.

Colorspace was added into UnifiedPaintSettings in 6f153046e0 to avoid
doing this when sampling the brush texture images [which is good], but
the initalization was done in `paint_brush_update`.

We dont need to have this called for every step (it was skipped anyways
after one run), so it seems we can move this out of `paint_brush_update`
and put this into `paint_stroke_new`.

Thx @RevDr for initial findings.

Pull Request: https://projects.blender.org/blender/blender/pulls/117756
2024-02-02 19:43:19 +01:00
Harley Acheson
2e02c0c515 UI: TreeView Changes
TreeView changes including change of disclosure icon, decreased indent,
indented items without children, lowered line opacity.

Pull Request: https://projects.blender.org/blender/blender/pulls/117654
2024-02-02 19:40:28 +01:00
Clément Foucault
5ee72e812c Fix: DRW: Missing pointcloud dummy binding
Fixes a GPU error on opengl.
2024-02-02 19:35:22 +01:00
Eric Cosky
4842625902 Fix: Crash when expected method on Python class is None
Check for class methods dynamically changing type after initial registration.
This was found to happen in an add-on causing Blender to crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/117660
2024-02-02 19:10:25 +01:00
Clément Foucault
9e015f703c Fix: EEVEE-Next: Shadow: Fix infinite loop in shadow rendering
The render shadow loop would always tag new casters to update
the tiles that were already rendered. This patch split the
caster tagging into it's own pass and move it out of the loop.

Also adds a needed `async_flush_to_host` to make sure the
statistic buffer is up to date.
2024-02-02 19:04:55 +01:00
Hans Goudey
038ad97a7c BLI: Avoid computing size when referencing std::string
The std::string already knows its size; there's no need to find it from scratch.

Pull Request: https://projects.blender.org/blender/blender/pulls/117757
2024-02-02 17:48:52 +01:00
Hans Goudey
0f1bccd1d6 Cleanup: Reduce indentation in UI tooltip function 2024-02-02 11:13:09 -05:00
Hans Goudey
432ed47084 Cleanup: Remove unnecessary std::string braces for default construction
std::string has a default constructor, so this is unnecessary.
2024-02-02 11:13:09 -05:00
Harley Acheson
311a2ec74d Anim: Properties Dialog Titles
For ARMATURE_OT_move_to_collection, when moving to a NEW collection,
title of "Move to New Collection" and confirm button that says "Move".
For POSE_OT_paths_calculate, title of "Calculate Paths for the Selected
Bones", confirm button text of "Calculate"

Pull Request: https://projects.blender.org/blender/blender/pulls/117741
2024-02-02 17:12:35 +01:00
Jacques Lucke
39ec00f985 Cleanup: improve method name 2024-02-02 17:03:14 +01:00
Jacques Lucke
da540a73de Geometry Nodes: split sharing utility for reading and writing
This makes it more obvious that the sharing information is actually
completely independent for reading and writing currently.
2024-02-02 17:01:20 +01:00
Aras Pranckevicius
0bfffdaf82 VSE: bilinear upscaling no longer adds transparent border around the image
Part of overall "improve image filtering situation" (#116980), this PR addresses
two issues:
- Bilinear (default) image filtering makes half a source pixel wide transparent
  border around the image. This is very noticeable when scaling images/movies up
  in VSE. However, when there is no scaling up but you have slightly rotated
  image, this creates a "somewhat nice" anti-aliasing around the edge.
- The other filtering kinds (e.g. cubic) do not have this behavior. So they do
  not create unexpected transparency when scaling up (yay), however for slightly
  rotated images the edge is "jagged" (oh no).

More detail and images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/117717
2024-02-02 16:28:51 +01:00
Brecht Van Lommel
43bcd48ea6 Cleanup: make format 2024-02-02 16:11:40 +01:00
Clément Foucault
046f2ac206 Cleanup: EEVEE-Next: Shadow: Wrap loop condition in function 2024-02-02 15:38:48 +01:00
Clément Foucault
18a04965fd Fix: EEVEE-Next: Artifacts with volume + motion blur
The root cause is still unknown. But replacing the
use of the depth texture by the hiz buffer fixes the
issue.

The issue was apparent on Linux + Mesa + AMD.
2024-02-02 15:14:41 +01:00
Sybren A. Stüvel
660867fa00 Anim: bone collections, store expanded/collapsed state in DNA
Store the 'expanded/collapsed' state of the bone collection tree view in
the DNA data of the bone collections themselves. This way the tree state
is restored when loading the file.

This commit also adds some code to the abstract tree view classes, for
supporting synchronisation of the extended/collapsed state between it
and external data. It follows the same approach as the handling of the
active element.

RNA wrappers have been added to make it possible for Python code to
expand/collapse parts of the tree.

Library overrides are supported for this property, so the
expanded/collapsed state of linked armatures can be locally saved. If
there is no override, the `is_expanded` property is still editable;
changes will not be saved to file in that case, though.

Pull Request: https://projects.blender.org/blender/blender/pulls/116940
2024-02-02 12:28:22 +01:00
Sergey Sharybin
e2b9ebd23c Cleanup: Remove unused capture
Pull Request: https://projects.blender.org/blender/blender/pulls/117750
2024-02-02 12:18:32 +01:00
Omar Emara
ce2a945dff Cleanup: Correctly name bokeh blur shaders
The bokeh blur shaders are incorrectly named as standard blur shaders,
while this isn't the case. Rename them to include the bokeh keyword.
2024-02-02 13:15:59 +02:00
Sybren A. Stüvel
f208a3719a Cleanup: document CTX_wm_operator_poll_msg_set
The function name "operator poll message set" is rather troublesome, as:

- the message is only used when the operator is disabled, and
- the message is shown if the operator is disabled by any means, and not
  just limited to the `poll()` function returning `false`.

A better name would be `CTX_wm_operator_disabled_msg_set`, but refactoring
that is for another time. Now at least the behaviour is documented.

No functional changes.
2024-02-02 12:04:37 +01:00