Commit Graph

113061 Commits

Author SHA1 Message Date
Hans Goudey
d793d18413 BLI: Add functions to IndexRange to mirror Span
Adds functions for special cases of slicing and an `is_empty` method.
2022-03-03 11:14:44 -05:00
Falk David
e8dc82311d Fix T96145: GPencil eval data not updated correctly
When removing a modifier, changing the layer transform or updating
 the parent of a grease pencil object that has a multi-user datablock
 and animation data, the eval data is not updated properly (after a
 frame change). This can also cause memory leaks.

 The fix makes sure that we free and reset any runtime copy
 (`ob->runtime.gpd_eval`) in `BKE_gpencil_prepare_eval_data`.

 Note: As far as we can tell, `ob->runtime.gpd_orig` is unused and could
 be removed. The assignment in `BKE_gpencil_prepare_eval_data`
 seemed to be unnecessary.

Co-authored-by: @yann-lty

Reviewed By: antoniov

Maniphest Tasks: T96145

Differential Revision: https://developer.blender.org/D14236
2022-03-03 16:01:23 +01:00
Julian Eisel
6e487228a5 File Browser UI: Allow dragging anywhere in a file preview tile to drag
Previously you'd have to be careful to drag the image itself. Dragging
anywhere else on the tile (e.g. between the preview and the text, or the
text itself) would trigger border select. This often conflicts with user
expectations and causes frustration when trying to work quick, I've seen
many people complain about this.

Note that the "hitbox" for dragging is a bit smaller than the tile, to
not make border select by dragging from in-between the tiles too hard.

Differential Revision: https://developer.blender.org/D14228
2022-03-03 15:17:23 +01:00
Julian Eisel
544bd0c353 Cleanup: Remove redundant drag image size parameters
Just use the image-buffer size and the already provided scale to
determine the size, not the button size (which would always have to
match the scaled image-buffer size or it would give unexpected results).
2022-03-03 15:04:45 +01:00
Bastien Montagne
1b863041c9 i18n: Fix more potential contextual issues with "Back" UI label.
Add 'ID_ACTION' context to some animation curve interpolation enums.

Related to T95506/T43295.
2022-03-03 14:52:45 +01:00
Brecht Van Lommel
0f77933031 Merge branch 'blender-v3.1-release' 2022-03-03 13:49:08 +01:00
Brecht Van Lommel
9c2e385509 Fix Cycles hang in classroom scene with upcomping AMD driver version 22.10
This is a workaround until there is a fix in the HIP compiler or driver.

Differential Revision: https://developer.blender.org/D14232
2022-03-03 13:42:58 +01:00
Siddhartha Jejurkar
ffaaa0bcbf UV: Edge selection support
This patch adds edge selection support for UV editing (refer T76545).
Developed as a part of GSoC 2021 project - UV Editor Improvements.

Previously, selections in the UV editor always flushed down to vertices
and this caused multiple issues such as T76343, T78757 and T26676.
This patch fixes that by adding edge selection support for all UV
operators and adding support for flushing selections between vertices
and edges. Updating UV select modes is now done using a separate
operator, which also handles select mode flushing and undo for UV
select modes. Drawing edges (in UV edge mode) is also updated to match
the edit-mesh display in the 3D viewport.

Notes on technical changes made with this patch:
* MLOOPUV_EDGESEL flag is restored (was removed in rB9fa29fe7652a).
* Support for flushing selection between vertices and edges.
* Restored the BMLoopUV.select_edge boolean in the Python API.
* New operator to update UV select modes and flushing.
* UV select mode is now part of editmesh undo.

TODOs added with this patch:
* Edge support for shortest path operator (currently uses vertex path logic).
* Change default theme color instead of reducing contrast with edge-select.
* Proper UV element selections for Reveal Hidden operator.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12028
2022-03-03 17:59:09 +05:30
Julian Eisel
76879e3702 Outliner: Display respective data-block icon in library overrides mode
Just showing the library override icon for every item doesn't add much
information, it's just redundant. Displaying the data-block type icon on
the other hand can be useful.

Differential Revision: https://developer.blender.org/D14208
2022-03-03 13:18:23 +01:00
Julian Eisel
9b12889a1a Fix T96140: Crash on color button drag & drop
Use-after-free in context store, which wasn't cleared correctly after
setting and querying.
2022-03-03 12:51:44 +01:00
Antonio Vazquez
2d24ba0210 VSE: Allow to create scene in strip properties
This patch adds a button in the scene to add a new one, but this does not change to the new created scene because this breaks the storyboarding workflow.

This is a common request for Storyboarding artists.

Reviewed By: mendio, brecht, ISS

Differential Revision: https://developer.blender.org/D14148
2022-03-03 12:37:48 +01:00
Campbell Barton
ce0d4ea41c Merge branch 'blender-v3.1-release' 2022-03-03 20:47:07 +11:00
Campbell Barton
d961adb866 Fix T96135: Mesh coordinates are set to the last edited shape-key
When exiting edit-mode set the vertex coordinates to the basis-shape when editing non-basis keys.

Regression in bfdbc78466ac14d45f353db9aa39cb21bb962701.

Reviewed By: sergey

Ref D14234
2022-03-03 20:42:30 +11:00
Campbell Barton
d66b047ca3 WM: use pass-through for cursor placement operator
This is needed since 4d0f846b936c9101ecb76a6db962aac2d74a460a
however change in the operator instead of the event handler is correct,
as accepting a press event should suppress drag events unless
the pass-through flag is set.

This is how select & tweak already works.
2022-03-03 20:35:14 +11:00
Bastien Montagne
ec09ded792 Fix missing i18n context variable in UI py script.
Mistake in own rBdb3f5ae48ac, thanks to Ethan-Hall (@Ethan1080) for the
heads up.
2022-03-03 08:57:06 +01:00
Campbell Barton
a8df292264 Cleanup: comments in wm_event_system.c 2022-03-03 16:45:40 +11:00
Campbell Barton
4d0f846b93 Event System: use more thoroughly tested logic for click-drag events
No functional changes, largely restoring old logic & removing the need
for workarounds.

Reverts:
- 13b6cec039681db40e677463aa9fdff6d55896aa.
- aa71414dfca7f301e101cce3e72551e7529290ea (partially).
2022-03-03 16:07:18 +11:00
Campbell Barton
9d529407da UI: only wrap cursor motion horizontally when dragging markers
It's not useful to wrap vertical motion when dragging markers.
It was too easy to accidentally wrap the cursor to the top of a region,
as markers need to be dragged from the bottom edge of the region.
2022-03-03 15:48:41 +11:00
Campbell Barton
d764448f73 Cleanup: use doxygen sections for anim_markers.c 2022-03-03 15:46:26 +11:00
Campbell Barton
08da699faa Cleanup: rename misleading variable for marker selection cycling
"marker_selected" was the marker after the selected marker
and is used for cycling the selection.
2022-03-03 15:46:15 +11:00
Campbell Barton
61c288cee5 Fix timeline marker click-drag arbitrary deselection
The logic to cycle selected markers wasn't cycling back to the beginning
of the list.

The marker after the selected marker at the cursor frame was also used
to check if a selection existed, causing dragging to transform all
selected markers to de-select all when when dragging the last marker.
2022-03-03 15:25:02 +11:00
Campbell Barton
ef431a8705 Cleanup: remove references to key-map modifier values denoting order
This feature was never exposed to users.
2022-03-03 13:57:44 +11:00
Hans Goudey
3c175caaa3 Cleanup: Rename set handle type node internally to match UI
I've had trouble finding this node a few times now,
it's simpler if the file name matches the name in the UI.
2022-03-02 17:58:17 -05:00
Hans Goudey
ddf956fb58 Curves: Port set resolution node to the new data-block
The node unnecessarily converted to the old data structure to check if
there were any poly splines. Instead, that warning is just removed,
because the node now still sets resolution values in that case, they
just aren't used (before the values weren't set at all). Either way, it
wasn't clear that looping though all of the curve types was worth
the performance cost here.
2022-03-02 17:50:25 -05:00
Hans Goudey
2600806c2e Fix: BLI math clamp doesn't work
Return type was wrong, output of std::clamp wasn't used.
2022-03-02 17:09:17 -05:00
Richard Antalik
ecba8c1243 Fix mistake in seeking cleanup
In `ffmpeg_read_video_frame` fix assignment used as truth value.
In `ffmpeg_seek_recover_stream_position` loop while return value is
greater or equal to 0.
2022-03-02 22:25:43 +01:00
Julian Eisel
f531dff9b3 Cleanup: Use rectangle for file browser tile drawing
Passing around coordinates for drawing can be quite confusing, it's
often not clear what they represent and where they are currently.
Instead pass around the tile rectangle for drawing and let all code draw
based on that, it's way more clear that way.

Changes shouldn't be user visible.
2022-03-02 19:25:18 +01:00
Nikhil Shringarpurey
721b705499 UI: Comments Misspellings of Vertex/Vertices
Correct misspellings in code comments of "vertex" and "vertices".

See D13932 for more details.

Differential Revision: https://developer.blender.org/D13932

Reviewed by Harley Acheson
2022-03-02 10:05:15 -08:00
Antonio Vazquez
ca0b728529 Fix T96101: "Remove" button failure on Grease Pencil layer's relation to bone
As the channel was not found, the relation data was not updated.

Now, if the bone is removed, the relation is set.
2022-03-02 17:48:35 +01:00
Thomas Dinges
34267a868a Merge branch 'blender-v3.1-release'
and resolve merge error (version string).
2022-03-02 17:35:09 +01:00
Jacques Lucke
9789a6c6d9 Search: take word order into account in string search
Differential Revision: https://developer.blender.org/D14223
2022-03-02 17:25:39 +01:00
Thomas Dinges
8506f3d9fe Blender 3.1 bcon4 - change release cycle to release candidate
This is still a rolling release candidate with new builds every day
as a preparation to the final release.
2022-03-02 17:17:38 +01:00
Jacques Lucke
ac45540a34 Curves: add brush to add curves on surface
This adds a prototype for the first brush that can add new curves by
painting on a surface. Note that this can only be used when the curves
object has a surface object set in the properties panel.

The brush can take minimum distance into account. This allows
distributing curves with a somewhat consistent density.

Differential Revision: https://developer.blender.org/D14207
2022-03-02 17:15:44 +01:00
Jacques Lucke
037e1ad140 Merge branch 'blender-v3.1-release' 2022-03-02 17:13:57 +01:00
Jacques Lucke
2fb31f34af Fix T95692: incorrect interpolated children particle hair
Differential Revision: https://developer.blender.org/D14227
2022-03-02 17:12:56 +01:00
Hans Goudey
d86f80f42a Merge branch 'blender-v3.1-release' 2022-03-02 10:55:21 -05:00
Hans Goudey
216a215ba5 Fix T93573: Remove outline from instances in edit mode
This commit removes the outline from instances generated from an object
when in edit mode. This takes the change in aa13c4b386b1 a bit further,
with the idea that instance outlines are more like regular outlines.

Because evaluated object data that doesn't match the original object
type is treated as an instance internally, this fixes the way evaluated
meshes for curves objects have an outline, for example.

See the differential revision for a visual comparison.

Differential Revision: https://developer.blender.org/D14226
2022-03-02 10:49:48 -05:00
Jacques Lucke
7935d3668a Fix T95479: geometry nodes crash with cage display
Differential Revision: https://developer.blender.org/D14225
2022-03-02 16:10:42 +01:00
Ethan Hall
1e1d1f15e8 UI: Enable the outliner to use the correct icon for each curve subtype
This patch enables enables the outliner to use the correct icon for each
of the curve subtypes (Curve/Surface/Font).

Differential Revision: https://developer.blender.org/D14093

Reviewed by: Julian Eisel
2022-03-02 15:52:17 +01:00
Campbell Barton
13b6cec039 Fix/Workaround T96120: Crash dropping from the file browser
Since removal of tweak events 4986f718482b061082936f1f6aa13929741093a2,
box-select is activating while dragging files.

As far as I can tell this used to work because of differences
int the order tweak / click-drag events are handled.

Apply a workaround since dragging files doesn't prevent other parts
of the UI from activated (it's possible to open menus for e.g),
this is something we will likely want to limit which would resolve
this bug too.
2022-03-03 01:36:14 +11:00
Kévin Dietrich
3a0df7d37b Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-03-02 15:22:19 +01:00
Kévin Dietrich
6883c47bb5 Fix T94729: GPU subdivision does not support meshes without polygons
There are two issues revealed in the bug report:
- the GPU subdivision does not support meshes with only loose geometry
- the loose geometry is not subdivided

For the first case, checks are added to ensure we still fill the
buffers with loose geometry even if no polygons are present.

For the second case, this adds
`BKE_subdiv_mesh_interpolate_position_on_edge` which encapsulates the
loose vertex interpolation mechanism previously found in
`subdiv_mesh_vertex_of_loose_edge`.

The subdivided loose geometry is stored in a new specific data structure
`DRWSubdivLooseGeom` so as to not pollute `MeshExtractLooseGeom`. These
structures store the corresponding coarse element data, which will be
used for filling GPU buffers appropriately.

Differential Revision: https://developer.blender.org/D14171
2022-03-02 15:19:55 +01:00
Campbell Barton
47396ea81e Fix T96123: Crash when click-dragging across the visibility icons
Partially revert aa71414dfca7f301e101cce3e72551e7529290ea

This attempted have the click-drag event compatible with old tweak
events, but needs to be re-thought since it caused events to be handled
in unexpected situations.
2022-03-03 01:11:17 +11:00
Jacques Lucke
4a95c3466f Fix T96085: repeated evaluation of geometry nodes when nothing changed
Differential Revision: https://developer.blender.org/D14216
2022-03-02 14:12:08 +01:00
Jacques Lucke
c23ec04b4e BLI: add scoped-defer utility to add RAII-like behavior to C types
This utility is useful when using C types that own some resource in
a C++ file. It mainly helps in functions that have multiple return
statements, but also simplifies code by moving construction and
destruction closer together.

Differential Revision: https://developer.blender.org/D14215
2022-03-02 12:51:21 +01:00
Campbell Barton
721335553c Add Object Tool: use the drag-start location for initial placement 2022-03-02 22:29:40 +11:00
Henrik Dick
c2e8e68b65 Fix T95963: change thresholds in complex solidify
This fix contains two parts. There was one critical mistake where
order of two indices was wrong when removing constraint planes from
the array. The other changes are improvements to the used thresholds
to keep everything numerically stable.

Differential Revision: http://developer.blender.org/D14183
2022-03-02 12:14:22 +01:00
Campbell Barton
ccf4001458 Fix modal item open/close in the outliner since removing tweak events
Correct check for left-mouse event which assumed the alternative was
a tweak event.

Also remove print added by accident.
2022-03-02 22:04:39 +11:00
Campbell Barton
102644cb8c Fix releasing modifier keys suppressing drag events
Always use event.prev_click_type since this is never set on key-release,
which could still interrupt dragging (box selecting for example).
2022-03-02 21:47:49 +11:00
Campbell Barton
1747269ea5 Cleanup: misleading code from aa71414dfca7f301e101cce3e72551e7529290
This branch was previously run when the action had been handled,
since action checks were removed it was running. This assignment
does nothing but shouldn't be kept.
2022-03-02 21:47:49 +11:00