Commit Graph

106978 Commits

Author SHA1 Message Date
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
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
Miguel Pozo
5a76a4190d Fix: Workbench: Wrong volume shader
Regression from
2a2effc0c2
2024-02-19 15:37:14 +01:00
Iliya Katueshenock
9e12a675b5 Cleanup: Merge BKE_node.h into BKE_node.hh
Trivial change, just move all the code from `BKE_node.h` to `BKE_node.hh` header top.
No mixing code from different headers or namespace changes. Part of #117773

Pull Request: https://projects.blender.org/blender/blender/pulls/118407
2024-02-19 15:26:10 +01:00
Philipp Oeser
9ca48c0e2c Merge branch 'blender-v4.1-release' 2024-02-19 15:18:59 +01:00
Philipp Oeser
8675fc50dc Fix #105968: Crash when delete linked object in scenes Outliner
Problem here is that when selecting/activating an object in a different
scene in the Outliner, the Outliner will automatically switch scenes via
`WM_window_set_active_scene` however the `view_layer` was untouched and
as a consequence `BKE_view_layer_synced_ensure` gets the right scene but
the "wrong" viewlayer [which makes it not do its thing properly]

To solve, now use the new active viewlayer after having switched scenes.

NOTE this also solves a couple of other asserts elsewhere (when not
deleting, just selecting/activating could assert on
`DEG_is_evaluated_object(ob)`)

Pull Request: https://projects.blender.org/blender/blender/pulls/118458
2024-02-19 15:18:19 +01:00
Bastien Montagne
b31e6bd93e GPv3: Conversion: Add general modifiers handling, and convert Noise one.
Fairly straightforward.

Note that only the Noise modifier is handled in this commit, for demonstration/testing purposes.

The other modifiers remain TODO and will be handled in later commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/118415
2024-02-19 14:34:40 +01:00
Falk David
a6dbfc8281 Fix: GPv3: Don't convert default thickness factor
The check that would early return to skip the thickness conversion was wrong.
It should check if the factor is 0 and then return.
2024-02-19 13:54:29 +01:00
Jacques Lucke
1f30f41af8 Geometry Nodes: align input and output sockets in simulation and repeat zone nodes
This changes the drawing of the zone nodes to align corresponding input
and output sockets. The resulting nodes are smaller and it's easier to see
how data is passed through them.

Drawing aligned sockets is already technically supported for quite a while
already, but we haven't used it so far. Using them for zone nodes seems to
provide benefits only. How we use aligned sockets in other nodes still has
to be discussed more.

This patch only changes run-time data. It doesn't affect what is written to
.blend files.

In the node declaration, aligned sockets are created by tagging a socket
so that it is aligned with the previous socket. This is a bit different from
what we had before where a single socket declaration would be used for
an input and output socket. I think the approach used here works better,
especially in a potential future scenario where the input and output socket
has a different type.

Pull Request: https://projects.blender.org/blender/blender/pulls/118335
2024-02-19 13:32:01 +01:00
Brecht Van Lommel
05f6a32b18 Merge branch 'blender-v4.1-release' into main 2024-02-19 13:18:27 +01:00
Brecht Van Lommel
7dd0dfe188 Fix: Build error using WITH_GPU_DRAW_TESTS and WITH_VULKAN_BACKEND 2024-02-19 12:24:54 +01:00
YimingWu
ae20873250 GPv3: Weight proximity modifier
This migrates the Weight proximity modifier to GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/118363
2024-02-19 11:16:38 +01:00
Jeroen Bakker
06dd75ebd0 EEVEE-Next: Fix Metal Shading Warning
Implicit conversion between int and uint should be made explicit
accourding to our style guide.

Pull Request: https://projects.blender.org/blender/blender/pulls/118450
2024-02-19 09:53:53 +01:00
Aaron Carlisle
234e15f7b6 UI: Allow Context Online Manual Access for User Preferences
The check for owner ID here was preventing the online manual access to work for user preference properties.

This is also true for Python API Documentation access.
2024-02-19 02:11:04 -05:00
Jacques Lucke
5594490aea Fix: race condition in atomic disjoint set
To fix this, I compared our implementation with the reference implementation
in more detail again and found some differences.
Aligning our and the reference implementation a bit more fixed the issue.

Reference implementation: https://github.com/wjakob/dset/blob/master/dset.h

Pull Request: https://projects.blender.org/blender/blender/pulls/118434
2024-02-19 02:09:55 -05:00
Jeroen Bakker
2cb2d3944b RenderTest: Fix EEVEE Render Test
Panorama dicing test fails for EEVEE on legacy platforms. EEVEE creates a shader interface
that isn't compatible with the vulkan backend. This PR hides the check.

Check should be enabled again after EEVEE has been replaced by EEVEE-Next.
This PR also changes the behavior when checks are executed. It used to be
executed when blender was build with asserts. Now it is behind the --debug-gpu flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/117992
2024-02-19 08:07:53 +01:00
Aaron Carlisle
09ff1b1f7e UI: Allow Context Online Manual Access for User Preferences
The check for owner ID here was preventing the online manual access to work for user preference properties.

This is also true for Python API Documentation access.
2024-02-19 02:07:47 -05:00
Hans Goudey
fb8f9deaab Cleanup: Store BLF Glyph cache with C++ Vector, use std::mutex
- Store glyph cache entries as unique pointers in a vector
- Use std::mutex instead of `ThreadMutex`

Pull Request: https://projects.blender.org/blender/blender/pulls/118222
2024-02-19 03:34:36 +01:00
Campbell Barton
64213e6c24 Cleanup: use std::string for manual_id access 2024-02-19 12:18:30 +11:00
Campbell Barton
14b5912eee Cleanup: quiet C4551 warning for MSVC 2024-02-19 09:34:41 +11:00
Campbell Barton
e51f954f39 Cleanup: spelling in comments, RNA description warning 2024-02-19 09:23:48 +11:00
Jacques Lucke
02127c1d3e Fix: race condition in atomic disjoint set
To fix this, I compared our implementation with the reference implementation
in more detail again and found some differences.
Aligning our and the reference implementation a bit more fixed the issue.

Reference implementation: https://github.com/wjakob/dset/blob/master/dset.h

Pull Request: https://projects.blender.org/blender/blender/pulls/118434
2024-02-18 19:20:45 +01:00
Pratik Borhade
203f5f9f09 GPv3: Autolock inactive layers
Port legacy `autolock_layers` property to gpv3

Pull Request: https://projects.blender.org/blender/blender/pulls/118323
2024-02-18 07:32:56 +01:00
Iliya Katushenock
c2b56ca468 Cleanup: prevent unnecessary copy of VArray
Pull Request: https://projects.blender.org/blender/blender/pulls/118349
2024-02-17 21:44:21 +01:00
Jacques Lucke
1e20f06c21 BLI: add utility to simplify creating proper random access iterator
The difficulty of implementing this iterator is that it requires lots of operator
overloads which are usually very simple to implement, but result in a lot of code.
The goal of this patch is to abstract the common parts so that it becomes easier
to implement random accessor iterators. Many algorithms can work more
efficiently with random access iterators than with other iterator types.

Also see https://en.cppreference.com/w/cpp/iterator/random_access_iterator

Pull Request: https://projects.blender.org/blender/blender/pulls/118113
2024-02-17 20:59:45 +01:00
Dalai Felinto
c9d506ba18 Extensions: Rename experimental feature name, description and task
New name: Extensions

Now that we are gettting closer to a launch I need to refer to this
feature in the documentation. As such it was time to bring it up to
date.

I'm also pointing the experimental feature to the task where the Alpha
launch is being coordinated (#117286). Once that task is all ticked we
will likely be ready to go out of experimental.
2024-02-17 15:50:16 +01:00
Germano Cavalcante
a0d453ccad Merge branch 'blender-v4.1-release' 2024-02-17 10:38:46 -03:00
Germano Cavalcante
dd1c12e4d0 Fix: 'V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE' flag not working
The name `use_occlusion_test` was misleading and led to errors.

If this variable is false, objects will be considered to always be
occluders.

Not a serious problem, since the flag is not being used.
2024-02-17 10:17:38 -03:00
Germano Cavalcante
286b5a1c34 Fix: Snap Cursor API not returning index
Not a serious problem as nowhere currently requires this index.
2024-02-17 10:17:27 -03:00
Pratik Borhade
daedb427c5 Merge branch 'blender-v4.1-release' 2024-02-17 11:38:33 +05:30
Pratik Borhade
1e81a353ad Cleanup: Wrong return value
`drop_target_tooltip` return type was changed to std::string in
7ca4dcac5a

Pull Request: https://projects.blender.org/blender/blender/pulls/118361
2024-02-17 07:04:38 +01:00
Clément Foucault
8b6d145a6b Fix: Metal: Shader compilation logging with compute shader
It was missing the line directive treatment the
fragment and vertex shader had.
2024-02-16 22:52:59 +01:00
Hans Goudey
c4bdfba15d Cleanup: Sort geomery node static definitions 2024-02-16 14:43:36 -05:00
Iliya Katueshenock
1dfd94a8d3 Cleanup: EEVEE: Fix compile warning
Pull Request: https://projects.blender.org/blender/blender/pulls/118322
2024-02-16 20:01:06 +01:00