This commit effectively reverts 8d9bf47ba6
and reimplements the check at a more generic / higher level.
After the above commit, Sculpt Mode was unique compared to the other
modes in how visibility is handled, leading to inconsistencies in
behavior in Blender as a whole.
In general, we do not prevent visibility changes of objects no matter
the mode, from the outliner or otherwise, so preventing entry at the API
level solves the problem highlighted in the original commit at an
incorrect level.
While the above may be changed in the future, for now, keeping this
behavior consistent across different object modes is better than the
alternative, and preventing specialized workspaces from being entered
based on the visibility solves the original issue in a more coherent
way.
Pull Request: https://projects.blender.org/blender/blender/pulls/142284
Simplify both `BKE_libblock_find_name_and_library` and
`BKE_libblock_find_name_and_library_filepath` by only searching for a
matching Library ID, and calling `BKE_libblock_find_name` to finalize
the search.
This factorize most of the search logic, and happens to fix a bug in
`BKE_libblock_find_name_and_library`, which would errosneously early-
return `nullptr` in case it found a name-matching local ID, when a
linked one was looked-up for.
Also added minimal documentation to these functions, especially for the
'library' part of the search parameters.
Pull Request: https://projects.blender.org/blender/blender/pulls/144505
The float buffer should be tagged with the standard untonemapped colorspace,
so that when we convert to PQ/HLG the tonemapping is preserved.
With this change:
* Using AgX highlights properly go to white.
* Using the ACES configs, we can convert EXRs to a HDR video, exactly
matching colors with the HDR video on https://dpel.aswf.io/solemates/.
Pull Request: https://projects.blender.org/blender/blender/pulls/144493
Besides "Standard" as in the Blender config, now also recognize
"Un-tone-mapped" as the default view settings to be used for cases like
the 3D viewport solid draw type.
Pull Request: https://projects.blender.org/blender/blender/pulls/144493
The compositor crashes when attempting to read an EXR layer called Alpha
from a multi-layer EXR file. This is because Blender exposes an extra
output in the Image node called Alpha, which is not a real pass, but is
derived from the combined pass. So, this special case conflicts with an
actual pass called Alpha.
To fix this, we only consider the special case if the pass name is the
combined pass.
Pull Request: https://projects.blender.org/blender/blender/pulls/144498
Point Caches (used by particle system, cloth, boids etc.) are now
always compressed, uzing zstd coupled with lossless data filtering.
- This is both smaller cache files _and_ faster than the old
"Heavy" compression mode,
- And smaller data files and same or slightly faster speed than
using no compression at all,
- There was not much difference between compression levels once
data filtering got added, so option to pick them was removed.
- So there's no downside to just always using the compression,
which makes for a simpler UI.
- RNA change: removes PointCache.compression property.
More details and cache size / performance numbers in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/144356
Previously, we always just used `int` when dealing with menu values on the C++
side. It's currently the only type where we have the same base type (`int`) for
two different socket types (integer and menu sockets). This has some downsides:
* It requires special cases in some places.
* There is no function from static base type to socket type (which is useful for
some utilities like `SocketValueVariant`).
* It implicitly allows operations on menu values that shouldn't be allowed such
as arithmetic operations and conversions to and from other types.
This patch adds a new `MenuValue` type that is used for menu sockets in Geometry
Nodes and the (CPU) Compositor, clarifying the distinction between integer and
menu values.
Pull Request: https://projects.blender.org/blender/blender/pulls/144476
Code is trying to append from itself, this is not allowed (and will
assert in debug builds).
Instead, create a new copy of the matching local workspace. This
allows to keep identical behavior from user PoV, when the source
workspace is in the same blendfile.
Pull Request: https://projects.blender.org/blender/blender/pulls/144352
This PR proposes to add a new flag `--shader-debug-info` that enables the generation of shader debug information.
I created this PR as WIP due to the following reasons:
- Currently it only works for the Vulkan backend. I do not know if it makes sense for other backends. For example, OpenGL directly receives the GLSL code, so there no need for this might exist.
- So far `--debug-gpu-renderdoc` already turns on the following changes for GLSL shader compilation with shaderc:
```
options.SetOptimizationLevel(shaderc_optimization_level_zero);
options.SetGenerateDebugInfo();
```
- While combining optimization level zero with debug info is a sensible choice for frame debuggers like RenderDoc, my use case for creating this PR is shader profiling. In this case, one does not want compiler optimizations to be turned off. At the current point in time, the only information my profiler uses (which is unfortunately not public at this point in time) is the name of the shader. When turning on debug information, shaderc/glslang store this information in the generated SPIR-V data. Otherwise, it would be impossible for the profiler to tell the user what the name of the shader it is that is profiled.
- An alternative solution would be to rename the entry point `main` of a shader to the name of the shader. But this might be an even uglier hack, as it requires editing the source code (and the name of the shader then needs to be a valid GLSL function name).
- We should first clarify if there is interest in the Blender side in upstreaming an option like this. While I could just keep this in my local fork of Blender, there is merit in having the possibility to profile arbitrary Blender builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/142986
Adds scene assets (including the catalogue tree) to the `Add` > `Scene` menu.
When selecting a scene asset, the asset import setting is used:
* Link: Scene is linked (cannot be edited, but will be used by the strip)
* Append: Appends the full scene including all IDs to the file.
* Append/Reuse: Appends the scene but will reuse IDs (like mesh data, materials, etc.).
Objects, collections, and the scene itself are not reused.
Part of #144063.
Pull Request: https://projects.blender.org/blender/blender/pulls/141213
This improves the rendering of cyclical strokes in Grease Pencil
by connection the start and end lines segments together.
To make this possible the Vertex Shader needs to know if the
curve is cyclical and the start and end of the current stroke.
This PR stores the cyclical in the sign of `point index`. All points
already know the start of the curve as `stroke_id`, so all we
need is the end of the curve. Grease Pencil already uses a
point at the start and end of the stroke as padding. So if the
first buffer point stored the index to the last buffer point, any
other point and just go to the first point then to the last.
Pull Request: https://projects.blender.org/blender/blender/pulls/143976
The problem was that `automerge` would run even when the
operator was cancelled.
This also fixes a unnoticed bug were unrelated strokes would
merge when the operator was cancelled.
Pull Request: https://projects.blender.org/blender/blender/pulls/144470
The "Asset Shelf" checkbox can be confusing for people, they enable it
but it still can't get the shelf to show up. This is because the shelf
is only available in certain contexts (e.g. pose mode and paint modes
in the 3D view, more is planned see blender/blender#135061). Gray out
the toggle with a disabled hint when not available.
The region toggle pie menus will hide the item.
Pull Request: https://projects.blender.org/blender/blender/pulls/113063
This commit adds the option to open the Preferences editor in a
maximized area instead of a new window. This is done by adding a
"Preferences" field to the Interface > Editor > Temporary Editor
preferences. The default value is set to "New Window" keeping the
current behavior.
Implements: #142665
Pull Request: https://projects.blender.org/blender/blender/pulls/142681
The distance sampling is mostly based on weighted delta tracking from
[Monte Carlo Methods for Volumetric Light Transport Simulation]
(http://iliyan.com/publications/VolumeSTAR/VolumeSTAR_EG2018.pdf).
The recursive Monte Carlo estimation of the Radiative Transfer Equation is
\[\langle L \rangle=\frac{\bar T(x\rightarrow y)}{\bar p(x\rightarrow
y)}(L_e+\sigma_s L_s + \sigma_n L).\]
where \(\bar T(x\rightarrow y) = e^{-\bar\sigma\Vert x-y\Vert}\) is the
majorant transmittance between points \(x\) and \(y\), \(p(x\rightarrow
y) = \bar\sigma e^{-\bar\sigma\Vert x-y\Vert}\) is the probability of
sampling point \(y\) from point \(x\) following exponential
distribution.
At each recursive step, we randomly pick one of the two events
proportional to their weights:
* If \(\xi < \frac{\sigma_s}{\sigma_s+\vert\sigma_n\vert}\), we sample
scatter event and evaluate \(L_s\).
* Otherwise, no real collision happens and we continue the recursive
process.
The emission \(L_e\) is evaluated at each step.
This also removes some unused volume settings from the UI:
* "Max Steps" is removed, because the step size is automatically specified
by the volume octree. There is a hard-coded threshold `VOLUME_MAX_STEPS`
to prevent numerical issues.
* "Homogeneous" is automatically detected during density evaluation
An option "Unbiased" is added to the UI. When enabled, densities above
the majorant are clamped.
Regression from 00375abc38, since hierarchy roots are no more ensured
for all liboverrides after each recursive resync level, these pointer
can now be null in the code cleaning up unused liboverrides.
Note that they could already be null before (in isolated override case),
but this case is very rare in practice.
Introduced with ba291976b2
The above fix was incomplete; while it resulted in the correct value
being applied for the buffer, the actual blending and application of the
color with the existing mesh values was incorrect.
Pull Request: https://projects.blender.org/blender/blender/pulls/144465
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.
The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.
Summary
- If you are using BKE APIs to access openvdb features, then use the
`bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
`bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
target (rare)
context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
This PR removes validation of saved bookmarks and system paths in File
Browser. The act of checking validity of a path can result in a timeout
that can last many seconds. Blender will have a very long startup time
if any such items are disconnected, invalid, offline, or removed. Even
if these paths are not used during the Blender session, like network
shares used only at work, web storage for some non-Blender use, a
shortcut to a USB drive, etc. Items will not be greyed out, and
clicking on one will result in a timeout _at that time_ but this seems
like expected behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/138218
This type was the same for every socket type supported by Geometry Nodes.
It's always `SocketValueVariant` now. Therefore, it was unnecessary to s
tore an explicit pointer to it.
Pull Request: https://projects.blender.org/blender/blender/pulls/144458
In the `Strip` panel in the scene template ID, the "new/duplicate"
operator would duplicate the active scene in the window instead
of the selected scene in the strip.
Pull Request: https://projects.blender.org/blender/blender/pulls/144453
The issue was that an rna function was called on `Bone`
that expected an `EditBone`. Because the pointer was just casted,
this means it would write into wrong bytes on the struct.
Caused by a43359eb88
Pull Request: https://projects.blender.org/blender/blender/pulls/144447
When search popups are created at the bottom of the screen, they are
repositioned to stay within the bounds of the main window. This
can cause the cursor to hover over one of the search results, causing
it to become active.
Since some searches put recently searched items at the top of the
result list, the first search result should always be active by default.
This is achieved by ignoring the mouse event after the creation of
the popup by checking if the mouse has actually moved.
Pull Request: https://projects.blender.org/blender/blender/pulls/144296
For HDR (float) content, previously the Histogram scope was displaying
-0.25..+1.25 value range. Negative range display is not really useful,
and the upper bound of 1.25 is not really large enough for HDR.
Change the histogram to:
- Display 0..12 range for HDR content, with the same amount of
uniformly distributed histogram bins (256 bins for 0..1 range, so
3072 bins for HDR range). Larger amount of bins does not affect
histogram calculation performance in a measurable way.
- Histogram scale is so that horizontal image range is 0..1 (LDR) part
of the histogram; HDR part extends to the right. When displaying the
histogram, the preview area zoom aspect ratio is not locked, so the
user can arbitrarily change it. Frame All/Selected operators,
while showing the histogram, frame the entire range.
- Draw maximum R/G/B values as semitransparent vertical lines in the
histogram.
- Display each bin as a rectangle, instead of lines joining next and
previous bin values. This feels better especially for isolated bins.
- For vertical grid lines, make the line stop below the text label,
instead of going through it.
Images in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/143537
This PR moves the responsibility of destroying discarded resources to
the submission thread. Previous implementation could be blocked and
would not always run.
This solves memory leak when rendering in background and keeps the
overall memory usage lower as all is done in a single location.
Pull Request: https://projects.blender.org/blender/blender/pulls/144440
This patch extends the support for menu sockets in the compositor to
also include pixel nodes. Menu sockets are not yet used in any node, so
this has no apparent effect.
Pull Request: https://projects.blender.org/blender/blender/pulls/144436
Commit 798f85a710 changed the way the languages menu is generated in
order to improve the items' descriptions. This revealed that items in
`bpy.app.translations.locales` used this description instead of the
identifier, resulting in them looking like:
'Locale code: ca_AD. Translation progress: 100%'
instead of:
'ca_AD'
To use the language code, this commit uses the menu item's identifier
instead of description.
-----
This should be backported to 4.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/144366