Commit Graph

106617 Commits

Author SHA1 Message Date
Raul Fernandez
324ff4ddef macOS: Remove unnecessary checks now that minimum version is macOS 11.2
MacOS minimum version is now 11.2 we no longer need to check for lower API versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/118388
2024-02-16 19:03:23 +01:00
Hans Goudey
f909e279e7 Fix #118360: Fill mask operator doesn't initialize hidden vertices
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.
2024-02-16 12:54:27 -05:00
Philipp Oeser
2f1b9432be Fix #106999: Converting curves to particle system can lead to crash
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
2024-02-16 18:25:43 +01:00
Harley Acheson
f573a3bad3 Fix: Crash When Dragging Other Object Types into Bone Collection List
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
2024-02-16 18:20:37 +01:00
Richard Antalik
a2c839e71c Fix #118190: Tool shortcut does not show in tooltip
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
2024-02-16 18:05:23 +01:00
Pratik Borhade
5ba104ac46 Fix #114962: Tree view: Crash during tooltip creation
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
2024-02-16 17:39:21 +01:00
Philipp Oeser
745d2e18dc Fix #107228: AttributeGroup.new crash when layer cannot be created
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
2024-02-16 15:36:31 +01:00
Bastien Montagne
88ba4dfaa3 Fix #118299: Crash in some cases with invalid/deprecated LibOverride data.
`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.
2024-02-16 15:08:39 +01:00
Philipp Oeser
1a2edde400 Fix #118225 possible crash double clicking on certain anim channels
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
2024-02-16 12:28:13 +01:00
Christoph Lendenfeld
10682abc56 Fix: Proportional editing indicator in the Dope Sheet not respecting NLA offsets
The issue was that the center of the transformation wasn't
mapped to the NLA offset.
Fix it by calling the function `BKE_nla_tweakedit_remap`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118205
2024-02-16 10:55:47 +01:00
Omar Emara
1cae3d60e6 Fix #118344: Crash when File Output node has no input
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.
2024-02-16 10:51:36 +02:00
Jesse Yurkovich
c8f2a5cc42 UI: Fix FILE_PT_operator drawing when using UI layout panels
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
2024-02-16 08:40:32 +01:00
Jesse Yurkovich
9e8bbc1129 Fix: USD hooks leak
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
2024-02-16 01:53:33 +01:00
Bastien Montagne
401a2397db Fix mistake in fix for #108407 (crash on deleting shapekeys).
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.
2024-02-15 18:25:50 +01:00
Sebastian Parborg
86522d9ab1 Fix #118276: IDs were remapped by mistake when copying in the VSE
All IDs in the current bmain were remapped while it should have only
been done for IDs in the dummy scene created for the copy operation.
2024-02-15 18:06:54 +01:00
Miguel Pozo
91b727028a EEVEE: Remove Thickness output 2024-02-15 17:57:20 +01:00
Christoph Lendenfeld
0c560fb7ef Fix #112395: Proportional editing indicator in Graph Editor and Dope Sheet
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
2024-02-15 16:50:34 +01:00
Sean Kim
a2f49b05f8 Sculpt: Disable set pivot and select color for invisible objects
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 |
| --- | --- |
| ![invisible_set_pivot.gif](/attachments/0dd23857-abdf-4214-a08d-ce986f15e16f) | ![invisible_set_color.gif](/attachments/84950810-1c3d-4f02-8e84-67425d80754d) |

### 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
2024-02-15 16:30:31 +01:00
Sean Kim
1e3e5c5ac2 Sculpt: Disable face set operators on invisible objects
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 |
| --- | --- | --- |
| ![fs_init.gif](/attachments/f44e96ab-e1c9-4279-9f69-80ea9503c830) | ![fs_create.gif](/attachments/3992b8fc-bd59-4aee-a2f6-6d7aa507f0b9) | ![fs_edit.gif](/attachments/78a7c447-8fd8-41dc-846a-5617751e5594) |

| Randomize Colors | Visibility | Gestures |
| --- | --- | --- |
| ![fs_color.gif](/attachments/43230f6b-4a39-4417-ac90-b94e3f33e724) | ![fs_hide.gif](/attachments/fe6fcdac-eda9-4f55-b013-f132f373fe65) | ![fs_gesture.gif](/attachments/5f36d7ed-c5bf-4154-af9e-0f19fb24249c) |
### 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
2024-02-15 16:29:08 +01:00
Sean Kim
fca979e237 Sculpt: Disable modal filter operators on invisible objects
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 |
| ---- | --- |
| ![invisible_filter_mesh.gif](/attachments/87d2dfe2-be27-40bf-bb58-e9aa761a3f0a) | ![invisible_filter_color.gif](/attachments/ac51584e-bd87-4392-9bda-6ad5191cf38f) |

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118172
2024-02-15 16:26:38 +01:00
Sean Kim
d76c1e30e7 Sculpt: Disable mask operators on invisible objects
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 |
| ---- | --- | --- | --- |
| ![](/attachments/fc2ea68e-0af9-4887-b1a3-b2aa2eacaf21) | ![](attachments/3e94f48c-b463-417c-9ad9-bdc74e24bd70) | ![](/attachments/16029e7c-d973-483e-8c4a-164133d0fe11) | ![](/attachments/b356a248-354b-4c68-bf5b-c49907edcaff)

### 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
2024-02-15 16:24:39 +01:00
Jacques Lucke
590e4652b6 Fix #118211: clarify use cases of layout panels in api docs
We could support layout panels in sublayouts like boxes eventually,
but for now this is out of scope.
2024-02-15 11:21:11 +01:00
Jeroen Bakker
f72fdcf4ae GPU: Validate All Statically Defined Shaders As Argument
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
2024-02-15 08:13:44 +01:00
Hans Goudey
f1cb2fa74b Fix: Crash with logging after recent std::string cleanup
The macro tried to free the string.
2024-02-14 21:04:15 -05:00
Campbell Barton
e8baa8a505 Fix #113395: Invalid selection history after solidify
Clear the selection history since the previously selected
faces are de-selected.
2024-02-15 12:48:09 +11:00
Campbell Barton
7848533395 Fix memory leak in anim.view_curve_in_graph_editor, restore the context
Ensure the selection is freed by the operator, also restore the
windowing context after setting temporary values.
2024-02-15 10:57:21 +11:00
Iliya Katueshenock
85b93772db Fix #118104: Menu Switch shows menu socket in input link-drag-search
The node currently doesn't support outputting the menu socket type.

Pull Request: https://projects.blender.org/blender/blender/pulls/118110
2024-02-14 16:49:07 +01:00
Pratik Borhade
f344823785 UI: Opus files not included in sound files filter
Include `.opus` extension in audio filter list

Fixes #118235

Pull Request: https://projects.blender.org/blender/blender/pulls/118238
2024-02-14 11:39:11 +01:00
Pratik Borhade
18912561b5 Fix #118163: Crash hiding face sets with multires
Caused by ce4ec6d42b
Crash occurs due to accessing `corner_tri_faces` when pbvh tpye is
"grid".
Fix is same as 72d324bd81

Pull Request: https://projects.blender.org/blender/blender/pulls/118183
2024-02-14 11:37:11 +01:00
Campbell Barton
5a86067ff0 Fix build error from duplicate include 2024-02-14 14:27:58 +11:00
Germano Cavalcante
c6e229d3e4 Fix #118221: Snap to Edge with Constraint Plane shifts out of plane
The intersection needs to be calculated with the plane passing through
the snap pivot.
2024-02-13 20:35:08 -03:00
Omar Emara
0c9df3d470 Fix: Image does not update when file path changes
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
2024-02-13 13:31:49 +01:00
Bastien Montagne
711e4cdd94 Fix #118055: libOverride resync() RNA call crashes when view_layer is not specified.
Underlying `lib_override_library_resync` code lost the optional aspect
of its `view_layer` parameter at some point, trivial to restore it
luckily.
2024-02-13 12:48:50 +01:00
Bastien Montagne
d38824bc02 Fix #108407: Crash on deleting shape key from Blender File view.
`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.
2024-02-13 12:34:09 +01:00
Christoph Lendenfeld
7fddad529e Fix: keyframe values with additive NLA stack
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
2024-02-13 11:10:18 +01:00
Campbell Barton
0053de6556 Fix buffer overflow passing a vertical segment to convexhull_2d
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.
2024-02-13 16:42:39 +11:00
Harley Acheson
d45175c919 UI: Fix Indentation Issue in Asset Browser
Remove extra indentation for non-collapsible icons that have ICON_NONE,
not needed since #117654

Pull Request: https://projects.blender.org/blender/blender/pulls/118159
2024-02-12 21:16:28 +01:00
Julian Eisel
d54a1b0364 Fix asset indexer string shortening breaking UTF-8 strings
Would shorten the string without ensuring the string isn't shortened in
the middle of a multi-byte UTF-8 character.
2024-02-12 19:25:20 +01:00
Miguel Pozo
1323b9912c Cleanup: Remove outdated comment
gl_InvocationID is always available now.
2024-02-12 18:34:54 +01:00
Miguel Pozo
7821cf068c Fix: Workbench: Shadows
Broken shadows after c0c3565714
GPU_ARB_gpu_shader5 is never defined,
since gl_InvocationID is always available.
2024-02-12 18:34:12 +01:00
Michael Kowalski
5dd48265bb USD: Fix duplicate shader nodes on import
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
2024-02-12 16:42:26 +01:00
Omar Emara
50d7f5a30f Fix #118096: Compositor Displace node produce NaN pixels
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.
2024-02-12 16:58:23 +02:00
Sean Kim
a2d96b0879 Sculpt: Disable sculpt sample detail size on invisible objects
Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118075
2024-02-12 12:27:53 +01:00
Sean Kim
ca6b75b106 Sculpt: Disable sculpt trim operators on invisible objects
Disables trim lasso and box gesture operators and the following
tools when attempting to operate on invisible objects:
* Lasso Trim
* Box Trim

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118072
2024-02-12 12:27:05 +01:00
Sean Kim
be4a8e5a48 Sculpt: Disable sculpt expand operator on invisible objects
Affects:
* Expand Mask by Topology
* Expand Mask by Normals
* Expand Face Set by Topology
* Expand Active Face Set

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118070
2024-02-12 12:25:36 +01:00
Bastien Montagne
9b5f01d00e I18N/UI Messages fixes. 2024-02-12 12:01:02 +01:00
Campbell Barton
835651cfdd Fix cross_poly_v2 returning a negated value, add tests
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.
2024-02-11 17:16:17 +11:00
Harley Acheson
55882e1fb0 Fix #118061: Tooltip Length Calculation Clipped for Enums
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
2024-02-09 21:22:03 +01:00
Hans Goudey
d1d3d998ea Fix: LibOverride: Memory leak after recent std::string conversion
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
2024-02-09 19:29:03 +01:00
Hans Goudey
93e72912e1 Fix #118014: Sculpt: Some brushes don't work with dyntopo
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.
2024-02-09 11:37:40 -05:00