Commit Graph

5117 Commits

Author SHA1 Message Date
Germano Cavalcante
015b7483e7 Fix #136061: Shear and Edge Slide not displaying custom keys in statusbar
Since 40eadc75be, `ED_workspace_status_text` is now called at the
beginning of the modal function.

This clears any custom keymap and redraws the status bar.

The `Edge Slide` and `Shear` operations only update the status bar if a
modal key is pressed (not on mouse move).

The solution to avoid losing custom modal keys, and not having to
update the status bar more often is: call `ED_workspace_status_text`
only when an operation that requires redraw is performed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136101
2025-03-18 12:46:56 +01:00
Germano Cavalcante
94a8b5f607 Revert "Fix #136061: Modeling: Always update status bar on shear/edge slide."
This reverts commit b02c83386b.

The problem has not been fully resolved (there is a glitch in the
status bar when changing operations).

A newer, even more efficient solution is on the way.
2025-03-18 08:42:10 -03:00
YimingWu
b02c83386b Fix #136061: Modeling: Always update status bar on shear/edge slide.
When a input event is handled but `status.opmodal` is not explicitly
requested, `WM_window_modal_keymap_status_draw` will override the status
bar message, then the tool hint would be incorrect. This applies to
shear and edge slide operators. Seemingly introduced by 6d5d3ce. The
fix is to not ignore mouse move event when updating status bar as they
also causes viewport redraw.

Pull Request: https://projects.blender.org/blender/blender/pulls/136063
2025-03-17 14:29:28 +01:00
Campbell Barton
23de65afab Merge branch 'blender-v4.4-release' 2025-03-17 21:44:29 +11:00
Campbell Barton
044b8ab6f0 Fix #136077: Crash transforming in background mode with an active region
Don't attempt to add region draw callbacks in background mode.
This caused by the regions runtime being null.

Even if the runtime was initialized, drawing callbacks aren't needed
in background mode.

Ref !136078
2025-03-17 21:41:34 +11:00
Ramón Klauck
dde6c2bb10 Fix: VSE: Incorrect rotation with mirrored images
When images in the VSE use mirror and then get rotated, they rotate in
the wrong direction.

Multiply rotation by X and Y component of mirror value (-1). This is
the same approach as used by translation.

Co-authored-by: Aradgus <ramonklauck987@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/136004
2025-03-15 02:32:04 +01:00
Campbell Barton
78c3f6a1ee Cleanup: adjust order of terms for BMesh UV map function calls
Order more generic terms first for better ordering, more useful
completion.
2025-03-13 15:23:46 +11:00
John Kiril Swenson
7356e72e1b VSE: Snap to Frame Range, Snap by Default
This patch adds the ability to snap to the frame range bounds in the VSE
timeline, on by default. End frame snap location is offset by 1 to
ensure the snap point aligns with the visible end frame boundary
(otherwise e.g. right handle of strip would be one frame short).

Timeline and preview snapping is also turned on by default using the
same versioning block.

Pull Request: https://projects.blender.org/blender/blender/pulls/135753
2025-03-12 03:36:32 +01:00
Pratik Borhade
4e141d11c5 Cleanup: Grease Pencil: Remove legacy animation drawing code
`ANIMTYPE_GPDATABLOCK` is not used anymore animation editor for channel
drawing. `ANIMTYPE_GPLAYER` is still needed for annotation channels in
dopesheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/135556
2025-03-07 10:32:33 +01:00
Campbell Barton
9b9bddb3fd Merge branch 'blender-v4.4-release' 2025-03-07 20:12:48 +11:00
Campbell Barton
5849d9aec3 Fix crash using transform with grease pencil without an "area" 2025-03-07 20:11:51 +11:00
Falk David
e39c83c881 Merge branch 'blender-v4.4-release' 2025-03-06 21:19:31 +01:00
Hans Goudey
4fd96e61d5 Fix: Missing cache invalidation in grease pencil transform operator 2025-03-06 12:40:46 -05:00
Hans Goudey
395e8796cf Fix: Missing radius change tag in curves radius transform operator 2025-03-06 10:35:36 -05:00
Richard Antalik
68abed543b Refactor: Remove module prefix form symbols in sequnecer namespaces
Remove
SEQ_ prefix for blender::seq namespace and
ED_sequencer for blender::ed::vse namespace

Pull Request: https://projects.blender.org/blender/blender/pulls/135560
2025-03-06 13:04:39 +01:00
Richard Antalik
a08246a1a2 Refactor: Move VSE code to namespaces
This PR creates 2 namespaces for VSE code:
- `blender::seq` for sequencer core code
- `blender::ed::vse` for editor code

These names are chosen to not be in conflict with each other.
No namespace was used for RNA.

Finally, file `BKE_sequencer_offscreen.h` was moved from BKE to sequencer.

Pull Request: https://projects.blender.org/blender/blender/pulls/135500
2025-03-06 06:22:14 +01:00
Bastien Montagne
dd168a35c5 Refactor: Replace MEM_cnew with a type-aware template version of MEM_callocN.
The general idea is to keep the 'old', C-style MEM_callocN signature, and slowly
replace most of its usages with the new, C++-style type-safer template version.

* `MEM_cnew<T>` allocation version is renamed to `MEM_callocN<T>`.
* `MEM_cnew_array<T>` allocation version is renamed to `MEM_calloc_arrayN<T>`.
* `MEM_cnew<T>` duplicate version is renamed to `MEM_dupallocN<T>`.

Similar templates type-safe version of `MEM_mallocN` will be added soon
as well.

Following discussions in !134452.

NOTE: For now static type checking in `MEM_callocN` and related are slightly
different for Windows MSVC. This compiler seems to consider structs using the
`DNA_DEFINE_CXX_METHODS` macro as non-trivial (likely because their default
copy constructors are deleted). So using checks on trivially
constructible/destructible instead on this compiler/system.

Pull Request: https://projects.blender.org/blender/blender/pulls/134771
2025-03-05 16:35:09 +01:00
Hans Goudey
16fff2e49c Cleanup: Transform: Use C++ parallel_for to remove boilerplate
threading::parallel_for implements its own check to avoid
threading when the data length is below the grain size, and
its overhead is lower anyway, since it doesn't use a function
call for every element.

Pull Request: https://projects.blender.org/blender/blender/pulls/135316
2025-03-03 16:16:41 +01:00
Hans Goudey
aafcc5d3b9 Cleanup: Use references, nodiscard, for BMesh partial update 2025-03-01 18:02:30 -05:00
Hans Goudey
64c3fd7b1c Cleanup: Use Vector, BitVector for BMesh partial update struct
Avoid reimplementing amortized growth, and generally make
the code friendlier with the improved BitVector class.
2025-03-01 17:47:55 -05:00
Harley Acheson
46ddd76609 Merge branch 'blender-v4.4-release' 2025-02-28 12:38:10 -08:00
John Kiril Swenson
f874d46589 Fix: UI: Transform Feedback for Invalid Trackball
Patch #132957 added helpful UI feedback when attempting to rotate or
scale an object whose transforms are set to "only affect locations."
But it neglected to check for invalid trackpad rotations that are
affected the same way. This patch renames the original `HLP_ERROR` to
`HLP_ERROR_DASH` to distinguish it from a `HLP_ERROR` transform cursor
with no dashed line present, which matches trackball's normal state.

Pull Request: https://projects.blender.org/blender/blender/pulls/134653
2025-02-28 21:14:36 +01:00
Philipp Oeser
a8ed137e52 Merge branch 'blender-v4.4-release' 2025-02-26 15:38:50 +01:00
Philipp Oeser
bc3c6c4e7c Fix #134895: Cancelling sculpt mode elastic transforms deforms mesh
Since the transform system uses previous positions to update to
"original" positions upon cancel, the elastic transforms are not working
well with this (due to their `TransformDisplacementMode::Incremental`
nature).

To resolve, rely on restoring positions from undo (as done elsewhere in
sculpt).

Pull Request: https://projects.blender.org/blender/blender/pulls/134919
2025-02-26 15:38:29 +01:00
Sybren A. Stüvel
e4c2ddb8e1 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-02-24 16:48:43 +01:00
Hans Goudey
d0a6189b50 Refactor: DRW: Centralize and clean up packed normals conversion
Move the code dealing with converting float3 to GPU normals
out of the vertex format header into a separate header. Use a
proper C++ namespace and remove duplication by only using
the more recently added C++ templated conversions.

Most of the diff comes from the removal of the indirect includes
from GPU_vertex_format.hh. A lot of files ended up mistakenly
depending on that.

Pull Request: https://projects.blender.org/blender/blender/pulls/134873
2025-02-24 16:08:30 +01:00
Pratik Borhade
576d19add7 Fix #134809: Grease Pencil: Proportional edit tweaks locked material strokes
Entire curve points range is passed to transform-container  when
proportional editing is on. Consequence is, strokes from locked
materials are also affected. Use `editable_points` mask to resolve this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134838
2025-02-24 15:17:26 +01:00
Campbell Barton
44d6ff6f8b Merge branch 'blender-v4.4-release' 2025-02-23 22:21:29 +11:00
Campbell Barton
0013db5aef Fix #134948: face orientation depends on pivot type (for a single face)
Technically a regression in [0] since switching the pivot between
the "Median Point" and "Active Element" would previously use the
same orientation with a single face selected.

However the same issue existed when multiple faces were selected so
changing the pivot type can still change the orientation in some
situations.

Restore the previous behavior by removing logic to pick the "best"
tangent when a single face is selected.

[0]: c7104f5392
2025-02-23 22:19:27 +11:00
Dalai Felinto
1584cd9aa5 Cleanup: Rename point cloud to pointcloud / POINT_CLOUD to POINTCLOUD
Though "Point Cloud" written as two words is technically correct and should be used in the UI, as one word it's typically easier to write and parse when reading. We had a mix of both before this patch, so better to unify this as well.

This commit also renames the editor/intern/ files to remove pointcloud_ prefix.
point_cloud was only preserved on the user facing strings:

* is_type_point_cloud
* use_new_point_cloud_type

Pull Request: https://projects.blender.org/blender/blender/pulls/134803
2025-02-19 17:11:08 +01:00
илья _
119fc054f8 Cleanup: BKE: Nodes: Pass-by-reference
Restriction of the nodes api to clearly define never-null function arguments.
Side effects: some assertions and null-check (with early return) were removed.
On the caller side is ensured to never derefer null to pass argument (mainly in RNA).
In addition, one pointer argument now actually a return type.

By-reference return types instead of pointers going to be separate kind of
change since also imply of cleaning up variables created from reference.

Also good future improvement would be to mark a copy-constructor as
explicit for DNA node types.

Pull Request: https://projects.blender.org/blender/blender/pulls/134627
2025-02-19 13:44:11 +01:00
Hans Goudey
b4c9b3e87f Cleanup: Move transform editors module to C++ namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/134701
2025-02-18 01:27:04 +01:00
Richard Antalik
2a44bdfbd0 Refactor: Use C++ types for vectors strip image transform code
All 2D vectors related to image transform code were changed to float2.
Previously, it was decided, that 4x4 matrix should be used for 2D
affine transform, but this is changed to 3x3 now.

Texture painting code did rely on `IMB_transform` with 4x4 matrix.
To avoid large changes, I have added function
`BLI_rctf_transform_calc_m3_pivot_min`.

Main motivation is cleaner code - ease of use of c++ API, and avoiding
returning values by arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/133692
2025-02-17 11:23:00 +01:00
Hans Goudey
cd04584412 Point Cloud: Implement transform operator
This ends up being very simple because point cloud has
no connectivity information and each element is just one
position.

Also implement the 3D transform gizmo.

The geometry deformation system isn't implemented in this
commit. That can be tacked later.
2025-02-16 23:36:04 -05:00
Campbell Barton
640e70b6e8 Cleanup: various non-functional changes for C++ 2025-02-13 13:33:09 +11:00
Richard Antalik
789737c917 Cleanup: Refactor VSE snapping code
- Use new blender::transform namespace, to reduce verbosity
- Move snap_data allocation upstream, and use unified logic:
  No points? Free data.
- Snap points are stored in Vector instead of Array to avoid
  incrementing index.
- Point counting functions are removed. Vector size is not reserved,
  since adding 10K points takes less than 1ms (AMD 5950X)
- Functions are renamed to avoid overly long names and make them as
  distinct as possible.

New function naming scheme is:
`<what is done>_<sources/targets>_<timeline/preview>_<subcategory>`
for example `points_build_sources_timeline_retiming`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134308
2025-02-13 03:17:49 +01:00
Brecht Van Lommel
c7a33a62a2 Cleanup: Directly include DNA_userdef_types.h and BLI_listbase.h
Instead of relying on them being included indirectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/134406
2025-02-12 23:01:08 +01:00
Harley Acheson
90b04b3c5f Merge branch 'blender-v4.4-release' 2025-02-08 11:41:31 -08:00
Harley Acheson
41b1b4f95c Revert 867e9d879a: Status Bar Impossible Confirms & Cancels
As noted in #134241 this modal poll function cannot return false on an
item because there is a conflict in the way the operation is started
versus how it is set to cancel. Doing so also stops the escape key from
canceling the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/134273
2025-02-08 20:40:31 +01:00
Bastien Montagne
87a4c0d3a8 Refactor: Make Library.runtime an allocated pointer.
Move `Library.runtime` to be a pointer, move the related
`LibraryRuntime` struct to `BKE_library.hh`. Similar to e.g.
Mesh.runtime, that pointer is expected to always be valid, and is
allocated at readtime or when creating a new Library ID.

Related smaller changes:
* Write code now uses standard ID writing codepath for Library IDs too.
  * Runtime pointer is reset to nullptr before writing.
* Looking up a library by its absolute path is now handled through a
  dedicated utils, `search_filepath_abs`, instead of using
  `BLI_findstring`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134188
2025-02-07 17:47:16 +01:00
Sietse Brouwer
68c7d93b5f Fix: Grease Pencil: Gizmos in wrong position when layer has transform
In Grease Pencil edit mode, the gizmos for move, rotate, scale etc. were shown in the wrong
position when the layer had a transform. With this fix, the layer transform is taking into
account when calculating the position of the gizmo.

Pull Request: https://projects.blender.org/blender/blender/pulls/133641
2025-02-03 11:25:01 +01:00
Brecht Van Lommel
3725fad82f Cleanup: Various clang-tidy warnings in editors
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Harley Acheson
40eadc75be UI: Transform Feedback for Invalid States
This adds support for Transform MouseInputMode INPUT_ERROR using a new
transform cursor HLP_ERROR (dashed line ending with WM_CURSOR_STOP.
This is shown when attempting an object rotation or scale when
transforms are set to "Affect Only Locations". At this time the status
bar is also cleared and an warning message is shown.

Pull Request: https://projects.blender.org/blender/blender/pulls/132957
2025-01-30 17:11:14 +01:00
Philipp Oeser
8703317b81 Fix #133687: editbone transform wrong with hidden connected parent bone
If the parent editbone is hidden, it will (rightfully) not be taken into
account in `createTransArmatureVerts`.
In `recalcData_edit_armature` though, there was the assumption in a
particular code path that "this bone has a parent tip that has been
moved" even though it wasnt (because it was hidden -- see above).

To resolve, guard this code path with a `EBONE_VISIBLE` check.

Pull Request: https://projects.blender.org/blender/blender/pulls/133707
2025-01-29 10:07:27 +01:00
Harley Acheson
867e9d879a Fix #59358: Don't Show Status Bar Impossible Confirms & Cancels
When performing a transform operation that drags or tweaks, do not show
the Cancel or Confirm keymap item on the Status Bar if they use the
same mouse button that initiated the operation. For example if you are
RCS and are tweaking an object, don't show Cancel on status bar since
that requires right click. If LCS then don't show Confirm (requires
left click) when tweaking, dragging gizmo parts, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/131336
2025-01-29 03:57:08 +01:00
Campbell Barton
915ba086ca Cleanup: use EBONE_VISIBLE / EBONE_SELECTABLE to simplify checks
ANIM_bone_is_visible_editbone was being used in situations where the
intention is to check if the bone is visible to the user.

In this case, EBONE_VISIBLE makes more sense as it also accounts
for hidden bones too.
2025-01-29 12:15:54 +11:00
Richard Antalik
bf19960937 Refactor: VSE: Use C++ matrix BLI API
This PR explicitly declares integer type for `image_center_offs`, which
formalizes accidentally implemented correct behavior. Previously type
was float, all rhs types in expression were integers, so result was int
cast to float.

Comment is also added clarifying why integer must be used - float may
cause images to be interpolated, even when translation is set to 0.

There should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133573
2025-01-28 02:01:07 +01:00
Bastien Montagne
9c237af041 Refactor: RNA: add discrete suffix to RNA_pointer_create.
This is a noisy preliminary step to the 'RNA ancestors' change. The
rename helps clearly tell what each `pointer_create` function does.

Pull Request: https://projects.blender.org/blender/blender/pulls/133475
2025-01-24 16:45:32 +01:00
Richard Antalik
30f3eaa2a5 Fix #133167: Scene snapping settings confilict with VSE
Enabling `use_snap_rotate` in 3D viewport caused rotation in sequencer
to apply snapping. Rotation snapping was using mixed snapping functions,
which aren't implemented in sequencer.

Ignore affect rotation/scale tool setting property and force increment
snapping to be used with these transform modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133272
2025-01-19 20:56:56 +01:00
Campbell Barton
8d97330482 Cleanup: clarify naming for BMesh tangent calculation functions
The newly added "tangent_pair" calculation functions meant the names
didn't read well in some cases, use this style of naming for clarity:

- BM_face_calc_tangent_from_*
- BM_face_calc_tangent_pair_from_*
2025-01-17 15:28:32 +11:00