Temporary directory handling had a logical error, assuming the
"session" temporary directory was owned and created by Blender
and could be recursively removed on exit.
However, it's possible creating the session sub-directory fails,
in that case the temporary directory was used for the "session".
This meant setting `C:\` as the temporary directory in the preferences
would attempt to recursively remove `C:\` on exit.
Resolve with the following changes:
- Only perform a recursive removal on the temporary directory
if a session sub-directory was created.
- If the creating the user-preferences temporary "session" sub-directory
fails fall back to the systems temporary directory and try to
create the "session" directory there.
Previously this was only done if the preference path didn't exist.
The preferences path was still used if it existed but couldn't be
written to.
Include a test to ensure this is working as expected.
Ref !144042
For cases where we've already checked that the property is holding a
particular type, use UncheckedGet to ensure the type isn't checked a
second time. This matches all the other call sites doing similar.
Pull Request: https://projects.blender.org/blender/blender/pulls/144084
As seen in #140942 or 100ed60f2d, files listed in the files property are
relative to the directory property, which may not be the same as the
filepath property parent directory. Not having the directory property
may cause errors.
This improves the warning log message so devs can be more aware of
missing properties. No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/143804
Introduced in 4434a30d40
The above commit changed many of the `wm.radial_control` default
keybinds used in various paint modes to support accessing the "unified"
properties on a per-mode basis. While the base Blender keymap and the
industry compatible keymap were updated, this change was not applied
to custom keymaps, leading to confusing behavior for the users.
Pull Request: https://projects.blender.org/blender/blender/pulls/143872
The Sculpt Undo system does not provide an estimated amount of allocated
memory when the `Geometry` type is used. This is commonly used for
non-brush operations that may affect the topology of the base mesh. As a
result, the Memory Limit undo preference is effectively ignored,
potentially leading to scenarios where much more memory is used than the
user desires and / or crashes due to OOM issues.
To address this, use the `MemoryCounter` abstraction to provide an
approximation to the overall undo system.
Note that this does not change any default behavior, as we only limit the
number of steps, not the total memory used by undo.
Resolves: #143257
Pull Request: https://projects.blender.org/blender/blender/pulls/143756
Output nodes typically don't have a preview (see also ed13dad0). Also,
it is not clear what should be shown as a preview, especially when the
file output node can have an arbitrary number of inputs of different
types.
This commit removes the preview for the File Output node.
Pull Request: https://projects.blender.org/blender/blender/pulls/144029
When attempting to paint weights to a value of 0, the current brush
algorithm struggles to reach 0 when iteratively mixing the current and
previous values due to the falloff from the stroke's center.
Values lower than this are rarely helpful, so to improve the overall
experience of zeroing out weights, round values less than 0.0001 to 0.
Resolves#134160
Pull Request: https://projects.blender.org/blender/blender/pulls/144034
Waveform, Parade and Vectorscopes were calculated by copying the
rendered image, transforming it into display space, and calculating
the the scope from that. On large resolutions, this
copy+transform+free of the image was taking up majority of the time.
Especially for default case when the display transform is a no-op.
Change the code so that display transform, if needed, is done directly
inside scope calculation, without needing a full-size temporary image.
Additionally, the vectorscope calculation was single threaded.
Multi-thread it by doing a parallel reduction, where each job
calculates their own scope image, and they are merged. Since job
payload is fairly large (512x512 bytes), make jobs pretty large
(256k pixels each).
Time (in ms) taken to calculate scope at 4K resolution (Ryzen 5950X,
Windows). Default color management settings:
- Waveform, PNG/SDR: 5.5 -> 5.2
- Waveform, EXR/HDR: 33.5 -> 10.3
- Vectorscope, PNG/SDR: 32.4 -> 4.5
- Vectorscope, EXR/HDR: 53.2 -> 9.8
Timings when additional color space management is needed (display
space set to Display P3, sequencer kept at sRGB):
- Waveform, PNG/SDR: 29.5 -> 10.9
- Waveform, EXR/HDR: 67.6 -> 10.9
- Vectorscope, PNG/SDR: 56.8 -> 12.0
- Vectorscope, EXR/HDR: 85.9 -> 13.4
This also fixes calculation of waveform / vectorscope on float (HDR)
images that have alpha channel; the scope was wrongly calculated on
premultiplied color values, which was not consistent with how it was
calculated on the byte images.
Pull Request: https://projects.blender.org/blender/blender/pulls/144059
Assign the shape keys pointer to the subdiv mesh as was already done for the
evaluated mesh This could already fail before, but is more common now that
subdiv evaluation is always using the wrapper.
Pull Request: https://projects.blender.org/blender/blender/pulls/144030
Ensure that `__main__.__file__` is not set to "<blender string>" when
spawning the subprocess for the background downloader. Blender sets this
value when executing a Python string from C++ code. However, this value
causes issues with Python's `multiprocessing` module, as it expects that
IF the attribute is set, it contains the actual file of the actual main
module. Clearing it works fine, as `__file__` is optional anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/143985
Unit tests veryfying expectation for curves::nurbs::calculate_evaluated_num().
Expectation is computed from closed form expressions rather then hard coded
values. Purpose for this is to make the tests easier to adjust if, for example,
parameter sampling pattern is changed. It should also make them easier to read
and understand.
Additional purpose is to create a baseline and verify changes for #144000.
Implementation is essentially examples from:
https://link.springer.com/book/10.1007/978-3-642-59223-2
Pull Request: https://projects.blender.org/blender/blender/pulls/143920
The compositor ignores translation in certain nodes like Corner Pin.
Users find this unexpected as adjusting the translation of the input has
no effect on the output. The only alternative logical thing to do if
translation exists is to clip the image, which this patch do.
This affects the following nodes:
- File Output.
- Map UV (Image input).
- Corner Pin.
- Plane Track Deform.
- Bokeh Blur (Bokeh Kernel input).
Pull Request: https://projects.blender.org/blender/blender/pulls/144049
This is the second time I've needed a function to find an attribute by
name on all attribute domains, with a third time coming soon. It seems
time to put this in a BMesh header.
Pull Request: https://projects.blender.org/blender/blender/pulls/144039
In this case the depsgraph isn't necessarily evaluated before the
transform operator executes. We need to make sure there's an evaluated
depsgraph so the evaluated deform positions are updated based on the
duplicate operator (the first step of the operator macro).
Pull Request: https://projects.blender.org/blender/blender/pulls/144037
Expose existing mask operators as tools in the toolbar.
The primitive tools are commented out since interactively placement
isn't currently supported by the operators.
Ref !136086
Caused by a compiler issue with function accessing the same SSBO in
different control flow.
Loading the SSBO data before doing the computation fixes the issue.
Candidate for Backporting to 4.5 LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/143926
Operators registered after the key-map was initialized would not have
their user customization's loaded from user preferences.
Resolve by tagging the keymap to be updated when appending operators
as well as removal, this only runs the updates when appending
operators after startup.
May also resolve#126641.
Not to be confused with `Strip.start/endstill` which were renamed with
a legacy suffix. The `StripData` version here isn't present anywhere
in versioning code or otherwise, so it should be safely removable.
Reduces the size of this struct by 8 bytes.
Pull Request: https://projects.blender.org/blender/blender/pulls/143874
- Add `DNA_DEPRECATED` macros, and comments noting when the fields were
deprecated
- Improve other comment clarity
- Other small casing fixes and tidying of the file.
Error in 96e549c092.
The order of colors passed into `BLI_mix_colors` is significant in cases
where the alpha being used is 0. The intent of this line is that the
temporary stroke buffer should have the value of mixing the brush color
with the current buffer value.
Pull Request: https://projects.blender.org/blender/blender/pulls/143972
Adds "Curve Data" panel analogous to "Active Spline" in legacy curves.
This allows setting values both for single and multiple selected curves.
If a particular field's value differs among selected curves, the mean
value is shown in inactive field. The field is modifiable and input
value is set to all selected curves.
Pull Request: https://projects.blender.org/blender/blender/pulls/141572
This PR scales the VFont placeholder character so that it is always
approximately en width. It is currently too wide and scales the size
and line width incorrectly for different font dimensions.
Pull Request: https://projects.blender.org/blender/blender/pulls/143812
Caused by 5f6e94ca58
When there are more than 2^16 points, the GPU index buffer code tries
to compress the indices to uint16 because we passed the incorrect max
index. In general that optimization just isn't worth the complexity
of precalculating the max index in this situation. There are other
potential optimizations here that would be vastly more helpful.
So just pass INT_MAX to disable the compression.
The W channel in quaternion and axis-angle F-Curves is now themeable
(defaulting to yellow), instead of incorrectly blending the X and Y axis
theme colors.
The original blending math did not take into account that the hue
channel actually wraps around, and so the blended color became blue
instead of the intended yellow.
Instead of fixing the math, the theme has been expanded for this W axis.
The default color is set to the mathematically correct yellow.
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/143211
The behavior of the field inferencing changed slightly. So instead of checking
if the link connects a socket that has a field to one that does not, check the
source is a field and the target does not support one. Note the difference
between "having a field" and "supporting a field".
This was probably broken in 7b7c630018.
Pull Request: https://projects.blender.org/blender/blender/pulls/143975
In case an image editor is open in the same window, entering sculpt mode
could crash. The cause is that the 3d viewport can request the sculpt
data vbo and its batch. But the image editor doesn't need it and removes
the sculpt data vbo, but doesn't remove the batch. Next frame the batch
could point to invalid data.
This fix will not keep the batch around so it is always being
reconstructed. A better solution needs to be found as the removal of the
vbo is done in a strange part, and the vbo should be checked against the
cd needed over time.
Pull Request: https://projects.blender.org/blender/blender/pulls/144013
'exr multilayer passes' had an invalid input, so its output was updated
The rest of the tests had outdated output sockets after some 'Color'
sockets were converted into 'Vector' sockets
Pull Request: https://projects.blender.org/blender/blender/pulls/144004
This was a request of the Blender Studio.
The Attribute color mode is used for more correct display of
materials during animation. The assets are created with
a color attribute that mimics the material.
The issue is that this attribute needs to be set up for every
individual object for it to work in Attribute color mode as
the lack of attribute will default the object to Object color mode.
This patch changes the defaulting to Material color mode
just like when using the Texture color mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/143931
Resetting and recycling of immediate drawing buffers was never done and
would leak memory as the buffers were only destroyed when Blender
exited.
This is solved by not recycling or resetting the buffers and rely on the
discard pools. Additional cleanup of removing unused code-paths is also
part of this change so it can be backported to 4.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/143995
For the "Divide" layer blend mode to work in the viewport, we need to use
a floating point texture format for rendering.
This changes the format to always use floats for the `color` textures,
but still switches the `reveal_tx` to use integers in the viewport, and
only floating point during final render.
Pull Request: https://projects.blender.org/blender/blender/pulls/143993
The issue has been introduced in 7ceb4495c5 by missing implementation
of the is_noop() callback for the CPU processor.
While it was not noticeable perceptually, an exact floating point value
might have changed due to un-premultiplication+premultiplication.
The fix needs to be ported to the Blender 4.5 LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/143998
The Group Input node can not access viewport compositor passes, this is
because EEVEE only considered render layers node. This fixes that by
also taking root group input nodes into consideration.
Pull Request: https://projects.blender.org/blender/blender/pulls/143996
Cryptomate's init process would access the scene's viewlayers even when
`build_meta_data` was false - and the `CryptomatteSession` constructor
would only ensure valid viewlayers if `build_meta_data` is `true`.
Triggered in a complex setup (BCon25 app template), but suspect this was
reproducible when the compo node tree is used in a non-active scene.