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
This should make VSE code more readable and easier to understand from an
outside perspective.
The name was chosen to be `channel` rather than `channel_index` to keep
things short and concise -- it should be clear based on the context
whether we are talking about the strip's channel index (singular case,
`Strip::channel` or `SeqTimelineChannel::index`) vs. the channel list
(plural case, e.g. `Editing::channels`).
Pull Request: https://projects.blender.org/blender/blender/pulls/138919
This is mostly a non-functional change except for
* `overlay_armature.cc` was drawing relationship lines to bone
hidden by collection logic (except that doesn't seem to work anyway,
relationship lines are drawn regardless)
* `transform_snap_armature.cc` it was possible to snap to pose bones
hidden by collection logic.
I assumed those to be oversights so I changed them in this PR.
This does *not* remove all usages of `BONE_HIDDEN_P`
and `BONE_HIDDEN_A`. Some direct access is required in
the UI and for cases where we explicitly don't want to check
collection visibility.
Part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/139151
- 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
- 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
No functional changes intended.
This moves the functions
* ANIM_bone_is_visible
* ANIM_bone_is_visible_ebone
* ANIM_bone_is_visible_pchan
into new files `ANIM_armature.hh`/`armature.cc`.
They were previously in `ANIM_bone_collections.hh` but don't
directly have anything to do with bone collections.
It also puts the functions into the `blender::animrig::` namespace
and removes the `ANIM_` prefix as is the standard for C++ files.
Part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/138833
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
This patch renames `seq1` and `seq2` to `input1` and `input2` in `Strip`
and `StripSelection` structs to consist with recent refactors in
#132179. It also renames other instances of `seq1` and `seq2` (e.g.
local variables) to `strip1` and `strip2` instead.
There is only one small breaking change to the Python API with
`strips.new_effect()` taking in the new names now. There should be
no other functional changes involved.
Pull Request: https://projects.blender.org/blender/blender/pulls/138296
Rework internals of how VSE caching is done. Primarily to make all the
caching logic more understandable from development point of view, but
also has several user visible implications (more details in the PR):
- Simpler and fewer caching UI options,
- Disk cache is gone (primary reason: proxies are kinda the same thing),
- VSE cache size set in preferences is actual size used for VSE caches
now (previously caching stopped as soon as whole Blender used that
much memory, even if some memory usage was not about VSE at all),
- Certain scenarios of cache invalidation are faster now.
Pull Request: https://projects.blender.org/blender/blender/pulls/137926
No functional changes intended.
This just replaces all calls to `PBONE_VISIBLE` and `EBONE_VISIBLE`
with appropriate functions.
In the case of editbones it is just the function that the macro already contained.
For pose bones, a new function was added that mirrors what the macro had.
Using a function will make it easier to change how selection is queried in the future.
part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/138819
Previously, it was somewhat difficult to know if a dragged node will be attached
to a frame or not. This patch highlights the frame that dragged nodes will be
attached to which removes the guesswork. This is similar to how we highlight the
link that a dragged node will be inserted onto.
Pull Request: https://projects.blender.org/blender/blender/pulls/138648
It would not use topological distances.
This was the case for Grease Pencil, Curves were right though (even
though both use the same code `curve_populate_trans_data_structs` /
`calculate_curve_point_distances_for_proportional_editing`)
So that calculation is actually right, the thing that made it fail for
Grease Pencil was that `init_proportional_edit` was calling
`set_prop_dist` with the `with_dist` argument as `true` [this would
overwrite the already calculated dist with the "plain", "non-
topological" distance again... leading to wrong values being used in
`calculatePropRatio`]
So to resolve, skip the `set_prop_dist` alltogether if T_PROP_CONNECTED
is used. Done for both Curves and Grease Pencil and move into own block.
Legacy Curve get their own codeblock (with a comment where their
topological distances are calculated).
Pull Request: https://projects.blender.org/blender/blender/pulls/138588
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
This feature allows you to change postion of origin/pivot for images
without changing their position.
It is implemented as property of transform operator. It is activated
by pressing `Ctrl + .` shortcut.
Move Origin item was also added to transform menu.
Origin can be snapped to 3x3 grid on strip image. This represents
most usual anchor points.
Ref: #134251
Pull Request: https://projects.blender.org/blender/blender/pulls/134206
This adds a version of `BKE_id_new_nomain` that takes the ID type parameter as
template argument. This allows the function the return the newly created ID with
the correct type, removing the need to use `static_cast` on the call-site.
To make this work, I added a static `id_type` member to every ID struct. This
can also be used to create a similar API for other id management functions in
future patches.
```cpp
// Old
Mesh *mesh = static_cast<Mesh *>(BKE_id_new_nomain(ID_ME, "Mesh"));
// New
Mesh *mesh = BKE_id_new_nomain<Mesh>("Mesh");
```
Pull Request: https://projects.blender.org/blender/blender/pulls/138383
* Remove `DEG_get_evaluated_object` in favor of `DEG_get_evaluated`.
* Remove `DEG_is_original_object` in favor of `DEG_is_original`.
* Remove `DEG_is_evaluated_object` in favor of `DEG_is_evaluated`.
Pull Request: https://projects.blender.org/blender/blender/pulls/138317
After 5f7d5c0809, just translate gizmo is listening to protection flags
in global orientation. Commit doesn't specify the reason behind the
change. It intentionally ignores scale/rotate lock flags in global
orientation. Added a code comment to explicitly mention the reason
behind it.
Resolves#116666
Pull Request: https://projects.blender.org/blender/blender/pulls/133286
Ref: #132179
Renames:
- `Editing.act_seq` -> `Editing.act_strip`
- `SequenceModifierData` -> `StripModifierData`
- Its member `mask_sequence` is now `mask_strip`.
- `MetaStack.parseq` -> `MetaStack.parent_strip`
- Remaining function names/parameters that were not dealt with in #132748
- Various references to `seq` or `sequence` throughout code and docs when
referring to a strip
Also moves `_get` to the end of the renamed function names where
applicable for standardization (unless "by" or "from" are used).
There should be no changes to current behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/138077
Previously spell checker ignored text in single quotes however this
meant incorrect spelling was ignored in text where it shouldn't have
been.
In cases single quotes were used for literal strings
(such as variables, code & compiler flags),
replace these with back-ticks.
In cases they were used for UI labels,
replace these with double quotes.
In cases they were used to reference symbols,
replace them with doxygens symbol link syntax (leading hash).
Apply some spelling corrections & tweaks (for check_spelling_* targets).
By default, the Ctrl-M shortcut is not working in the VSE preview.
This PR aims to address the issue and provide a working iteration of
the feature.
In my view, it would be preferable for this operator to not only flip
the `flip_x` and `flip_y` values, but also manipulate the transform and
rotation of the strips in a way that keeps the strip in the same
location on the screen, rather than flipping them to the other side.
I decided to implement the feature with this correction functionality,
as it seems more coherent with how the mirror works in other areas of
Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/136343
It's safer to pass a type so that it can be checked if delete should be
used instead. Also changes a few void pointer casts to const_cast so that
if the data becomes typed it's an error.
Pull Request: https://projects.blender.org/blender/blender/pulls/137404
When creating the `axismtx` in `SeqToTransData`, the strip's rotation
needs to be multiplied by the mirror values.
This adjustment effectively multiplies the rotation by -1 when a mirror
is active, resulting in the `axismtx` being correct. This process is
essentially the same as in #136004.
The `axismtx` is utilized in various transform modes, such as
`transform_mode_translate`.
Pull Request: https://projects.blender.org/blender/blender/pulls/137489
The goal here is to avoid having to cast to and from `ID` when getting the
evaluated or original ID using the depsgraph API, which is often verbose and not
type safe. To solve this, there are now `DEG_get_original` and
`DEG_get_evaluated` methods which are templated on the type and use a new
`is_ID_v` static type check to make sure it's only used with valid types.
This allows removing quite some verbosity on all the call sites. I also removed
`DEG_get_original_object`, because that does not have to be a special case
anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/137629
This adds initial support for showing logged data in closures. This is more
tricky than the other zone types, because the zone content is evaluated
elsewhere. The main new thing here is a function that attempts to find where a
given closure is evaluated statically.
Finding this place statically is also important because we generally decide
which compute contexts we want to log before evaluation starts. That's because
we don't want to log everything (which is expensive), but just the places that
the user is currently looking at.
This also changed a bunch of CMakeLists.txt files so that these modules can
include NOD_* stuff, which is generally fine everywhere in editors code.
Pull Request: https://projects.blender.org/blender/blender/pulls/137403
With the move to the new snapping system,
the snapping flags were no longer stored on the editor but on the scene.
While that is good for all editors that deal with animation,
it also affected the Driver Editor since that is effectively a Graph Editor.
However since the driver editor doesn't deal with frames,
it is unlikely that settings should be shared with other animation editors.
With this PR the Driver Editor gets it's own snapping flag,
which means snapping can be controlled without affecting
other animation editors.
This also removes snapping options
* Snap to markers doesn't make sense, there are no markers in drivers
* Snap to seconds also makes no sense
Only snap to frames, i.e. whole numbers is kept with the option
to snap directly to whole numbers or offset the current position
by a whole number.
Pull Request: https://projects.blender.org/blender/blender/pulls/136826
Part of #82877
When drawing specialized cursors for the different paint modes via the
`wmPaintCursor` draw callback, tablet tilt direction is unavailable to
use to customize the drawing for the user.
To enable this functionality, this commit adds the `x_tilt` and `y_tilt`
data read while processing MOUSEMOVE events to the `eventstate` variable
so it can be used by consuming functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/137189
This fixes most "One Definition Rule" violations inside blender proper
resulting from duplicate structures of the same name. The fixes were
made similar to that of !135491. See also #120444 for how this has come
up in the past.
These were found by using the following compile options:
-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Note: There are still various ODR issues remaining that require
more / different fixes than what was done here.
Pull Request: https://projects.blender.org/blender/blender/pulls/136371
The bug was partially caused by the fact that
`translate_snap_increment_ex` would interpret sequencer-specific
snapping bit `SEQ_SNAP_TO_FRAME_RANGE` as `SCE_SNAP_TO_INCREMENT`. Add a
check to fix this.
Technically, #122759 never added snapping for cursors in the preview,
but we can take this opportunity to also add the support, which is
relatively simple.
Pull Request: https://projects.blender.org/blender/blender/pulls/136579
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
Rather than transforming the nodes inside shrinking frames together with
their parent, they are now transformed individually. That way the nodes
are aligned with the grid when snapping and the frame is adjusted by
the automatic resizing.
This makes the grid alignment of nodes is consistent, no matter whether
the node or its parent frame is transformed.
The behavior for manually resized frames is unchanged.
Pull Request: https://projects.blender.org/blender/blender/pulls/136381
Snap nodes by first aligning their inital location to the grid and then
offsetting them in grid increments to avoid jiggling when multiple
unsnapped nodes are moved at once.
Pull Request: https://projects.blender.org/blender/blender/pulls/136437
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
Crashes were caused by setting `Strip::machine` above `MAX_CHANNELS`
value.
Instead of clamping this value at multiple places, setter function
`seq::strip_channel_set` was added that implements clamping.
This also allows for better handling of clamping if it was ever needed.
Function `strip_transform_handle_expand_to_fit` still sets machine value
directly and above `MAX_CHANNELS` as a hack. This could be avoided, but
it would require some refactoring.
Pull Request: https://projects.blender.org/blender/blender/pulls/136163