Commit Graph

107010 Commits

Author SHA1 Message Date
Sybren A. Stüvel
c120ead9df BLI: Clarify and test StringRefNull comparisons
Add some comments that clarify that `StringRefNull` can be compared with
other `StringRefNull` and with `StringRef` instances.

Add unit tests that cover these cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/118515
2024-02-20 17:52:14 +01:00
Sybren A. Stüvel
5cd57c9eaa Merge remote-tracking branch 'origin/blender-v4.1-release' 2024-02-20 17:51:06 +01:00
Christoph Lendenfeld
a0fb1486be Fix #97973: Red underline in action editor is stale
When switching to an object with invalid channels,
the red underline would only appear on the second redraw.
Same when switching the other way around, then they would
stay until the next redraw.

The issue is that the logic to check if that line should be drawn
is checking the flag of the `bAnimListElem` which gets it from
the FCurve. But the FCurve is only checked later down the line
when getting the name.

Fix it by checking the flag on the FCurve directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/118522
2024-02-20 17:33:39 +01:00
Jacques Lucke
0494605e7e Geometry Nodes: support group ids in Geometry Proximity node
This is the same 75e9056cac but for the Geometry Proximity node.

Pull Request: https://projects.blender.org/blender/blender/pulls/118467
2024-02-20 17:15:23 +01:00
Julian Eisel
debdde985f Fix #108703: assert when loading "All" asset library
Error caused by attempting to register multiple catalogs with the same
catalog ID. This would happen when multiple asset libraries would use
the same catalog definition file, and the "All" library would attempt to
merge them all into one library.

Ignore duplicate catalogs, like we already do when reading individual
asset catalog definition files. Log an error instead, or a info log if
the catalog path matches as well (in which case the conflict can be
ignored as it won't be user visible).
2024-02-20 16:48:42 +01:00
Germano Cavalcante
d7c728c2fb Cleanup: deduplicate code in 'knife_find_line_hits' 2024-02-20 11:25:54 -03:00
Julian Eisel
99673edd85 Cleanup: Add method to get UUID as std::string
Avoids having to use the C-style `BLI_uuid_format()` function with
manual buffer management, and makes it easy to get a `std::string` from
a UUID.
2024-02-20 15:20:11 +01:00
Aras Pranckevicius
447bb9a4b9 Cleanup: Move BKE_writeavi.h to C++ and rename to BKE_writemovie.hh
Pull Request: https://projects.blender.org/blender/blender/pulls/118506
2024-02-20 14:49:23 +01:00
Jacques Lucke
148cad93e3 BLI: simplify creating index masks from group ids
Pull Request: https://projects.blender.org/blender/blender/pulls/118498
2024-02-20 13:18:16 +01:00
Aras Pranckevicius
f09c7dc4ba Video: Remove non-ffmpeg AVI support
Blender had a very limited (only uncompressed or MJPEG frames) .avi file
support, for both reading and writing. This is something that ffmpeg can
fully do.

This removes all of that. 3500 lines of code gone, primary motivations being:
- ffmpeg can read and write .avi files just fine, including ones with
  uncompressed or MJPEG frames.
- Blender's ffmpeg integration could also be taught to produce uncompressed or
  MJPEG .avi files, but TBH I don't see a particular reason to do that. Modern
  formats like H264 are better in every way, and already support "lossless"
  option if needed.
- The "Lite" blender build configuration was excluding both ffmpeg and avi
  anyway, so that config is something that can't read nor write any movies.

User visible changes:

- In scene image output type, under Video section now there's only Ffmpeg Video
  (AVI Raw and AVI JPEG are gone)
- Whenever loading an existing file, if output was one of AVI Raw / AVI JPEG,
  it is set to Ffmpeg Video.

Pull Request: https://projects.blender.org/blender/blender/pulls/118409
2024-02-20 13:15:50 +01:00
Pratik Borhade
6d88285cd2 Merge branch 'blender-v4.1-release' 2024-02-20 17:30:23 +05:30
bonj
f5151bbbeb Fix #118116: Only hide solid mesh if overlays are enabled
When the retopology overlay is enabled, the edit mesh is not drawn
in solid mode. When you disabled overlays however, it would not be
drawn in any mode, which understandably confused users.
Now it checks whether overlays are enabled before it hides the solid mesh.

Pull Request: https://projects.blender.org/blender/blender/pulls/118422
2024-02-20 12:57:24 +01:00
Lukas Tönne
a314bf7daf GPv3: Conversion function for the tint modifier
Adds a conversion function for the Tint modifier from GPv2.

Also added a unified function for converting the "influence" settings, which is shared between most grease pencil modifiers.
Modifier type casting was moved into the conversion functions for individual types to make the switch statement less verbose.

Pull Request: https://projects.blender.org/blender/blender/pulls/118465
2024-02-20 12:32:22 +01:00
Sergey Sharybin
43ed74f7a2 Fix crash in GPU compositor when running from command line
The non-locking context activation expects the render engine to
have its own GPU contexts, which is not necessarily the case when
compositing happens from the command line.

Ensure that the contexts exist prior to attempt of activating them.

Pull Request: https://projects.blender.org/blender/blender/pulls/118496
2024-02-20 12:22:43 +01:00
Lukas Tönne
2a7fcf2cfd Fix #118489: Use zero scale default since it's used as an offset. 2024-02-20 11:20:55 +01:00
Jason Fielder
d1a9c2f650 Fix: Metal: EEVEE Next viewport motion blur
Resolves assertion for EEVEE Next motion
blur wherein a swizzled texture used in an
image binding loses write-access. We
instead must bind the source texture
for image write operations.

This is now consistent with expected
behaviour in other APIs.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/117479
2024-02-20 11:17:12 +01:00
Samuel Bilek
c958910e54 UV: support changing the opacity of the UV stretching overlay
This patch adds a new `Stretching Opacity` slider to the overlays panel in the UV Editor.
This allows users to tweak the opacity of the UV stretching overlay, so the image texture
can still be visible through it.

Pull Request: https://projects.blender.org/blender/blender/pulls/117381
2024-02-20 11:03:37 +01:00
Jeroen Bakker
df2b5630d8 Vulkan: Update PCI ids
This change cleans up the PCI ids in the Vulkan backend.

- reuses already exising constants.
- add PCI-id for Apple devices.

Pull Request: https://projects.blender.org/blender/blender/pulls/118485
2024-02-20 10:44:11 +01:00
Jeroen Bakker
98bc3369f8 Cleanup: Silence unused parameter warning in Vulkan backend 2024-02-20 10:02:11 +01:00
Campbell Barton
92428db3bb Fix crash using the depth eye-dropper
Regression in [0] pointed `view_co` to a temporary variable.

[0]: 1c0f374ec3
2024-02-20 19:25:55 +11:00
Campbell Barton
621787e71c Cleanup: spelling in comments 2024-02-20 19:25:54 +11:00
Omar Emara
81867f938c Fix: GPU Hue Correct node is slightly off
The GPU Hue Correct node is slightly off due to incorrect interpolation
of curve maps. We fix this by introducing proper half-pixel offsets to
the curve map coordinates much like we do for other curve map evaluation
shaders.
2024-02-20 09:47:17 +02:00
Omar Emara
db8b7a31f5 Fix #118461: Compositor backdrop is only updated partially
The compositor backdrop is only updated partially for the GPU compositor
when the render percentage is less than 100. That's because the viewer
node wrongly considered the compositing space, while its space is only
affected by its input. So this patch fixes that by ignoring the
compositing space for viewer nodes.
2024-02-20 09:19:48 +02:00
Jeroen Bakker
5294381dae GPU: Fix compilation issues in shader builder 2024-02-20 08:07:02 +01:00
Hans Goudey
c7bea0af1a Cleanup: Add missing fast access to matrix socket base CPPType 2024-02-19 21:49:43 -05:00
Germano Cavalcante
7ed02da2be Refactor: use 'ob_index' to get 'ob' and 'is_space' in knife hit
We can access the object and the is_space status from the ob_index.
This is less error-prone.
2024-02-19 21:21:49 -03:00
Germano Cavalcante
c8d8275674 Cleanup: remove unused members in knife code
`KnifePosData::co` and `KnifeLineHit::perc` are computed but used
nowhere.
2024-02-19 20:42:52 -03:00
Germano Cavalcante
714683b83e Cleanup: replace the struct 'Ref' from knife code with 'LinkData' 2024-02-19 20:39:32 -03:00
Germano Cavalcante
27e01c10dd Cleanup: deduplicate code in editmesh_knife.cc 2024-02-19 20:36:47 -03:00
Harley Acheson
bc0001aa04 Merge branch 'blender-v4.1-release' 2024-02-19 13:27:24 -08:00
Harley Acheson
42a74a28f2 Fix #117780: Allow Embossing With Horizontal Layouts
Although it is nice to skip embossing for middle buttons in aligned
rows, this only applies to vertically-aligned buttons. Horizontal ones
need to keep their embossing, if enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/118304
2024-02-19 22:26:08 +01:00
Jacques Lucke
6c46178a7f Geometry Nodes: support wildcard in Remove Named Attribute node
This adds support for removing multiple named attributes from a geometry at once
using a string pattern that can contain a single wildcard character (`*`).

Using the pattern `sim_*` removes all attributes with the `sim_` prefix for example.

The most difficult design issue here is the decision of what pattern matching language
to use. In the end we only settled on the lowest common denominator for now. This
is already very useful and does not limit us much in the future if we want to support
more complex pattern matching. Once we support lists, some of the use-cases can
also be solved more generally without extra functionality in the Remove Named Attribute
node.

Different pattern matching languages have been discussed before:
https://devtalk.blender.org/t/string-pattern-matching-language-in-blender-and-geometry-nodes/27410

Pull Request: https://projects.blender.org/blender/blender/pulls/118258
2024-02-19 21:21:18 +01:00
Harley Acheson
4ed6daf490 Refactor: BLF Remove blf_glyph_ensure_ex Using Default Argument
We have both a blf_glyph_ensure and blf_glyph_ensure_ex, with the former
calling the latter with subpixel equal to zero. This PR just combines
the two using a C++ default optional parameter.

Pull Request: https://projects.blender.org/blender/blender/pulls/118470
2024-02-19 21:09:08 +01:00
Iliya Katueshenock
42faf9d242 Fix #116082: support changing interface socket bl_socket_idname
Pull Request: https://projects.blender.org/blender/blender/pulls/116146
2024-02-19 21:01:57 +01:00
Julian Eisel
628c026140 Cleanup: Make asset catalog service functions const 2024-02-19 20:47:22 +01:00
Julian Eisel
342f470ccf Cleanup: Make asset library function more clear
Got confused by the naming here myself, this should help.
2024-02-19 20:47:22 +01:00
Harley Acheson
783e565110 Refactor: BLF Remove Size Parameter from blf_glyph_cache_find
The "size" parameter here is unnecessary in that we are passing the
font itself and the function is only ever called (the once) with
font->size. The parameter is also misleading in that you could assume
that the cache is matching only the font size when it actually matches
multiple attributes, including size. Size isn't special here.

Pull Request: https://projects.blender.org/blender/blender/pulls/118469
2024-02-19 20:31:53 +01:00
Miguel Pozo
b13c7941ce EEVEE-Next: Support sphere probe falloff
Setup the noise value.

Pull Request: https://projects.blender.org/blender/blender/pulls/118387
2024-02-19 20:14:18 +01:00
Brecht Van Lommel
d7143459a5 Fix: Build error in boolean and bool conversion with some compilers
Pull Request: https://projects.blender.org/blender/blender/pulls/118464
2024-02-19 19:00:46 +01:00
Ray Molenkamp
0326b29899 Creator: Add CPU check on startup
This adds an sse42 cpu check on startup for both linux and windows,
mac has been excluded, since there are no intel based macs that do
not support SSE42.

The way this works is, we count on the OS to initialize the shared
libraries in the order they are linked (which currently holds true)
before calling the initialization code in the main executable. This
allows us to check the CPU before running any of the code in the main
executable that might not be supported by the current isa.

Changing those build flags is for a future PR, but for now and for
future reference: blender_cpu_check must be build without optimized CPU
flags so it'll be able to run on older CPUs.

some code has been duplicated from blenlib, there's really no way around
that since we cannot link blenlib as it may be build with optimized cpu
flags.

Windows currently gives a popup to inform the user, while linux reports
to the console, there may be better ways to communicate with linux users
with perhaps some generic GUI popup, but I'm unaware of these and will
leave this for the linux platform maintainer to polish.

Part of #116592

Pull Request: https://projects.blender.org/blender/blender/pulls/118054
2024-02-19 18:11:57 +01:00
Julian Eisel
c473a165b8 Merge branch 'blender-v4.1-release' 2024-02-19 18:06:41 +01:00
Julian Eisel
edcdbf1cbd Fix race condition in "All" asset library building
Multiple threads may try to load the "All" asset library catalogs, so
avoid working on the same catalog service in parallel.

Found when testing #118463 on top of #118382, by creating a sculpt brush
asset while the asset shelf is open. The 3D View header would trigger
reloading of the "All" asset library catalogs to display node assets in
header pulldowns, while the asset shelf triggered a threaded reload of
the asset library.
2024-02-19 18:05:31 +01:00
Sybren A. Stüvel
1ee414feb0 Cleanup: avoid compiler warning when USE_BRUTE_FORCE_ASSERT is undefined
Avoid 'unused variable' compiler warning when `USE_BRUTE_FORCE_ASSERT` is
not defined, in release mode builds.

No functional changes.
2024-02-19 17:19:12 +01:00
Germano Cavalcante
402fa94df3 Fix #118445: crash when snapping to face nearest
Caused by `dd1c12e4d0`.

We need to be a little more restricted to calculate the occlusion plane.
2024-02-19 16:37:19 +01:00
Clément Foucault
b7998f1046 EEVEE-Next: Implement Sphere Light-Probe convolution
This adds back sphere probe pre-convolution.
The difference is that we use spherical
Gaussian instead of the GGX NDF.
This allows us to reuse the previous mip as
a source for the convolution and thus reduce
the sample count and give a noiseless result.

However since we don't use filtered importance
sampling anymore, we have to compensate with
some more samples. This could be addressed in
a follow up PR if needed.

This also changes the octahedral mapping
procedure to avoid padding texels and
interpolation artifacts.
Also cleanup to make sure all functions
related to mapping are in the same file.

The change to Spherical Gaussian has some impact
on the look. The resulting visual is a less "foggy"
but most of the energy is where it should be.
Only the caracteristic "GGX tail" is missing.

These sphere light-probes convolved mips are only
used when raytracing is off or un-available (forward
surfaces).

Ref #118256

Pull Request: https://projects.blender.org/blender/blender/pulls/118354
2024-02-19 16:36:23 +01:00
rifai.id
71261f5212 Fix: Smear brush on sculpt mode is causing vertex color alpha to keep increasing
The smear brush on sculpt mode is causing vertex color alpha to keep increasing (see `before` video). I think the amount of alpha should decrease the further away it gets.
My solution is to remove the blending of `accum` with `interp_color` and eliminate the usage of `interp_color` altogether. This will correct the behavior, as seen in the `after` video below.
I provided a [blend file ](/attachments/470b7c27-5707-4d8a-83ea-28a7423f7092) for you to test.

| Before | After |
| -------- | -------- |
|<video src="/attachments/8f28899e-13f2-455f-ac42-dd1464330f3a" title="demo_before.mp4" controls></video>|<video src="/attachments/041389b7-350e-44e2-84cb-a41f26905880" title="demo_after.mp4" controls></video>|

Co-authored-by: Ahmad Rifai <riff.blend@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115292
2024-02-19 16:06:35 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Hans Goudey
81a63153d0 Despgraph: Rename "copy-on-write" to "copy-on-evaluation"
The depsgraph CoW mechanism is a bit of a misnomer. It creates an
evaluated copy for data-blocks regardless of whether the copy will
actually be written to. The point is to have physical separation between
original and evaluated data. This is in contrast to the commonly used
performance improvement of keeping a user count and copying data
implicitly when it needs to be changed. In Blender code we call this
"implicit sharing" instead. Importantly, the dependency graph has no
idea about the _actual_ CoW behavior in Blender.

Renaming this functionality in the despgraph removes some of the
confusion that comes up when talking about this, and will hopefully
make the depsgraph less confusing to understand initially too. Wording
like "the evaluated copy" (as opposed to the original data-block) has
also become common anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/118338
2024-02-19 15:54:08 +01:00
Germano Cavalcante
6b6393b22f Merge remote-tracking branch 'origin/main' into blender-v4.1-release 2024-02-19 11:42:01 -03:00
Germano Cavalcante
4bf6a2e564 Fix #118445: crash when snapping to face nearest
Caused by `dd1c12e4d0`.

We need to be a little more restricted to calculate the occlusion plane.
2024-02-19 11:41:30 -03:00