Since the operator can also act on e.g theme colors [and changes to these shouldnt send undo pushes], dont do a general `OPTYPE_UNDO`, but instead be a bit more specific and only do an undo push for buttons with `UI_BUT_UNDO`.
Probably good for LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/113887
View2D isn't initialized in these regions yet, which is a valid state
for hidden regions. So consider that when calculating the region zoom
factor in the region scale operator.
For historic reasons buttons don't use the full button size as draggable
area by default, only a small part of it that is assumed to contain the
icon (e.g. of a label button). This isn't what we want for the big
preview buttons used here, their entire surface should be draggable.
We already have a workaround in place for this historic behavior, so we
can just enable that.
In 3.6 the names of node group sockets were using char arrays, but now
use allocated strings. The RNA system assigns nullptr to such strings
when assigning an empty string through python (UI assignment appears to
always generate a valid string). This creates issues with many STL
functions, in particular assigning nullptr to `std::string` will crash.
We have to check for valid pointers before using them in places that
don't handle nullptrs.
Pull Request: https://projects.blender.org/blender/blender/pulls/113924
Use "Hair Curves" instead of just curves, to clarify that it's just the
new curves system that's supported, not the legacy one. When the
old one is removed, the label will be changed to just say "Curves"
again.
With the shift to GPU-driven rendering pipeline,
the SSBO vertex fetch paradigm used to
implement workbench shadows on Metal
instead of utilising the geometry shader
path no longer worked correctly.
This is because the draw submission
required vertex amplification up-front,
based on the expected output geometry
amount for a given input geometry.
This patch aims to resolve this
issue through addition of API to
enable the features within the
GPU driven pipeline.
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113498
Conversion from timeline frame to frame index was done by casting to
integer, which followed logic of ffmpeg seeking. However this is not
best approach in some cases - for example when FPS of scene and movie
differs by a very small amount. In this case the first frame could be
duplicated and all other frames will appear as offset by one frame.
In particular this may happen scene is set to 29.97 fps and movie is
encoded at 30000/1001 fps. A frame will still have to be duplicated, but
it should be frame where decimal of frame index crosses 0.5 to keep
audio and video in sync as best as possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/113870
When retiming key is added to frame before strip starts, this causes
crash on null dereference. After adding null check, this creates
retiming data, even though operation is not valid. To prevent creating
empty retiming data, `SEQ_retiming_data_ensure()` is only executed, when
operator actually adds a keyframe.
The increased amount of BSDF code from Principled BSDF v2 and the
microfacet BSDF led to a big performance regression on Metal and AMD.
We have not been able to find a good workaround for all scenes.
This change disables the Principled Hair BSDF code when it is not used
in the scene. This makes common benchmark scenes faster, but
performance is still bad in scenes that do use it.
Ref #112596
Pull Request: https://projects.blender.org/blender/blender/pulls/113904
This was a regression after the sphere light changes, where the normal
now is the normal along the geometry of the light and no longer suitable
for the IES texture direction.
This not only fixes point lights with non-zero radius, but makes the IES
texture direction work consistently across light types and meshes,
always rotated by the object transform.
Note: Initially committed as 7705e49bcd, but got reverted with
1f0520034a. Note includes fixes for unit tests.
If an asset library was pointing to the same path as the current file is saved
in, the assets from this library wouldn't be loaded. This is because the asset
library service assumed the absolute library root path is a way to uniquely
identify an asset library.
Instead, identify the asset library using both the root path and the library
type.
Blender was writing out color attributes on USDPreviewSurface as
float3 instead of the more accurate color3f. While this is somewhat
technically okay, since color3f is a role alias for float3, it does cause
issues in applications that are correctly expecting color3f.
The material writer code actually expects color3f in other
sections, but was using float3 in this section erroneously.
Co-authored-by: Dhruv Govil <dgovil2@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113695
Currently the active attribute is stored as an index. This should be
changed to a string, but until then, adding or removing an attribute
changes the indeices. The workaround is to store the name and fix
the active attribute after the change.
Caused by a1cc621e1e. The "is_hair_length" value needs to be
set before `attr_input_name` is called because it uses the value to set
the attribute name with the "l" alias.
The USE_LIBDECOR_FRACTIONAL_SCALE_HACK worked on my system but made
window size issues worse in older versions of GNOME, see: #109194.
Replace the hack with logic to set the window size using frational
scaling information from the output.
When fractional scaling is used, window sizes from LIBDECOR are still
divided by the window-decorations internal buffer scale which doesn't
match the GHOST window (always 1 in the case of fractional scale).
Also resolve glitches caused by recalculating the window size when
no size change was intended. In this case reuse LIBDECOR's internal
size so there are never any changes (caused by rounding for e.g.).
When the window manager set the window size, there were no checks
the size is a multiple of the buffer scale (a requirement for Wayland).
This meant setting the window size could exit Blender without warning
if an invalid window size was set.
The complaint illustrates how text measurement can be broken by a
drawing callback. This is because overlays are setting global_font_size
value, which is used by subsequent drawing, but does not explicitly set
size on the global_font_default font, which is needed for measurement.
Pull Request: https://projects.blender.org/blender/blender/pulls/113868
Introduced during snap code refactoring.
It seemed wrong to overwrite the calculated nearest distance based only
on the original distance.
But this is intentional, (the code could be improved since there are
unnecessary tests to detect the closest object).
Resolve an error with SSL using a hard coded path to certificates on
Linux causing HTTPS access to fail.
request.urlopen(..) couldn't access any HTTPS URL's.
Previously the first group of deform modifiers didn't need to access
original coordinates explicitly because the deformation wasn't included
in the mesh positions. After d20f992322 the mesh is deformed
directly though, so the original coordinates need to be added first.
In the case of this report, the particle system (which is a "deform"
modifier for reasons) didn't have original coordinates to work with, so
it created the child particles at the deformed positions from the shape
keys every time. Though for some reason it only did that for renders.
Pull Request: https://projects.blender.org/blender/blender/pulls/113679
Adds a "Select by Attribute" operator as mentioned in the discussion in
#105317. This is done in 4.0 to limit the breaking aspect of the removal
of face maps. The selection storage functionality is replaced by boolean
attributes. We already have a way to control the data in the boolean
attribute with the "Set Attribute" operator, but we didn't have a way to
convert the attribute into a selection.
This operator works on the active attribute if is a boolean attribute
and isn't on the face corner domain. It adds to the existing selection
similar to other existing operators.
While this behavior can be recreated as a node tool, we add it as a
builtin operator here to avoid limitations of the new node-based
tool system and to make the late-in-the-release-cycle change safer.
Pull Request: https://projects.blender.org/blender/blender/pulls/113772
See #105317
In 46cf093270, face maps were just converted to an integer
attribute. While the internal data remains the same that way, we lose
the names and some convenient methods of interaction. This commit
additionally converts each face map to a separate boolean attribute
using the old name. This does require that no attributes were using that
name already.
Each boolean attribute can be thought of as a selection, accessible in
geometry nodes and properly interpolated by mesh processing
algorithms. The selections no longer have to be unique, meaning
one face can be part of multiple selections.
Pull Request: https://projects.blender.org/blender/blender/pulls/113769
Before bd00324c26, strip lengths were changed in
`rna_NlaStrip_frame_start_ui_set` and `rna_NlaStrip_frame_end_ui_set`
so as not to be shorter than NLASTRIP_MIN_LEN_THRESH.
This prevented `BKE_nlameta_flush_transforms` from working with
zero-length strips.
But now, in some cases, strip can be zero length.
Therefore, consider this case and avoid division by zero.
Pull Request: https://projects.blender.org/blender/blender/pulls/110121
`Vertex Crease`, like `Edge Crease`, is not supposed to use transform
symmetry.
So remove it.
(`Skin Resize` remains using symmetry since that case seems desirable.
See #84376)
When searching for a new node by dragging from a socket, some results
were untranslated. This is because they did not use a translation
context matching other occurrences, from which the strings were
extracted to the translation files.
Three nodes using operations were affected: Mix and Vector Math.
- Vector Math used the default context when it should have used
NodeTree.
- Mix and Mix RGB used NodeTree when they should have used the default
context.
Pull Request: https://projects.blender.org/blender/blender/pulls/113485