Commit Graph

35 Commits

Author SHA1 Message Date
Aras Pranckevicius
e2b43a4dba Cleanup: armature bone display type naming
- User visible rename: "Use Armature Setting" -> "Armature Defined"
  (just added in 8bf73386f2)
- Internal code only: rename eArmature_Drawtype enum items to have
  ARM_DRAW_TYPE_ prefix, instead of just ARM_ (just ARM_ is used in
  several unrelated enums, leading to confusion)

This is re-apply of PR !138982 was backed out in cef7cb4534 due to
Win x64 buildbot failure. The error was:
```
view3d_navigate_view_all.cc(321): error C2672: 'blender::bounds::transform_bounds': no matching overloaded function found
view3d_navigate_view_all.cc(322): error C2784: 'blender::Bounds<blender::VecBase<T,3>> blender::bounds::transform_bounds(const blender::MatBase<T,Size,Size,NumCol*NumRow%4==0?4:1*sizeof(T)> &,const blender::Bounds<blender::VecBase<T,3>> &)': could not deduce template argument for 'const blender::MatBase<T,Size,Size,NumCol*NumRow%4==0?4:1*sizeof(T)> &' from 'const blender::float4x4'
```
which has nothing whatsoever to do with the PR. But something
in the PR (i.e. rename of a completely unrelated enum entries)
presumably makes this specific VS2019 compiler version not be
able to resolve template argument type. Again, in completely
unrelated file with completely unrelated types.

So "the fix" is to help VS2019 compiler in that place by explicitly
specifying the template types. What exactly in the original
change triggers the issue, remains a mystery. "It is known" that
VS2019 is quite funky in template argument deduction, maybe this
is one of these cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/138995
2025-05-17 08:36:33 +02:00
Thomas Dinges
cef7cb4534 Revert "Cleanup: armature bone display type naming"
This reverts commit 2149f462d4 (broke Windows x64 compilation on CI).

Pull Request: https://projects.blender.org/blender/blender/pulls/138994
2025-05-16 21:01:41 +02:00
Aras Pranckevicius
2149f462d4 Cleanup: armature bone display type naming
- User visible rename: "Use Armature Setting" -> "Armature Defined"
  (just added in 8bf73386f2)
- Internal code only: rename eArmature_Drawtype enum items to have
  ARM_DRAW_TYPE_ prefix, instead of just ARM_ (just ARM_ is used in
  several unrelated enums, leading to confusion)

Pull Request: https://projects.blender.org/blender/blender/pulls/138982
2025-05-16 15:35:56 +02:00
Campbell Barton
c690255184 Cleanup: rename "size" to "scale" in transform code
This value is mainly used for scale values, not an absolute "size".
2025-03-19 10:37:45 +11: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
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
Hans Goudey
c6f5c44350 Cleanup: Remove unused includes in editors modules
Pull Request: https://projects.blender.org/blender/blender/pulls/133166
2025-01-16 23:17:51 +01:00
Christoph Lendenfeld
a03b1e063d Fix #131905: Affect transform not working for Pose Space
This feature was just not implemented yet.
The solution is similar to 042a1327ca which implemented this
for the scale constraint.

Pull Request: https://projects.blender.org/blender/blender/pulls/132176
2025-01-16 11:44:38 +01:00
YimingWu
6a9b3183db Fix #131992: Grease Pencil: "Scale Stroke Thickness" behaviour fix
Previously there are two problems with grease pencil transformation:

1. Transform in Grease Pencil Opacity mode would change stroke thickness
    if "Scale Stroke Thickness" is enabled.
2. "Scale Stroke Thickness" is ineffective when scaling strokes in edit
    mode while in GPv2 implementation it will scale stroke thickness in
    sync with overall dimensions.

This patch fixes those problems by:

1. Altering the logic of determining which attribute to feed into the
    TransData.
2. Swapping the arguments for fall off interpolation (Previously was
    inverted, causing the factor to always be zero hence appeared to be
    ineffective).

Pull Request: https://projects.blender.org/blender/blender/pulls/132274
2025-01-10 14:02:16 +01:00
Campbell Barton
7e8dcf77db Cleanup: pass UnitSettings as a const reference 2025-01-08 21:22:45 +11:00
Laurynas Duburas
e2b834a1b1 Fix #130694: Curves: Bézier points do not respect Individual Origins pivot point
Sets TransData.center with the same logic as in legacy curves
(see `createTransCurveVerts`).

Pull Request: https://projects.blender.org/blender/blender/pulls/131110
2024-12-16 19:35:16 +01:00
Laurynas Duburas
8dcb76b6ad Fix #130688: Grease Pencil: Multiframe Editing not applying falloff for rotation & scale
Fixes rotation and scale in multi frame editing.

Pull Request: https://projects.blender.org/blender/blender/pulls/131634
2024-12-10 17:21:06 +01:00
Germano Cavalcante
ba3d017929 Transform: remove unused "GPENCIL_SHRINKFATTEN"
Since `c986aa03b9`, this mode is no longer used and is quite difficult
to access, as in version 4.3, `ob->data` should never be of type
`bGPdata *`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130406
2024-11-18 21:09:07 +01:00
Richard Antalik
b193684b5d VSE: Use snapping for retiming keys
Retiming keys now can be used as snap sources or targets. Snapping to
keys can be disabled similar to other targets.

Pull Request: https://projects.blender.org/blender/blender/pulls/129709
2024-11-06 05:43:34 +01:00
Hans Goudey
a804320138 Cleanup: Remove unused grease pencil legacy handling in some operators
See #123468.
2024-11-02 23:14:41 +01:00
casey bianco-davis
8f386cd308 GPv3: Edit Mode: "Scale Thickness" option
This implements the `use_scale_thickness` setting for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/126213
2024-08-16 19:50:34 +02:00
Campbell Barton
21e988a51c Fix error in fix for #87219, accidental assignment in conditional 2024-06-04 10:46:57 +10:00
Germano Cavalcante
4439e39530 Fix: assignment in a condition
Error in 042a1327ca
2024-06-03 19:35:31 -03:00
Germano Cavalcante
042a1327ca Fix #87219: 'affect transform' not working for Pose Space
`affect transform` was never supported for Pose Space in Limit
constraints.

This commit implements this space in the transform code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113363
2024-06-03 18:14:49 -03:00
Campbell Barton
91229f0e16 Cleanup: use full sentences for comments in transform & windowmanager 2024-03-09 23:28:03 +11:00
Hans Goudey
1c0f374ec3 Object: Move transform matrices to runtime struct
The `object_to_world` and `world_to_object` matrices are set during
depsgraph evaluation, calculated from the object's animated location,
rotation, scale, parenting, and constraints. It's confusing and
unnecessary to store them with the original data in DNA.

This commit moves them to `ObjectRuntime` and moves the matrices to
use the C++ `float4x4` type, giving the potential for simplified code
using the C++ abstractions. The matrices are accessible with functions
on `Object` directly since they are used so commonly. Though for write
access, directly using the runtime struct is necessary.

The inverse `world_to_object` matrix is often calculated before it's
used, even though it's calculated as part of depsgraph evaluation.
Long term we might not want to store this in `ObjectRuntime` at all,
and just calculate it on demand. Or at least we should remove the
redundant calculations. That should be done separately though.

Pull Request: https://projects.blender.org/blender/blender/pulls/118210
2024-02-14 16:14:49 +01:00
Campbell Barton
b372ebae68 Cleanup: unused headers for source/blender/editors
Remove 1317 includes from editors.
2024-02-13 10:02:53 +11:00
Bastien Montagne
45e7827898 Clenup: Move BLT headers to Cpp.
Noisy but fairly straight forward.
2024-02-09 18:59:42 +01:00
Damien Picard
019eb5a35e I18n: use IFACE_ to translate status bar info & viewport statistics
Although the information displayed in the status bar is strictly
speaking reports, it makes sense to translate them using the Interface
setting instead of Reports, as the tool names and stats terms are
also translated in other UI places (toolbar, menus).

This change includes status bars statistics and keymaps, and viewport
statistics.

The change is quite extensive as it is all or nothing. Translating
keymaps using Interface means some status messages will include them
indirectly, and thus cannot use Reports without having a weird mix of
original and translated words. In turn, having only some messages
translated would be even more confusing.
The result is that all messages related to input are now translated with
Interface, which I think also makes sense.

Discussed as a followup to !116804.

-----

cc. @gtitaev

Pull Request: https://projects.blender.org/blender/blender/pulls/117234
2024-02-07 11:17:50 +01:00
Damien Picard
3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Hans Goudey
3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
casey bianco-davis
e266b142f6 GPv3: Transform operators
This adds the keybindings, menu, and functionally for the edit mode transform operators to grease pencil v3.

The transform operation include:
 * translate, rotate, scale, change opacity, change radius

Pull Request: https://projects.blender.org/blender/blender/pulls/111836
2023-10-21 15:12:47 +02:00
Germano Cavalcante
7e078b724a Fix #112580: Limit Constraint with 'Affect Transform' not working properly in 'World Space'
The problem is observed with the "Limit Distance" and "Limit Location"
constraints.

There is an incorrect usage of `td->mtx` and `td->smtx` when converting
`TransData` space from local to global.

In this case, the code is concatenating matrices instead of converting
the location component space.

Also, these matrices only inform the global transformation components
of rotation and scale. They do not include location.

Since the "Limit Distance" and "Limit Location" constraints only require
the location component, it is not necessary to convert the rotation and
scale components.

So, the solution is to convert the location component space instead of
concatenating matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/112601
2023-10-06 17:14:25 +02:00
Richard Antalik
86a0d0015a VSE: Improve retiming UI
Currently retiming is quite awkward, when you need to retime multiple
strips strips in sync. It is possible to use meta strips, but this is
still not great. This is resolved by implementing selection.

General changes:
Gizmos are removed, since they are designed to operate only on active
strip and don't support selection.
Transform operator code is implemented for retiming data, which allows
more sophisticated manipulation.
Instead of drawing marker-like symbols, keyframes are drawn to
represent retiming data. Retiming handles are now called keys. To have
consistent names, DNA structures have been renamed.
Retiming data is drawn on strip as overlay.

UI changes:
Retiming tool is removed. To edit retiming data, press Ctrl + R, select
a key and move it. When retiming is edited, retiming menu and
context menu shows more relevant features, like making transitions.
Strip and retiming key selection can not be combined. It is possible to
use box select operator to select keys, if any key is selected.
Otherwise strips are selected.
Adding retiming keys is possible with I shortcut or from menu.
Retiming keys are always drawn at strip left and right boundary. These
keys do not really exist until they are selected. This is to simplify
retiming of strips that are resized. These keys are called "fake keys"
in code.

API changes:
Functions, properties and types related to retiming handles are renamed
to retiming keys:
retiming_handle_add() -> retiming_key_add()
retiming_handle_move() -> retiming_key_move()
retiming_handle_remove() -> retiming_key_remove()
retiming_handles -> retiming_keys
RetimingHandle -> RetimingKey

Retiming editing "mode" is activated by setting `Sequence.show_retiming_keys`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109044
2023-09-27 01:45:59 +02:00
Jacques Lucke
cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Aras Pranckevicius
d973355b3a Cleanup: reduce amount of math-related includes
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).

However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.

This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.

Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
  to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).

Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.

Pull Request #110944
2023-08-10 14:51:40 +03:00
Hans Goudey
ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00
Campbell Barton
81ee130063 Cleanup: use C++ system headers
Apply clang-tidy modernize-deprecated-headers to source/
2023-07-22 11:27:25 +10:00
Jacques Lucke
3a2f5fb9db Editors: move transform code to C++
Also see #103343.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/110049
2023-07-13 17:59:52 +02:00