Commit Graph

5275 Commits

Author SHA1 Message Date
Pratik Borhade
d40b5dfda3 Fix #145703: Set clamp mode to on by default during vertex slide
Caused by 0bcab8913f
Default value for `use_clamp` is true. But negation in above commit
affected the clamp value. Remove `!`, that way actual property value is
retrieved. Did the same for other two properties as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/145707
2025-09-07 13:23:29 +02:00
Philipp Oeser
5b6bf4743c Fix #145266: Curves: Radius gets stuck at 0
There are multiple reasons this was not working the same for `Curve` and
`Curves`:

`Curve` is actually setting the `TransData.val` for handles (as opposed
to control points) to `nullptr` (`Curves` doesnt).
This is used in multiple places (and makes sense, since this value is
used for tweaking radius, tilt and GP opacities -- stuff that should not
be able to be tweaked from just handle selection, which was actually
possible...)

Included in the places where this `nullptr` is checked for is the logic
in `initCurveShrinkFatten` which relied on this to spot a selection
including a **control point**.

So this PR fixes these two things (setting nullptr to TransData value
for Curves handles and tweaking the logic in `initCurveShrinkFatten` a
bit so it can handle the different layout/order of `TransData` for
`Curves` vs. `Curve`)

Pull Request: https://projects.blender.org/blender/blender/pulls/145327
2025-09-07 07:40:20 +02:00
Damien Picard
f2b61b0874 UI: Fix and improve a few messages
- "grease pencil" -> "Grease Pencil": title case.
- "Display type" -> "Display Type": title case for property name.
- "Bezier" -> "Bézier": proper noun.
- "Mem:%dM, Peak %dM" -> "Mem:%dM, Peak: %dM": missing colon.
- "cannot save image while rendering" -> "Cannot": Sentence case.
- "Linked data cannot text-space transform" -> "Cannot create
  transform on linked data": rephrase strange sentence.
- "Unsupported object type for text-space transform" -> "... for
  texture space transform": unnecessary abbreviation.
- "Cannot write to asset %s:  %s": remove double space.
- "Failed to set tmpact" -> "temporary action": unclear abbreviation.
- "luminance at which the midetones of the image" -> "midtones: typo.
- "Line angle where the image should be split." -> trailing full stop.
- "... instances all the children in the collection" -> "... instances
  of all the children...": missing "of".
- "Curves to generated rounded corners on" -> "generate": typo.
- "Instances that converted to a point per instance" -> "Instances to
  convert to points": rephrase unclear sentence.
- "Great Pencil to set the depth order of" -> "Grease Pencil": typo.
- "Description to set the smoothness of" -> "Geometry to set the
  smoothness of": typo.
- "A cannot use current file as library" -> "cannot use...": typo.

Pull Request: https://projects.blender.org/blender/blender/pulls/145840
2025-09-07 00:26:31 +02:00
Aras Pranckevicius
2735176c40 Refactor: VSE, remove STRIP_TYPE_EFFECT, split effect type and blend mode enums
- "Is this strip type an effect?" has been done by reserving 3rd bit
  of the effect enum values to indicate that. That is a very strange
  decision, so make that be done by strip_is_effect() function. The
  enum values have to stay the same for backwards compat however.
- Both "strip type" and "strip blend mode" were sourced from the
  same STRIP_TYPE_ enum, with only parts of the values meant for "type",
  and other parts of values meant for "blend mode". That again is highly
  confusing; split that off into two enums. Yes there's a handful of
  values in them that overlap, but not the majority.

Pull Request: https://projects.blender.org/blender/blender/pulls/145746
2025-09-05 19:00:58 +02:00
Brecht Van Lommel
61dd8a1435 Fix #143060: Snapping to curve object does not use subdivision modifier
Also avoids calling ensure subdivision wrapper unnecessarily when a
mesh is in edit mode.
2025-09-01 19:35:12 +10:00
Casey Bianco-Davis
346d5b7407 Fix: Curves: Don't treat non-bezier curves as selected when handles are
The `retrieve_selected_points` function would treat points of non-bezier
curves as selected if the handles were selected. And because the
attributes `.selected_handle_left` and `.selected_handle_right` are
created initialized to true for all points. The
`retrieve_all_selected_points` would return that all points were
selected.

Only points of bezier curves should be used when getting the selection
mask for handles.

Pull Request: https://projects.blender.org/blender/blender/pulls/144824
2025-08-25 23:37:12 +02:00
Falk David
1122a05cb6 VSE: Scene Selector & Scene Time Synchronization
Implements the proposed design (with some modifications) in #135058.

## Sequencer Scene

This adds a new property called `sequencer_scene` to workspaces. This scene is used
by the video sequence editors in the current workspace for their context.
This is a first step towards "detaching" the VSE from the active scene in the window.

Each sequencer timeline editor shows the sequencer scene that is being used.
By default, when no sequencer scene is selected, the timeline and preview are empty.

Pressing the "new" button will add a new scene and assign it to the sequencer
scene for the current workspace.

## Contextual Playback

Pressing `Space` (by default) for starting the animation playback is now contextual:
depending on the context (where your mouse cursor is), the scene that is played back
might be different. E.g. with a 3D Viewport and a Sequencer open, pressing "play"
in the 3D Viewport will play the _active scene_ of the window, while pressing "play"
in the sequencer will play the _sequencer scene_.

## Time & Scene Synchronization

Additionally, this adds a toggle called "Sync Active Scene".
With the property turned on, the active scene & scene time in the window will be
synced with the time & scene of the current scene strip in the sequencer.

Note that this is _not_ bi-directional. The sequencer can change the active scene
and map time, but it's not possible the other way around since it one can have
multiple strips using the same scene (+camera, and even time!).

Currently this setting is exposed in the footer of the sequencer timeline as well
as in the workspace settings.

This allows for one of the core concepts that the story tools projects aims at: Working
in a scene (e.g. in the 3D viewport) while also working with the edit
(in the sequencer timeline).

## Some technical notes

* Undoing while playback is running will now cancel playback. This is to avoid the timer,
   that points to the scene and viewlayer that are playing, to get de-synced after loading
   the memfile undo step.
* When the sequencer scene is not the same as the active scene, we ensure it has
   a depsgraph.
* Normally, when a `NC_SCENE` notifier points to a specific scene, the notifier is dropped
   if that scene doesn't match the active one in the window. We now also check that it
   doesn't match the sequencer scene in the active workspace.
* When loading older files, we need to make sure that the active workspace in a window
   uses the active scene as the sequencer scene. This is to make sure that the file opens with
   the same sequences open.
* Tool settings are stored per scene. To make sure the sequencer uses the tool settings for
   the sequencer scene, the "context.tool_settings" and `CTX_data_tool_settings` members
   are overridden in the sequence editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/140271
2025-08-25 11:58:17 +02:00
Laurynas Duburas
38c1656624 Fix #143635: Grease Pencil: Use only editable points in use_connected_only
In function `curve_populate_trans_data_structs` only editable points are
copied to `TransDataContainer`.
The code handling proportional connected editing was expecting all data
from `CurvesGeometry` to be there. Additional offset index array was
added for editable points per curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/144655
2025-08-25 11:03:37 +02:00
Campbell Barton
addc9db67d Fix #144916: Transform crash pressing tab disabling axis constraint
When disabling cursor constraint NumInput::idx_max was set to -1.
This looks to be the behavior since 2.4x, however more recently
the modulo of `idx_max + 1` was used to cycle the axis when pressing
tab (crashing when `idx_max` is -1).

Resolve by setting `NumInput::idx_max` to the number of axes since
this is the state when transform is initialized.
2025-08-22 07:37:30 +00:00
Hans Goudey
56646137fe Refactor: Move some wmWindowManager runtime lists out of DNA
Mainly for the purpose of #127706, though there's plenty more runtime
data to move to the runtime struct out of DNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/144691
2025-08-18 16:13:07 +02:00
Hans Goudey
a5d5eca487 Cleanup: Sequencer: Replace seqbasep variable access with function
With the aim of removing `seqbasep` to remove the complicated logic for
repairing pointers within the `Strip` struct when loading files and undo
steps, this commit just moves access of the variable behind a function.
In the future the function will retrieve the list from a Strip pointer,
for now it just returns the existing pointer.

Overall motivation is that blend file pointer manipulation is incompatible
with the changes required for #127706.

Pull Request: https://projects.blender.org/blender/blender/pulls/144624
2025-08-18 15:39:58 +02:00
Hans Goudey
072d251b8e Refactor: Use optional Span instead of empty Span with no attribute
The semantics of checking "has_value()" (etc.) are much better than
checking for an empty span when dealing with the result of an attribute
lookup. This mainly affects the Bezier curve handle position attributes
currently. Plenty of places assume those attributes exist now. In a
couple places the code is a bit safer now, otherwise it's just a bit
more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/144506
2025-08-17 18:08:18 +02:00
Ramon Klauck
5dc5bd5a2b VSE: Add "Mirror" menu to preview strip menu
This PR adds a "Mirror" menu to the Strip menu within the VSE preview.
This menu is similar to the "Mirror" menu in the view3d "Object" menu.
It allows the user to access the mirror operator through a menu, rather
than via a shortcut.

Pull Request: https://projects.blender.org/blender/blender/pulls/142506
2025-08-17 14:01:40 +02:00
Christoph Lendenfeld
bc93123461 Refactor: Use function overload for bone_is_visible
No functional changes intended.

This brings `bone_is_visible` in line with `bone_is_selected`,
by using function overloading instead of suffixing with either
`pchan` or `editbone`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144558
2025-08-14 14:50:28 +02:00
Laurynas Duburas
2f274a5f61 Fix: Curves: Transformation center when single point handles are selected
Fixes transformation center when single point handles are selected.
Also converts auto  handles to aligned handles when a single point is
scaled or rotated.

Pull Request: https://projects.blender.org/blender/blender/pulls/144423
2025-08-13 18:54:43 +02:00
Campbell Barton
494bb557fb Fix: error referencing a temporary variable
Correct error from [0] which held a reference to a temporary variable.
Also improve comment wording.

[0]: d278e7d424
2025-08-13 08:39:34 +10:00
Campbell Barton
d278e7d424 Fix #144270: Edge slide fails when moving towards a single triangle
Technically a regression in [0] however even before this commit
there where no check to prevent an intersection being used which
is far outside triangle the vertex is sliding towards.

Resolve by only using the line-line intersection if the intersection
points lie within a conical region defined by the edge pair the user
is sliding towards (see code-comment for details).

Ref !144418

[0]: 49ab0bb844
2025-08-12 09:12:45 +00:00
Campbell Barton
66803e4441 Cleanup: use function style casts 2025-08-12 02:46:51 +00:00
Casey Bianco-Davis
eb651bb243 Fix #143534: Grease Pencil: Grid snapping problem with bezier points or proportional editing
When the median was being calculated, the division was by the total number of transform data, rather than the selected number of transform data.
Under most circumstances this would be the same, but when transforming bezier control points without the handles selected, or when having proportional editing on. This the median calculation would return a wrong result.

Note: This problem could occur almost every object type not just Grease Pencil.

Resolves: #143534

Pull Request: https://projects.blender.org/blender/blender/pulls/144245
2025-08-09 12:28:34 +02:00
Campbell Barton
062fcd00d1 Cleanup: improve confusing/incomplete code-comments 2025-08-08 16:41:38 +10:00
Campbell Barton
cccc2c77c5 Cleanup: consistent for C-style comment blocks 2025-08-08 07:37:33 +10:00
Falk David
4a013194dd Cleanup: Core: Replace FPS scene macro with member function
Replaces the `FPS` macro with `scene->frames_per_second()`.

The macro has two major issues:
* It hides that it depends on a `Scene *` variable named `scene`.
* It makes debugging harder.

This is now replaced with a member function on the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/144127
2025-08-07 11:30:25 +02:00
Campbell Barton
5b78323450 Cleanup: use RNA_def_enum_flag 2025-08-07 18:10:50 +10:00
Hans Goudey
b2d0b9535f Fix #143739: Operator redo broken for duplicate move
In this case the depsgraph isn't necessarily evaluated before the
transform operator executes. We need to make sure there's an evaluated
depsgraph so the evaluated deform positions are updated based on the
duplicate operator (the first step of the operator macro).

Pull Request: https://projects.blender.org/blender/blender/pulls/144037
2025-08-06 13:38:49 +02:00
Nig3l
4bede1b555 Image Mask Editor: Expose tools in the Toolbar
Expose existing mask operators as tools in the toolbar.

The primitive tools are commented out since interactively placement
isn't currently supported by the operators.

Ref !136086
2025-08-06 09:44:24 +00:00
Campbell Barton
e8501d2f54 Cleanup: grammar corrections, minor improvements to wording
Also back-tick quote some code references in comments
to differentiate them from English text.
2025-08-06 00:20:39 +00:00
Damien Picard
5998795aa6 UI: Replace contractions with long-form text
Avoid using contractions for can't, aren't, doesn't, and shouldn't.
Following the writing style guide in the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/143852
2025-08-05 11:16:22 +02:00
YimingWu
02977873fb Fix #143685: Use correct shader for points for vertex slide
Previously it was using `GPU_SHADER_3D_UNIFORM_COLOR`, should be
`GPU_SHADER_3D_POINT_UNIFORM_COLOR` for points so we don't get asserts.

Pull Request: https://projects.blender.org/blender/blender/pulls/143683
2025-08-04 14:02:11 +02:00
Campbell Barton
62aac627a5 Cleanup: rename KM_CLICK_DRAG to KM_PRESS_DRAG for clarity
"Press drag" more accurately describes what the action does.
2025-08-02 13:41:38 +10:00
Campbell Barton
f281f5a500 Cleanup: header grouping
Group includes, this is mostly being done already but had become mixed
up in some areas.
2025-07-30 14:22:06 +10:00
Harley Acheson
37a11ad824 UI: Shrink/Fatten Status Bar Display
This PR moves all keymap information for the mesh Shrink/Fatten
operator to the status bar and only the values on the area header.

Pull Request: https://projects.blender.org/blender/blender/pulls/141957
2025-07-29 22:59:46 +02:00
Harley Acheson
a08aabc9ee UI: Mesh Shear Status Bar Display Improvements
This PR adds some missing keymap items to the status bar display for
the mesh Shear operator. Adds snapping, precision, and proportional
editing size (when applicable).

Pull Request: https://projects.blender.org/blender/blender/pulls/141975
2025-07-29 22:39:41 +02:00
Campbell Barton
e8f9e2d1d1 Cleanup: use UTF8 string functions in editors & related logic
Use UTF8 aware functions unless raw bytes are expected.
2025-07-27 16:41:19 +10:00
tariqsulley
f4b5cbd31b Fix #135908: Extrude Individual Faces "Offset Even" does nothing
Logically a NOP for individual faces, hide the property.

Ref !136275
2025-07-25 16:43:01 +10:00
Hans Goudey
9c9695b103 Refactor: Move ReportList definition from DNA to blenkernel
Ever since [0], ReportList is not actually used in any DNA structs.
That makes sense, since reports are conceptually only necessary
at runtime. Move the definition of the struct to BKE_report.hh, and
fix a bunch of include errors where types were previously available
transitively. Besides adding some clarity, theoretically this change
could reduce compile times because of less header parsing.

[0]: 1bf6d8b0b9

Pull Request: https://projects.blender.org/blender/blender/pulls/138872
2025-07-24 15:59:52 +02:00
YimingWu
59625019b8 Fix #139530: Modeling: Allow adding snap points in increment/grid modes
Previously if only Increment/Grid Snap Targets are selected, transform
tools will not allow adding snap targets, although if there are extra
snapping target type enabled, you are still able to add grid points as
new snap points anyways, thus remove the restriction.

Pull Request: https://projects.blender.org/blender/blender/pulls/139534
2025-07-23 14:31:14 +02:00
John Kiril Swenson
6571236b59 VSE: Clamp retiming key header values and snap drawing
Fixes #142735.

The original clamp patch in #134319 did not add any cases for retiming
key transformation code. A simple solution to the crash would be to
disable the behavior, but this PR opts to bring feature parity to
retiming keys too.

This means that header values are now more accurate, and snap lines do
not erroneously draw when retiming keys get clamped.

It also changes transition key transformation slightly, aligning the
direction of movement with the movement of the two keys. Before, moving
the mouse backwards would have the same effect, which was clunky and
unintuitive.

Pull Request: https://projects.blender.org/blender/blender/pulls/142809
2025-07-23 04:14:07 +02:00
John Kiril Swenson
ec4323f95b Cleanup: VSE: Move strip flags to StripRuntime
Quite a few flags in `Strip.flag` were used only at runtime; they were
temporarily set and then cleared thereafter. Move them to
`StripRuntime.flag` instead.

Most of the moves are trivial renames, with some old versioning code for
`SEQ_FLAG_DELETE` deleted. That code fixed a very uncommon edge-case bug
in 2.x which doesn't seem worthwhile to keep deprecated code around for.

Pull Request: https://projects.blender.org/blender/blender/pulls/142776
2025-07-22 19:42:07 +02:00
Habib Gahbiche
907d023b83 Fix #142811: UV edit cage no longer has corner scale points
The commit `b3a5d03bd0` introduced a new draw option for cage gizmos to
draw corners. This was turned off by default to prevent it being
visible in circular 2d gizmos.

This fix turns the corner draw option back on explicitly. Note: The
relevant 2D gizmo already sets  `ED_GIZMO_CAGE_XFORM_FLAG_SCALE`, so no
 changes in transform options are required.

Pull Request: https://projects.blender.org/blender/blender/pulls/142840
2025-07-22 13:48:55 +02:00
Germano Cavalcante
732436946e Fix #142338: Edge center snapping interferes with face snapping
The snapping system could return a regular 'Snap to Edge' result when
only derived edge snap types (midpoint, endpoint, perpendicular) were
enabled, even if 'Snap to Edge' itself was not included among the
selected snap modes. This led to unintended snapping behavior.

To address this, a backup of the previous snap result is stored before
edge snapping is attempted. If the resulting snap mode is not among the
explicitly selected types, the previous state is restored. Additionally,
the `hit_list` assignment was moved to the runtime context to separate
intermediate data from the final snap result.

Pull Request: https://projects.blender.org/blender/blender/pulls/142512
2025-07-19 22:45:20 +02:00
Ramon Klauck
e41811e225 Fix #142291: Crash when transforming strip in preview with audio strip active
This happened because audio strips lack the `data->transform` attribute,
but it was attempted to access this attribute. It is fixed by checking
first if `data->transform` exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/142351
2025-07-18 19:56:25 +02:00
Falk David
99f3beb63f Refactor: VSE: Use new scene context function
This PR switches out the internal scene context function
used from the sequencer. This is done in preparation for
#140271.

Using a separate context function allows us to keep the
existing `context.scene` to refer to the active scene
and use a separate context member to refer to the
sequencer scene in the workspace (which is added in #140271).

Previous attempts simply overrode the `context.scene`
to refer to a different scene than the active one in the window.
This has two issues:
1) Any operator that wants to use the active scene in the window
  can't do it in the context of the sequencer. This is a problem for
  example for poll functions of operators that don't have anything to
  do with the sequencer.
2) For better or for worse, Blender expects the `context.scene` to
  always exist. For the sequencer, we'd like to possibly have no
  sequence selected.

Using a different context member for the sequencer has some
advantages:
1) Although we have to change quite a few places, it's limited to the
  sequencer. We don't have to change other parts of Blender to make
  things work.
2) It allows us to prepare for the future when we might want to
 separate the VSE from the scene. This is a step in that direction.
 Having a different context function makes it easy to find the places
 that would need to be refactored.

Pull Request: https://projects.blender.org/blender/blender/pulls/141271
2025-07-18 16:17:47 +02:00
Jacques Lucke
55e2fd2929 Cleanup: unify naming for named constructors
Previously, we used an inconsistent naming scheme for such "named constructors".
Now it always uses `from_*`.

Pull Request: https://projects.blender.org/blender/blender/pulls/142175
2025-07-17 09:09:16 +02:00
Campbell Barton
e8e188cb7d Cleanup: various non-functional changes for C++ 2025-07-17 12:32:30 +10:00
John Kiril Swenson
d910fb88b0 VSE: Clamp strip handles to video/audio bounds
This initial commit properly clamps handles for video/audio strips, and
provides functionality to enable/disable the behavior for all strip types
(addresses #90280).

Toggling handle clamping is done with "C",
just like with the redesigned slip operator (#137072).

If a strip is not already clamped when you start moving its handles,
then clamping behavior is disabled starting out. This means no abrupt
clamp until you explicitly ask for it.

Transform logic was altered, fixing a few bugs:
- When initializing a transform, `createTransSeqData` would already
  create some clamping data for channels. This patch replaces it with
  `offset_clamp` (for unconditional clamping which cannot be disabled)
  and `handle_xmin/xmax` (for hold offset clamping, which is optional).
    - Collecting this data ahead of time is necessary for the double
      handle tweak case -- `flushTransSeq` only works one strip at a
      time, so we can't clamp post-hoc.
- In `applySeqSlideValue`, we apply `transform_convert_sequencer_clamp`
  before values are printed to the header, but let the unclamped values
  get flushed to the strips themselves. This is so that we can have the
  data later at the individual strip level to recalculate clamps.
  Otherwise, if transform values are clamped preemptively, then we have
  no idea whether strips are clamped vs. merely resting at their
  boundaries.

Note that currently, handle clamping is drawn identically to overlaps.

More information in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/134319
2025-07-16 06:16:19 +02:00
Germano Cavalcante
dfd4d2914f Refactor: Bypass DEG_foreach_dependent_ID_component when not needed
The `DEG_foreach_dependent_ID_component` is only used to mark objects
whose base will have `BA_SNAP_FIX_DEPS_FIASCO`.

If this flag is not used, the `DEG_foreach_dependent_ID_component` is
also not needed.
2025-07-15 20:18:57 -03:00
Germano Cavalcante
bda79fe4c3 Fix #121266: Snap toggle in UI not updating during transform
During transform operations, the 'Snap Toggle' shortcut
(default: Shift + Tab) enables or disables snapping.

Previously, the UI did not reflect the toggle state until the operation
was finished.

It now updates live during the operation.
2025-07-15 16:51:30 -03:00
Richard Antalik
cadbf9702b Fix #141780: Images rotate bacwards in VSE
58af30f9b9 changed sign of rotation. The sign was previously negated in
VSE for image to follow mouse cursor. This is no longer necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/141782
2025-07-15 14:12:44 +02:00
Guillermo Venegas
1a247fbaa8 Refactor: WM: Make OperatorCallContext an enum class, move to namespace
This allows forward declaring `OpCallContext`, avoiding the
transitive include `WM_Types.hh` in `UI_interface_layout.hh`

Pull Request: https://projects.blender.org/blender/blender/pulls/141804
2025-07-15 03:08:04 +02:00
Germano Cavalcante
32a6e14d41 Fix #54325: Shrink/Fatten "Offset Even" can not be used as default
The default keymap item that triggers `Shrink/Fatten` uses the `Alt`
modifier, which coincidentally is the same key that toggles
`Offset Even`. What is undesirable.

The solution is to alternate between Alt Press and Alt Release
depending on the `Offset Even` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/141904
2025-07-15 01:56:25 +02:00