If the `transdata_check_local_islands` check does not succeed, we end up
with `CTX_NO_PET` for scaling/rotation.
For `Grease Pencil`, this was lost in the transition from GPv2 > GPv3
(type was renamed to "legacy", then removed from
`transdata_check_local_islands` in a804320138, but the new type was
never added).
Curves never specified support for this, but both types are (in theory)
taking into account `V3D_AROUND_LOCAL_ORIGINS` in
`curve_populate_trans_data_structs` (logic from 9d86fada03 might be a
bit broken for proportional editing "islands" without anything selected
as reported in #139101, but that will be corrected in another PR).
So to resolve, add `Grease Pencil` and `Curves` as supported object
types in `transdata_check_local_islands`
NOTE: `transdata_check_local_center` already has these two types as
well.
Part of #139101
Pull Request: https://projects.blender.org/blender/blender/pulls/139209
Currently, removing a node frame a frame is rather annoying. The `alt+P`
shortcut is hard to reach and probably not very intuitive. Furthermore, often
one only notices that one wants to remove a node from a frame after starting to
move the node. So one would have to put the node back down, detach it from the
frame and then start moving again.
This patch simplifies this entire process by adding a new shortcut that can be
used while dragging nodes. When `F` is pressed, the selected nodes are detached
from their parents. Alternatively, if the nodes are detached already, they may
be attached to the frame under the cursor.
Pull Request: https://projects.blender.org/blender/blender/pulls/138650
Currently while transforming with proportional editing we see an item
in the status bar for "MsPan: Adjust Proportional Influence". This is
actually for trackpad pan gesture (only available on some laptops).
This PR just combines this entry with those for Page Up and Page Down.
Pull Request: https://projects.blender.org/blender/blender/pulls/138574
Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.
This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.
Ref !136759
Add support for a 5th modifier key called "hyper",
this is a modifier supported on Wayland & X11 although
other platforms could support an additional modifier too.
Both GNOME and KDE can map CapsLock to Hyper.
Other compositors can use the XKB_DEFAULT_OPTIONS environment variable.
This allows users to have an additional modifier for their own use
that doesn't conflict with other keys.
Ref !136340
Callbacks: exec invoke & modal now use a typed enum wmOperatorStatus.
This helps avoid mistakes returning incompatible booleans or other
values which don't make sense for operators to return.
It also makes it more obvious functions in the WM API are intended
to be used to calculate return values for operator callbacks.
Operator enums have been moved into DNA_windowmanager_enums.h
so this can be used in other headers without loading other includes
indirectly.
No functional changes expected.
Ref !136227
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
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
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
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
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
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
These are useless now that PointerRNA has explicit default values, and
become a problem when real constructors are added to this struct. Simply
use the default empty value initialization instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/130927
For C/C++ doc-strings should be located in headers,
move function comments into the headers, in some cases merging
with existing doc-strings, in other cases, moving implementation
notes into the function body.
This introduces partial functionality of Precision mode to 'Snap to
Grid'.
However, it behaves differently from 'Absolute Grid Snap', as it lacks
smooth mouse movement.
Precision mode is now available specifically for Transform operations.
The issue occurred because the code block that read the snap flag was
out of sync with the code block that saved the flag.
The solution was to centralize snap flag handling in the
`transform_snap_flag_from_spacetype_ptr()` function. This function
retrieves the appropriate snap flag and property based on the editor
type, eliminating the need for repetitive conditional checks and
ensuring that the correct snap flag is set for each editor.
The `transformEvent` function is becoming increasingly complex due to
the inclusion of operation-specific code.
To improve this, remove the `handled` boolean and allow each
`TransModeInfo::handle_event_fn` to determine how to handle already
processed events.
Additionally, move some operation-specific logic to the operators file.
Note:
The `handled` boolean was added in aef307cf31 to fix a bug with the
custom events of the Edge and Vertex Slide operators;
Integrate an existing implementation of the SLIM unwrapping algorithm
into Blender. More info about SLIM here:
https://igl.ethz.ch/projects/slim/
This commit is based on the integration code written by Aurel Gruber
for Blender 2.7x (unfinished and never merged with the main branch).
This commit is based on Aurel's code, rebased and further improved.
Details:
- Unwrap has been moved into a sub-menu,
slim unwrapping is exposed as: "Minimum Stretch".
- Live unwrap with SLIM refines the solutions using a timer.
- When using SLIM there are options to:
- Set the number of iterations.
- Weight the influence using vertex weights.
- SLIM can be disabled using the `WITH_UV_SLIM` build option.
Co-authored-by: Aurel Gruber <aurel.gruber@infix.ch>
Ref !114545
Clang (at least on OSX) has optimization issues with the pointer
version, which seem to be 'fixed' by using references.
Note that using references here is not a bad thing anyway (none of these
pointers would ever be expected to be NULL).
Pull Request: https://projects.blender.org/blender/blender/pulls/124883
Previous code would declare properties as `extern PropertyRNA`, but
implement them as type-refined data (e.g. `FloatPropertyRNA`).
This is fully illegal thing, it happened to work 'fine' so far for two
main reasons:
* C-linking does not do type-checks on extern data.
* Code using these publicly exposed data would always use them as
`PorpertyRNA *` pointers, and pass them to RNA API.
However, this (finally !) breaks when trying to move generated
`RNA_property.h` header to C++, since at least MSVC2022 does mangle the
type in the extern'ed symbol name, which makes linking fails epically.
This commit fixes the issue by only declaring `PointerRNA *` pointers in
the headers. These pointers are then defined in each implementation file
(the `rna_xxx_gen.cc` ones), and assinged to the address of a matching
local static variable. These static variables are type-refined, and
actually contain the property definition data.
Pull Request: https://projects.blender.org/blender/blender/pulls/124603
This patch removes the Auto Render option from the compositor. This is
done for the following reason:
- The option didn't really work except in the case of transforming an
object. So it wasn't really reliable.
- It made little sense to use since the introduction of the Viewport
Compositor.
- It had a number of UX issues, including the fact that it can't be used
with animation playback, and the fact that rendering can get in the
way of the UI depending on the preferences for temporary editors.
Pull Request: https://projects.blender.org/blender/blender/pulls/123132
This is due to the wrong offset when "navigation controls" is off. Axis
gizmo is still visible so "else" codeblock is expected to handle the
correct offset value.
Pull Request: https://projects.blender.org/blender/blender/pulls/121775
Recent changes overlay drawing code resulted in a call to draw the
"Autokeying" text being removed, showing only the icon. This PR just
replaces one removed line.
Pull Request: https://projects.blender.org/blender/blender/pulls/121811
With Aras's recent changes in #121383, our text shader now supports
outline shadows, which gives a result that has more contrast than can
be achieved with BLF_draw_default_shadowed. This removes that function.
Pull Request: https://projects.blender.org/blender/blender/pulls/121676
Continuation of 3d6bb6ce04
This 'alt' hotkey is captured in the modal map
`TFM_MODAL_PASSTHROUGH_NAVIGATE` in order to appear in the header.
But this modal map is not necessary.
Addresses two improvements to `Snap to Grid` as suggested in #73993:
- Make 'Absolute Grid Snapping' a new Snap Mode
- Snap to Grid in Non-Side View performed at ground level
Implementation details:
- Snap to Grid has no cursor symbol, unless we are in `Set Snap Base`
mode. Similar to the previous 'Absolute Grid Snap' behavior.
- In Non-Side view, Snap to Grid is performed at ground level.
- If `Snap Base` is `Closest`, Snap to Grid uses the transform pivot
point instead. Similar to the previous 'Absolute Grid Snap' behavior.
- The "Absolute Grid Snap" option has been removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/116109