If there is no mask attribute yet and hidden vertices, the values for those
vertices wouldn't be initialized. Fix by simply initializing the entire array
when it's allocated.
So this happens on curves with only a single point in them.
If these are converted to the old particle system, we would end up with
a particle with only one key (invalid hair), then going to particle
editmode would crash.
The old particle system took care of this (e.g. when deleting keys in
`PARTICLE_OT_delete`)
See the following comment:
`/* We can't have elements with less than two keys. */`
So to resolve, only convert curves with multiple (>1) points in the
process.
Pull Request: https://projects.blender.org/blender/blender/pulls/118392
Dragging any other object type to the Bone Collections List results in
a null dereference. This PR adds check that the drag type is
WM_DRAG_BONE_COLLECTION.
Pull Request: https://projects.blender.org/blender/blender/pulls/118393
fa6384eb39 introduced explicit setting of operator context as argument for
function `ED_region_panels_ex()`. However, this did not work correctly, because
`UiLayout` did not exist when `uiLayoutSetOperatorContext()` was called. This
has to be done in `ed_panel_draw()`.
Another issue is, that panel may be drawn, when mouse is over tool region,
which means, that `sequencer_tools_region_draw()` must look for whether
this is happening in preview or timeline region.
Pull Request: https://projects.blender.org/blender/blender/pulls/118292
Crash when dragging tree-item from one window to other instance of tree
view, with drop_target then nullptr. Returning null in this case lets
the process proceed normally and tooltip display correctly.
Pull Request: https://projects.blender.org/blender/blender/pulls/116892
A layer cannot be created e.g. when creating a reserved-name attributes
with the wrong domain/type.
Caused by 101d04f41f [which just did not
check if the layer creation was successful].
This should go into 3.6 LTS as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118378
`BKE_lib_override_library_validate` used on fileread to ensure all
liboverrides are valid was using direct call to
`BKE_lib_override_library_free`. However, this was lacking the handling
of embedded dependencies (from liboverride PoV), in particular
ShapeKeys.
Since these shapekeys were still tagged as embedded liboverrides,
liboverride code would later assume their owner (mesh etc.) was also a
valid liboverride, leading to various potential issues.
Use instead `BKE_lib_override_library_make_local`, which also ensures
that embedded dependencies are handled properly.
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.