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
If an item name (and ID) is provided, never successfully match only
based on the item index.
This can lead to matching to a complete different ID than the intended
one, which can be catastrophic for the integrity of the next resync.
Also, do not require sucessful match on both source and destination
data, this will always fail in case e.g. an item is removed from a
collection, and can prevent detecting required resync from that
collection then.
This commit also enables new 'harder' test in unittests, added in
previous commit, which is now expected to pass.
Pull Request: https://projects.blender.org/blender/blender/pulls/144429
Recursive resync would validate hierarchy info of all IDs in Main, when
it should only handle the ones in its currently processed 'library level'.
Otherwise, it could incorrectly clear hierarchy info from 'more local'
liboverrides that were still to be resynced, leading to issues like
left-over 'orphaned'/unused liboverrides, needless renames, etc.
Also contains a few 'logical mistakes' fixes in the resync code, though
these did not seem to have any known practical effect.
With 5.0 we start requiring this extension for GL and VK.
All of our target hardware supports it with up to date
drivers.
Some old drivers were disabling this extension because of
buggy behavior. We simply drop support for them in 5.0.
This allows us to remove a lot of code and the last
shader create info override done at startup. This will
unlock more refactoring of the shader create info into
static classes to reduce binary size and other benefits.
## TODO:
- [x] Remove checks for ARB_shader_draw_parameters
- [x] Remove checks for ARB_clip_control
- [x] Check for the extension on startup for OpenGL
- [x] Check for the extension on startup for Vulkan
- [x] ~~Add user facing popup message about minimum
requirements not being met.~~ Done using the same
popup as old hardware.
Pull Request: https://projects.blender.org/blender/blender/pulls/142334
Simplify ANIM_unit_mapping_get_factor() by returning early and reducing
cognitive complexity. This will make it significantly simpler to expand it
for other RNA property (sub)types.
Also I added a unit test for rotation conversion between radians and
degrees.
No functional changes.
This is intended as a cleanup for !143880.
Taken over from #144140
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/144427
This PR will swap device local memory to system ram. It relies on
VK_EXT_external_memory and VK_EXT_pageable_device_local_memory
extensions to be supported by the system.
Most platforms support these extensions.
Pull Request: https://projects.blender.org/blender/blender/pulls/144422
Technically a regression in [0] however even before this commit
there where no check to prevent an intersection being used which
is far outside triangle the vertex is sliding towards.
Resolve by only using the line-line intersection if the intersection
points lie within a conical region defined by the edge pair the user
is sliding towards (see code-comment for details).
Ref !144418
[0]: 49ab0bb844
Changing a node tree item property (such as the default value) was using a very
broad and generic "tag" function which invalidates the runtime items cache.
This also invalidates any python iterators due to the API using the runtime
cache. Changing node tree items in a loop will then crash.
It's not necessary to invalidate the runtime items cache when the actual item
pointers have not changed. Most RNA updates only change superficial properties,
or at most require a recursive node tree update due to change of identifiers or
types.
This PR introduces a simpler "tag" function to only tag for tree updates by not
rebuild the entire runtime items cache. It also renames existing functions and
docstrings to better explain what each of them does and should be used for.
The `NodeTreeInterfaceChangedFlag` is removed completely because it is only ever
used as a simple boolean indicator of "item changes" that require a cache
rebuild. It is replaced with an atomic bool like flags used for runtime caches.
Pull Request: https://projects.blender.org/blender/blender/pulls/143932
Previously the baking job is not properly ended when not baking in
background, this means when the bake is called from the script, the
interface lock is not properly reset, then parts of the interface can
stay locked afterwards. This fix adds `lineart_bake_endjob` to the
foreground code path so the interface will be unlocked properly.
Pull Request: https://projects.blender.org/blender/blender/pulls/144405
There are stability issues with the vulkan backend. Some scenes indicate
that there is no space left to allocate the next descriptor buffer. For
stability reasons we will disable descriptor buffers and look into a
better solution.
Pull Request: https://projects.blender.org/blender/blender/pulls/144421
Strokes would lose their deform group values after moving them to a
different layer, because `vertex_group_names` weren't transferred to
the newly created `CurvesGeometry` inside `execute_realize_curve_tasks`.
This commit adds another version of `copy_vertex_group_names` for
Curves, and separates the duplicate code into `copy_vertex_group_name`,
which is used by both meshes and curves.
This also fixed strokes losing deform weights in multiple situations, such as:
- When performing a layer merge.
- When applying generative modifiers like Mirror or Array
Pull Request: https://projects.blender.org/blender/blender/pulls/142881
This simplifies the bake API used by Geometry Nodes by using `SocketValueVariant`
instead of raw pointers. This is possible now, because all socket types use
`SocketValueVariant` under the hood.
Pull Request: https://projects.blender.org/blender/blender/pulls/144410
Now that every socket type uses `SocketValueVariant` since #144355, the
parameter access code can be simplified a bit.
This also adds a new `GeoNodesMultiInput<T>` type that's used to access the list
of inputs value multi-input sockets.
Pull Request: https://projects.blender.org/blender/blender/pulls/144409
Parallelizes implementation for computing the NURBS basis cache.
Removing the unnecessary linear 'find span' search. Due to formulation
of the span find implementation, breakpoints are now evaluated in the
following span rather then in the previous. This does not affect the
point evaluation results, but adjusts how they are computed in the
basis cache.
On top of the threading improvement, removal of the linear search
also means the computational complexity goes from O(n^2) to O(n).
For a very large NURBS curve (250K points), performance is increased
by roughly 40 000 times, and is now interactive!
For cases with large number of small curves. Tests with 25K curves
and 10 control points per curve also indicated a slight performance
improvement, with roughly a 13% reduction in execution time.
Pull Request: https://projects.blender.org/blender/blender/pulls/144000
Though this is always non-null currently AFAIK, there's no reason
not to add a null check for some safety in the rare case that no
logging evaluation happens before displaying the UI.
Fixes missing isolated vertices in `mesh_apply_spatial_organization` by
ensuring non-added vertices (ones not forming a face) are appended to
new_vert_order, preserving correct vertex ordering for meshes with
disconnected geometry.
Pull Request: https://projects.blender.org/blender/blender/pulls/144388
One thing to keep in mind is that while `ob->actcol` is one-based (if
materials are assigned), `active_material_index` is zero-based so we
have a couple of places to make sure whenever materials are assigned,
we should always be in the range of `1..totcol` for `ob->actcol`.
In the particular case of the report, the last remaining material slot
was removed (`ob->actcol` gets rightfully zero then), but assigning a
material from the `template_ID` then calls `BKE_object_material_assign`
with zero as the active index.
The internal `act` number was corrected [ `std::max<int>(act, 1)` ],
but did not end up in `ob->actcol`.
`BKE_object_material_resize` [which all code assigning/removing/...
materials eventually comes down to] used to do the "sanitizing" actually
(but exited early when `totcol` didn't actually change).
There were other places to, clamping to a proper upper or lower bound.
So to resolve, move the code for sanitizing into its own function and
use it after `BKE_object_material_resize` (and from a couple of places).
Ref !143196
Move the existing USDZ export test from C++ to Python for better
validation. The resulting file is now run through the `usdchecker`
system and we also check the contents of the resulting archive for the
expected texture file. This helped uncover a pathing issue in the
resulting archive where the 'textures' directory was misnamed on win32;
though it was still functional.
Pull Request: https://projects.blender.org/blender/blender/pulls/144176
Depend only on `getcwd` and `chdir` rather than attempting to also
consider the `PWD` environment variable.
There's situations where these differ, and most easily seen when running
the Python tests. Calling `pathlib.Path.cwd()` will return something
like `/home/blender/git/blender-vexp/build_asserts/tests/python` while
PWD is `/home/blender/git/blender-vexp/build_asserts`. In this case,
calling `getcwd` will match what Python shows.
Additionally, this now matches what Windows and Mac do for these
affected APIs.
Pull Request: https://projects.blender.org/blender/blender/pulls/144235
* GHOST is an implementation detail, Blender environment variables should
have the BLENDER_ prefix.
* Don't put links in command line help output. We don't do this for other
arguments either, and it's trivial to search for this online.
* Make description more straightforward and line wrap.
* Use CLOG for logging.
Ref #143049
Pull Request: https://projects.blender.org/blender/blender/pulls/144349
- Make PTCACHE_COMPRESS_ an actual enum
- Clarify that while it looks like bitmask, it really is just an enum
- Make ptcache_file_compressed_write take similar arguments as
ptcache_file_write (item count and item size)
- All callers of ptcache_file_compressed_write were doing compressed
result memory allocation in exactly the same way; just make it happen
inside the function itself. This also makes it no longer need
the callers to do "is this zstd?" check around the call.
- The lzma "props" buffer was dynamically allocated for no good reason,
just make it a simple array, and clarify the variable names.
- Remove BLI_assert_unreachable() from ptcache_file_compressed_read;
asserts are for "impossible" situations; this one just happens any
time one opens a 4.x file with caches in 5.0.
Pull Request: https://projects.blender.org/blender/blender/pulls/144193
Looks like this was caused by 3de916ca25.
Steps to reproduce were:
- Switch to the Scripting workspace
- Paste:
`C.screen.areas[5].spaces[0].rna_type.properties['show_region_asset_shelf'].`
- Press tab
The RNA property getter should always return a value, even when empty.
That's what other such getters do as well.
The File Output node does now allow empty names for its sockets, so
doing things like flat RGBA pass in an unnamed layer is impossible,
which was possible before the recent redesign of the node. To allow
this, socket items accessors now have an option to allow empty names.
Implementation wise, the non-default variant of BLI_uniquename_cb was
used to make the empty name replacement optional. Incidentally, the new
function is more CPP friendly, so the MAX_NAME length limitation was
lifted.
Pull Request: https://projects.blender.org/blender/blender/pulls/144334
The code path isn't well defined when there aren't any faces, causing
the vert, face, and corner normal caches to call each other, potentially
trying to lock the same mutex twice.
Duplicating a strip that references an ID like the scene strip would not
duplicate the scene. This is wanted in some workflows.
To align with the rest of Blender, this changes the behavior for how
strips are duplicated:
* `Shift + D` ("duplicate"): Duplicate the strip and also duplicate the
IDs referenced by the strip. Currently this only affects `Scene`,
`MovieClip`, and `Mask` strips.
* `Alt + D` ("duplicate linked"): Duplicate the strip, but reference the
same IDs. This is the current behavior in `main`.
Part of #144063.
Pull Request: https://projects.blender.org/blender/blender/pulls/144138