The intend in the report was to rename a linked object in the NLA
channels. The operator to rename actually does everything right, it
detects that the object is linked and passes through to other operators.
The crash then happens in the attempt to select keyframes of channels
(also doubleclick n the keymap) -- in `select_anim_channel_keys`.
The problem is that `bAnimListElem` `key_data` cannot be expected to be
an `FCurve` in all cases. Code does though, it always casts, but this is
unreliable, basically this would fail for all of the "summary" channels
or any channel type (e.g. mask layers etc.), either it is NULL or
garbage data.
So to resolve, we just check the `bAnimListElem` type -- if it is not
ALE_FCURVE we can early out (preventing the crash).
NOTE: this changes behavior of double clicking on a summary channel that
cannot be renamed slightly in that it will not deselect its keys anymore
(it was not selecting any keys anyways, this is actually more in line of
what would happen if you just select another channel -- this also leaves
key selection alone -- so this is actually an improvement as well imho)
Pull Request: https://projects.blender.org/blender/blender/pulls/118251
The File Output node crashes if it has no image input. That's because we
would be attempting to save a zero sized image. So ensure that the node
has a non zero canvas before saving anything.
The `FILE_PT_operator` panel used in the file browser does not correctly
allow the new UI layout panels to be drawn correctly.
The layout panels depend on drawing the background so that different
colors can denote each panel section. In the case of `FILE_PT_operator`,
this background drawing is skipped entirely leading to a situation where
there's no panel delineation at all.
Forcing the background to be drawn leads to a second problem where
the "typical" panel colors are not used in this part of the file
browser. We need to match the surrounding area otherwise a much
lighter shade of gray will be used and look out of place.
The fix is to extend the processing for PANEL_TYPE_NO_HEADER to account
for both of the above situations.
Pull Request: https://projects.blender.org/blender/blender/pulls/118231
If hooks are not unregistered Blender will report a leak on exit.
Store the hooks as unique_ptrs to remove manual memory management and
encapsulate the previous global list inside a function. These changes
ensure that everything is cleaned up on termination.
Also makes a small change to the hook documentation for a missing
`import` statement.
Pull Request: https://projects.blender.org/blender/blender/pulls/118294
Own d38824bc02 mistakenly added the 'FILTER_ID_KE' to the list IDTypes
usable by Lights (`ID_LA`) instead of Lattices (`ID_LT`)...
Note that this did not cause any additional issue, but only missed part
of the expected fix.
When using proportional editing in the Graph Editor or the Dope Sheet,
the GUI displays a circle suggesting that the influence is limited in x and y.
In reality those editors only look at the x-axis to determine which keys to influence.
This PR fixes that by adding a new drawing function for those editors that
draws 2 lines to indicate a range.
In theory this can be a feature in other 2D editors in the future.
I assume the VSE would benefit from this as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118196
This PR disables the `SCULPT_OT_sample_color` and `SCULPT_OT_set_pivot_position` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Set Pivot
* Sample Color
| Set Pivot | Sample Color |
| --- | --- |
|  |  |
### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.
Addresses part of #112371
Pull Request: https://projects.blender.org/blender/blender/pulls/118306
This PR disables the `SCULPT_OT_face_sets_init`, `SCULPT_OT_face_sets_create`, `SCULPT_OT_face_sets_edit`, `SCULPT_OT_face_sets_randomize_colors`, `SCULPT_OT_face_set_change_visibility`, `SCULPT_OT_face_set_box_gesture`, and `SCULPT_OT_face_set_lasso_gesture` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Face Set From Masked
* Face Set from Visible
* Face Set from Edit Mode Selection
* Initialize Face Sets
* Grow Face Set
* Shrink Face Set
* Randomize Colors
* Toggle Visibility
* Hide Active Face SEt
* Box Face Set
* Lasso Face Set
| Init | Create | Edit |
| --- | --- | --- |
|  |  |  |
| Randomize Colors | Visibility | Gestures |
| --- | --- | --- |
|  |  |  |
### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.
Addresses part of #112371
Pull Request: https://projects.blender.org/blender/blender/pulls/118228
This PR disables the `SCULPT_OT_mesh_filter`, `SCULPT_OT_cloth_filter`, and `SCULPT_OT_color_filter` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Mesh Filter
* Color FIlter
* Cloth Filter
| Mesh & Cloth | Color |
| ---- | --- |
|  |  |
Addresses part of #112371
Pull Request: https://projects.blender.org/blender/blender/pulls/118172
This PR disables the `SCULPT_OT_mask_init`, `SCULPT_OT_mask_filter`, `SCULPT_OT_mask_by_color`, and `SCULPT_OT_mask_from_cavity` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Random Mesh
* Per Vertex
* Per Face Set
* Per Loose Part
* Smooth Mask
* Sharpen Mask
* Grow Mask
* Shrink Mask
* Increase Contrast
* Decrease Contrast
* Mask By Color
* Mask From Cavity
| Init | Filter | By Color | From Cavity |
| ---- | --- | --- | --- |
|  |  |  | 
### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.
Addresses part of #112371
Pull Request: https://projects.blender.org/blender/blender/pulls/118173
This PR adds a new command line argument to validate all statically
defined shaders. It is useful for platform support to understand
what isn't working.
It only checks statically defined shaders. Dynamic shaders (EEVEE/Compositor)
can still be fail.
The report is printed to console. After checking with windows platform and
triaging we could also add it to gpu debug script. There is a risk of adding it there
as it might crash and don't store any output.
Pull Request: https://projects.blender.org/blender/blender/pulls/117326
Images do not update in the compositor and other places when their file
path changes or their generated options change. This is because the
compositor relies on depsgraph updates, which weren't tagged in this
case. Fix this by tagging appropriately in RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/118187
`BKE_library_id_can_use_filter_id` was missing the ShapeKey type for
geometry IDs (meshes, legacy curves, and lattices), leading to the
remapping code to fail to do its job when deleting the ShapeKey only.
The new keyframing functions introduced in #113504
didn't call the functions to decompose the NLA stack.
In practice this meant that when inserting keys into strip
that is under an additive strip, it would take the result of the additive Strip and
bake it back into the base. This would double the transform.
The fix is to call `BKE_animsys_nla_remap_keyframe_values`.
Unfortunately to do so, I had to pass through a few more
arguments to the keyframing functions.
Also adds unit tests to cover the caused bug.
Pull Request: https://projects.blender.org/blender/blender/pulls/118053
Convex hull calculation would "cap" line segments with the first point.
Besides causing a buffer overflow when passing in two points,
it's not needed as matching first/last ends aren't expected
to be set by this function.
Fixed duplicate nodes when converting texture scale/bias and
channel names on material import. This required extending
the node caching to handle cases where a USD shader is converted
to multiple Blender nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/118002
The GPU compositor Displace node produces NaN pixels if connected to the
Image node. That's because the Displace node access the MIP levels of
the texture produces by the Image node, but those levels were never
initialized, so fix this by completing the levels.
The result of cross_poly_v2 was flipped compared with cross_tri_v2 &
cross_poly_v3 (with the Z values zeroed).
Ensure cross_poly_v2/3, cross_tri_v2/3 return compatible results and
updating the doc-strings noting that a negative Z is for clock-wise
polygons.
When calculating the width of strings for the tooltip window size, enum
labels were measured using the string from the text_suffix field but
length from the text field. Introduced with std::string changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/118064
An allocated char pointer was reassigned without being freed.
Fix by replacing the error-prone combination of C strings and
std::string with a complete conversion to std::string. Also change
the logic a bit to allow moving the path string in some cases
instead of copying it.
Pull Request: https://projects.blender.org/blender/blender/pulls/118046
After bb080140c0, `SCULPT_pbvh_calc_area_normal` returned
std::nullopt when it didn't sample any vertices, instead of returning
an ignorable boolean return value. There was a false negative failure
though, because it didn't keep track of when it sampled BMesh "orco"
vertices.
When reordering vertex groups on a mesh, some cloth properties would
get affected by another group, because they were based on group index
instead of name.
This issue was already handled by
`BKE_object_defgroup_remap_update_users()` for some properties, but
not all.
This commit extends the function for missing properties: Shrinking,
Shear, Internal Springs, Pressure, Self Colllisions and Object
Collisions.
Pull Request: https://projects.blender.org/blender/blender/pulls/114032
The Inpaint node crashes for large images. That's because the output
buffer was only allocated for a single chunk. So allocate the entire
output buffer in the tile initialization step.
Caused by #113504
While basic cycle aware keying works, there is a special case
when inserting the first key. In that case, after the key has been inserted,
it is duplicated and moved around so the FCurve range from
first to last key is exactly the range of the action.
It also auto-creates the Cycle modifier on the FCurve .
Fix the issue by calling the function that does the key duplication
and cover with unit tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/116943
This means the array can be shared between geometries when unchanged,
reducing memory usage and increasing performance. It also means that
handling the data can be done more generically using the attribute
system. In the future the transforms can become attributes too.
Two other changes are related here:
- The "almost unique ids" are cached with a shared cache so they
are shared too.
- The reference indices are baked as an attribute now, making the process
more generic and potentially easier to optimize in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/117951