If a panel has a toggle, then it's a best practice that everything inside it is
grayed out of the toggle is off. It's not something we can enforce for node
groups, but should enforce it for built-in nodes. Right now, we don't have
built-in nodes with panels, but that may change e.g. with #135990.
This patch makes it so that the socket usage inferencing takes panel toggles
into account when determining if an input socket in a built-in node in a panel
is used.
Pull Request: https://projects.blender.org/blender/blender/pulls/135993
Snap nodes by first aligning their inital location to the grid and then
offsetting them in grid increments to avoid jiggling when multiple
unsnapped nodes are moved at once.
Pull Request: https://projects.blender.org/blender/blender/pulls/136437
Newer nodes may not have a fixed `legacy_type`. This was not accounted for
correctly when reading nodes. Such newer nodes are exclusively identified by their idname.
Fortunately, Blender 4.4 was released without any new nodes that don't have
a fixed `legacy_type`. So this does not have to be backported.
Pull Request: https://projects.blender.org/blender/blender/pulls/136431
When adding a texture to a brush datablock, currently, the resulting
undo step does not have any effect when undone. This is due to the
texture being added to the linked asset library. As we do not want this
extraneous undo step to be created since it has no effect, this commit
does the following:
* Removes the automatic undo handling with OPTYPE_UNDO
* Manually adds a undo step if the newly created Texture datablock was
not moved to a library.
Pull Request: https://projects.blender.org/blender/blender/pulls/136336
With tint brush active, holdinh ctrl key doesn't erase the color
attribute. Similar to vertex brush (`VertexPaintOperation`) reduce alpha
value from the influence
Pull Request: https://projects.blender.org/blender/blender/pulls/136424
The issue was that using `DEG_get_original_id` returned the same
evaluated ID, because the `GreasePencil` in the geometry set doesn't
have the original ID pointer set.
Instead, use the original ID pointer stored in the
`GreasePencilEditHints` (which is better anyway).
Also resolves#136307.
Pull Request: https://projects.blender.org/blender/blender/pulls/136455
This reintroduce the same behavior as 4.3 with regard to
selection and depth drawing.
This patch also disables facing overlay during depth
drawing to avoid it conflicting with tge auto-depth
feature.
Also fix#136418
Pull Request: https://projects.blender.org/blender/blender/pulls/136427
This will likely reserve a larger vector more than actually needed.
Reserve only the same count of decorators to be added, since they
likely match the number of buttons that needs to be temporally
retrieved.
Decorators buttons are added along animatable property buttons in each
`layout.prop` function call, when a property is a `XYZ` vector property,
drawing this property adds 3 inputs buttons and for each inputs buttons
this need to insert an aligned property decorator, since this decorators
are added just after the buttons are added this likely just takes out
temporally this last 3 elements and inserts them back with each
corresponding decorator.
Pull Request: https://projects.blender.org/blender/blender/pulls/136191
Use aces_interchange role in OpenColorIO to identify the correct colorspace
for each config. Also use acesImageContainerFlag attribute from the ACES
container format to identify the colorspace.
Write ACES2065-1 chromaticities in EXR files when appropriate. This gets us
closer to supporting output of the ACES container format, though we don't
write acesImageContainerFlag. There are various restrictions that must be met
which are not very practical, and even exr2aces doesn't write it.
Pull Request: https://projects.blender.org/blender/blender/pulls/135823
The OpenEXR format has a chromaticities attribute that identifies the scene
referred linear color space. Detect these two cases now, and assign the
corresponding color space from the OpenColorIO configuration.
In general these chromaticities are known to be unreliable and missing support
in most software, with ideas to deprecate them entirely. However the ACES
container format standard requires them, and with this change we'll be able to
read such images with the right color space set by default.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135823
Interpolating between curves of the same length was shifting the target
points by 1 index position, starting about half-way along the curve.
The reason is that the `num_free_samples` count compared _points_ of the
destination curve to _segments_ of the source curve, and at equal point
count the segment count is 1 less.
This extra point would be consumed about half-way along the spline, and
then the end point of the source curve was not represented. Fixing
the count makes sure that source and target curve match exactly when
they have the same number of points.
Pull Request: https://projects.blender.org/blender/blender/pulls/136448
This PR adds swapchain synchronization. When the swapchain swaps the
buffers it can add a wait semaphore/signal semaphore to support GPU
based synchronization
10 times playback of `rain_restaurant.blend` on AMD RX 7700
Before: 10 × Animation playback: 72347.5540 ms, average: 7234.75539684 ms
After: 10 × Animation playback: 41523.2441 ms, average: 4152.32441425 ms
Getting around the OpenGL performance target.
Pull Request: https://projects.blender.org/blender/blender/pulls/136259
`WM_gizmomap_group_find` can return null when removing ruler annotation
layer when current tool is not "Ruler" tool, this causes
`ruler_item_remove` to crash. This fix made it only remove ruler items
when `gzgroup` is not null (which is the same logic in
`view3d_ruler_remove_invoke`).
Pull Request: https://projects.blender.org/blender/blender/pulls/136416
Previously, including `BLI_strict_flags.h` caused compile errors for all
shadowed values. Generally, this is fine, but sometimes it may catch more cases
than desirable. For example, adding `int U;` in `init_data` in
`MOD_correctivesmooth.cc` causes an error because there is the global `U` symbol
(user prefs).
While not an issue right now, this can cause unexpected compile errors when
adding additional includes. I ran into this while working on a tool that adds
additional includes automatically as part of its operation.
Fortunately, GCC supports a slightly weaker variant of this error:
`-Wshadow=local`. This only covers the case we mainly care about where local
variables are shadowed by other local variables.
Pull Request: https://projects.blender.org/blender/blender/pulls/136389
The newly added Mix node causes the compositor to assert and misbehave.
That's because its has unavailable sockets, and the compositor code base
was not designed to handle unavailable sockets. To this patch fixes that
by handing unavailable sockets everywhere that matters.
Potential fix for legacy AMD driver issue.
- Updating drivers using a clean install has proven to fix the issue as well.
As driver can leave parts of an older driver active what it actually the cau
- Solution comments out the `#line` by replacing the first two characters.
Pull Request: https://projects.blender.org/blender/blender/pulls/136231
Clicking the drop-down button for a Menu-type socket in geometry
modifier panel crashes with ASAN error.
Resolve by skipping the check for ID properties & assert the property
is an RNA property.
`UI_OT_button_string_clear` clears the redo panel in `wm_operator_finished`.
hud_status is set to CLEAR due to undo flag on above the internal operator.
To fix the redo panel from closing, undo flag from the operator could be
removed. Alternative is, skip internal operators from closing the redo
panel with extra check `if (op->type->flag & OPTYPE_INTERNAL) {return;}`
Ref: !135727
When using vertex parenting, an option for using the parent object
final evaluated indices is exposed in the Object Properties: Relations
panel. This allows the calculation of the parent vertex position to
ignore the the CD_ORIGINDEX layer and instead use the final indices
that may have been altered by the node tree evaluation.
The indices that will be used for the vertex parenting are also exposed
to the UI in the same panel, allowing them to be altered after the
vertex parent has been created.
While object names in Blender are already unique, the names themselves
may be "unsafe" for use in the various file formats. During processing
we make the names "safe". However, we did not guarantee that these new
safe names were themselves unique wrt each other. Consider object names
"Test 1" and "Test-1" which both become "Test_1" after being made safe.
These will collide during export; only 1 object would be exported and
it's undefined which object's data would "win".
To rectify this we add another name map to the hierarchy iterator which
is then used to handle collisions as they happen. The map is per-
hierarchy meaning that a name can appear more than once as long as its
under a different hierarchy. E.g.
- `/root/A/X` and another `/root/B/X` is OK
- `/root/A/X` and another `/root/A/X` is NOT OK
Pull Request: https://projects.blender.org/blender/blender/pulls/135418
This improves the situations where the shading normal is far from the
best shadow bias direction. This is particularly noticeable on low poly
meshes with smooth normals.
This patch fixes the issue by storing a quantized version of the
geometric normal in the Gbuffer.
Only 6 bits are used (each axis uses 2 bits). This is stored inside the
gbuffer header since it is always available and has some spare bits to
store this data.
This quantization is only done if the error introduced by using the
shading normal is higher than using the quantized normal. This means
that flat shaded surfaces will not have any quantization artifact.
For smooth shaded surfaces, the quantization is only effective if the
shading normal is quite different (greater than ~20° difference)
than the geometric normal.
The attached blendfile contains an example Material that shows
how the quantization is done. This was used to find the threshold
value with the least amount of error.
To compensate the quantization error, we increase the normal bias by
~20% which is subpixel if the shadow texel density is high enough.
This also changes the forward shading pipeline to use the geometric
normal for bias.
The first Light closure normal is now used for the attenuation function
since this is the most representative of the final shading. This normal
being inverted for transmission closures, we have to negate the normal
in the attenuation computation.
Pull Request: https://projects.blender.org/blender/blender/pulls/136136
This was caused by the select_id not being flushed to
the armature object.
This is because the selection code uses `FOREACH_OBJECT_IN_MODE_BEGIN`
to iterate over the objects. This doesn't call the depsgraph
which would, in normal circumstances, flush the select_id value
to the evaluated object.
Also fix#136141
Pull Request: https://projects.blender.org/blender/blender/pulls/136320