Age | Commit message (Collapse) | Author |
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
Also resolve a warning from the previous commit. The next blocker to
using const is `BKE_mesh_wrapper_ensure_mdata`.
|
|
This constraint can be naturally viewed as a prototype for a future
4x4 matrix math node (or subset thereof), since its basic semantics
already is matrix assignment. Thus it makes sense to add math options
to this constraint to increase flexibility in the meantime.
This patch adds support for several operations that would be useful:
- An option to remove shear in the incoming target matrix.
Shear is known to cause issues for various mathematical operations,
so an option to remove it at key points is useful.
Constraints based on Euler like Copy Rotation and Limit Rotation
already have always enabled shear removal built in, because their
math doesn't work correctly with shear.
In the future node system shear removal would be a separate node
(and currently Limit Rotation can be used as a Remove Shear constraint).
However removing shear from the result of the target space conversion
before mixing (similar to Copy Rotation) has to be built into
Copy Transforms itself as an option.
- More ways to combine the target and owner matrices.
Similar to multiple Inherit Scale modes for parenting, there are
multiple ways one may want to combine matrices based on context.
This implements 3 variants for each of the Before/After modes
(one of them already existing).
- Full implements regular matrix multiplication as the most basic
option. The downside is the risk of creating shear.
- Aligned emulates the 'anti-shear' Aligned Inherit Scale mode,
and basically uses Full for location, and Split for rotation/scale.
(This choice already existed.)
- Split Channels combines location, rotation and scale separately.
Looking at D7547 there is demand for Split Channels in some cases,
so I think it makes sense to include it in Copy Transforms too, so that
the Mix menu items can be identical for it and the Action constraint.
Differential Revision: https://developer.blender.org/D9469
|
|
SeqCollection wasn't freed.
It wasn't easy to find culprit so added argument to
SEQ_collection_create() to pass function name.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D11746
|
|
Address initial feedback:
- Use checkboxes instead of radio buttons
- Hide snapping distance control from UI
- Tweak snapping line color - use selected strip color, 50% transparency. Similar to other editors
- Draw 2px thick line, since strip outline is also 2px thick
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D11759
|
|
Edit-mesh partial update logic assumed translate didn't need normals
to be recalculated (for faces with all vertices being transformed).
However translate can optionally rotate which requires
all transformed normals to be updated.
Check for this case and use the previous partial-update method
when it modified extra geometry, so the normals are properly reset.
Further updates need not recalculate them.
|
|
|
|
Supporting both object & edit-mode is more involved.
Both cases are now supported with object mode tracking the last-used
state for rotation so it's only reset once when rotation is disabled.
|
|
|
|
|
|
|
|
This was being called for every element in some situations.
|
|
Use the term 'mat_final' for calculated matrices used for transforming.
Also rename 'pivot' to 'pivot_local'.
|
|
|
|
Multi-threading support for transform modes: bevel-weight, crease,
push-pull, rotate, shear, shrink-fatten, skin-resize, to-sphere,
trackball & translate.
This is done using a parallel loop over transform data.
From testing a 1.5million polygon mesh on a 32 core system
the overall performance gains were between ~20-28%
To ensure the code is thread-safe arguments to shared data are const.
Reviewed By: mano-wii
|
|
|
|
Reserve the term count for values that require calculation
(typically linked lists).
Without this convention it's difficult to know if using a length
accessor function in a loop will be O(N^2) without inspecting the
underlying implementation.
|
|
|
|
The `applySnap` callback of each mode was overwriting the value
calculated in `transform_snap_sequencer_apply`.
|
|
|
|
|
|
Change snapping behavior to snap strip edges when they are close to snap point.
Default behavior is, that each transformed strip is snapped to any other strip.
Implement snapping controls in sequencer tool settings. These controls include:
- Snapping on/off
- Ability to snap to playhead and strip hold offset points
- Filter snap points by excluding sound or muted strips
- Control snapping distance
Snapping controls are placed in timeline header similar to 3D viewport
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D11646
|
|
Use const arguments to simplify further optimizations.
Transforming elements shouldn't need to change their containers
data-structures.
ElementResize for grease pencil stroke thickness was
modifying TransInfo.num & TransInfo.values_final.
Now copies are operated on to preserve const correctness although
it's worth investigating if this can be avoided altogether.
|
|
It wasn't so clear why the POINT_INIT check was disabled,
move this into the code comment.
|
|
of the header
This prevents the text from shaking while transforming.
|
|
|
|
|
|
Skip updating normals & tessellation for contiguous geometry regions
for operations such as translate & uniform scale.
This means when all geometry is selected, no updates are needed
as the relative locations of vertices aren't being modified.
Performance:
As this is skipping a multi-threaded operation,
larger improvements are noticeable on systems with fewer cores.
- ~1.15x to ~1.3x overall gain for 32 cores.
- ~1.7x to ~2.2x overall gain for 1 core (limited using `-t 1` argument).
Details:
- Rotate & non-uniform scale only skip tessellation.
- Proportional editing and axis-mirror have special handling
ensure geometry is properly grouped before considering
a face part of a single group that can be skipped.
- Loose vertices always need their normals to be recalculated
since they're calculated based on the location.
- Non-affine transform operations such as shrink-fatten & bend,
don't take advantage of this optimization.
- Snap projection also disables the optimization.
|
|
|
|
`t->values` does not necessarily represent a final value of the
transformation, as each mode treats this value differently.
So, unfortunately, we cannot have a generic offset solution for modal
transform operations. Offset needs to be handled by each mode.
Note: Currently only, `Move`, `Rotate` and `Resize` support this.
|
|
* Mark either all or no class methods with override
* Don't use zero sized array since it has a different size in C and C++.
Using a little more memory here is not significant.
* Don't use deprecated mechanism to mark private GSet members in clang
just like we don't for MSVC, it warns even for simple zero initialization.
|
|
|
|
|
|
|
|
This fixes T88346.
The code is also more readable by making a better distinction between
the texts used for Distances, "Proportional Size" and "AutoIK-Len".
And the text used to translate the "Proportional Size" is reused.
|
|
This makes it clearer that variables are strings and how they are used
in the Move header code.
|
|
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.
Differential Revision: https://developer.blender.org/D11663
Reviewed by Harley Acheson
|
|
Quaternion correction was not implemented and Euler values were being
incorrectly combined.
|
|
|
|
Remove `seq->tmp` usage from transform code. It was used to tag strips
that need to be "shuffled". Pass these strips in `SeqCollection`
instead.
Reviewed By: sergey, mano-wii
Differential Revision: https://developer.blender.org/D11631
|
|
|
|
Refactor function `freeSeqData` so it is readable.
One strip can have multiple transform operations defined. To prevent
processing strip multiple times, build `SeqCollection` and use
sequencer iterator instead of iterating `TransData` directly.
No functional changes.
Differential Revision: https://developer.blender.org/D11618
|
|
Reduce complexity of sequencer transform code by removing recursivity.
This is possible by treating meta strips (mostly) as any other strip and
containing all transform code within SEQ_ functions.
Unfortunately internally meta strips still require special treatment,
but all complexity from code all over transform code seems to be
possible to contain within one function.
Functional change:
Previously adjusting handle of single image strip moved animation.
Now animation is not moved, which is behavior for all other strips.
Reviewed By: sergey, mano-wii
Differential Revision: https://developer.blender.org/D11493
|
|
Some modes don't take into account that `TransData` may be in data space.
|
|
Starts scrolling when dragging a node or node link and going outside the current window.
Largely copied from the VIEW2D_OT_edge_pan operator.
Edge panning operator customdata and supporting functions now in
UI_view2d.h, so they could be used by operators in other editor
libraries. The VIEW2D_OT_edge_pan operator also uses this customdata and
shared functions now. Operators properties can be used to configure
edge panning margins and speed for each use case, rather than using
hardcoded values.
The speed function for edge panning has been tweaked somewhat:
* "Speed per pixel" has been replaced with a "speed ramp" distance.
This is more intuitive and also creates an upper bound for the speed,
which can otherwise become extreme with large cursor distance.
* "Max speed" is reached at the end of the speed ramp.
* Padding the region inside and outside is applied as before, but both
values are operator properties now.
Node transform operator also supports edge panning. This requires
an offset for changes in the view2d rect, otherwise nodes are "stuck"
to the original view.
Transform operator had cursor wrapping categorically enabled, but this
gets quite confusing with the edge scrolling mechanism. A new TransInfo
option T_NO_CURSOR_WRAP has been introduced to disable this behavior.
The double negative is a bit annoying, but want to avoid affecting the
existing transform modes, so by default it should still set the
OP_IS_MODAL_GRAB_CURSOR flag (which then sets the WM_CURSOR_WRAP_XY
flag during modal execution).
Reviewed By: HooglyBoogly, JacquesLucke
Differential Revision: https://developer.blender.org/D11073
|
|
Support calculating face normals when tessellating. When this is done
before updating vertex normals it gives ~20% performance improvement.
Now vertex normal calculation only needs to perform a single pass on the
mesh vertices when called after tessellation.
Extended versions of normal & looptri update functions have been added:
- BM_mesh_calc_tessellation_ex
- BM_mesh_normals_update_ex
Most callers don't need to be aware of this detail by using:
- BKE_editmesh_looptri_and_normals_calc
- BKE_editmesh_looptri_and_normals_calc_with_partial
- EDBM_update also takes advantage of this,
where calling EDBM_update with calc_looptri & calc_normals
enabled uses the faster normal updating logic.
|
|
These were limited to obvious cases. Some less obvious cases
were kept as refactoring might make them necessary in future.
|
|
The `recalcData` of "convert_mesh_edge" did more
than it was supposed to.
|
|
|
|
This field was used for extend feature to get handle position of
metastrip children. Since D9972 extend feature works only on meta
strip itself, not it's children.
So `SEQ_transform_get_left_handle_frame()` second argument is always
false and can be removed.
Another instance of `seq->tmp usage` is hack to distinguish strips to be
shuffled, which is not covered by this patch.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10321
|