2023-05-31 16:19:06 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-09-05 14:34:54 -03:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup edtransform
|
2020-02-07 10:02:11 -03:00
|
|
|
* \brief conversion and adaptation of different datablocks to a common struct.
|
2019-09-05 14:34:54 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-10-21 15:12:47 +02:00
|
|
|
#include "BLI_index_mask.hh"
|
|
|
|
|
|
2025-01-07 12:39:13 +01:00
|
|
|
#include "transform.hh"
|
|
|
|
|
|
2021-01-04 17:36:51 -03:00
|
|
|
struct BMEditMesh;
|
|
|
|
|
struct BMesh;
|
2021-02-18 14:14:17 +11:00
|
|
|
struct BezTriple;
|
2019-09-05 14:34:54 -03:00
|
|
|
struct ListBase;
|
|
|
|
|
struct Object;
|
|
|
|
|
struct TransData;
|
|
|
|
|
struct TransDataCurveHandleFlags;
|
|
|
|
|
struct TransInfo;
|
2019-09-09 20:50:11 +10:00
|
|
|
struct bContext;
|
2025-01-06 14:19:24 +01:00
|
|
|
struct Strip;
|
2019-09-05 14:34:54 -03:00
|
|
|
|
2024-12-10 10:16:56 +01:00
|
|
|
namespace blender::bke::crazyspace {
|
|
|
|
|
struct GeometryDeformation;
|
|
|
|
|
}
|
2025-01-16 23:17:51 +01:00
|
|
|
namespace blender::bke {
|
|
|
|
|
class CurvesGeometry;
|
|
|
|
|
}
|
2024-12-10 10:16:56 +01:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
namespace blender::ed::transform {
|
|
|
|
|
|
2023-07-13 17:59:52 +02:00
|
|
|
struct TransConvertTypeInfo {
|
2024-03-09 23:25:40 +11:00
|
|
|
int flags; /* #eTFlag. */
|
2022-07-21 23:44:39 -03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allocate and initialize `t->data`.
|
|
|
|
|
*/
|
2023-07-27 12:04:18 +10:00
|
|
|
void (*create_trans_data)(bContext *C, TransInfo *t);
|
2022-07-21 23:44:39 -03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Force recalculation of data during transformation.
|
|
|
|
|
*/
|
2023-07-27 12:04:18 +10:00
|
|
|
void (*recalc_data)(TransInfo *t);
|
2022-07-21 23:44:39 -03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when the operation is finished.
|
|
|
|
|
*/
|
|
|
|
|
void (*special_aftertrans_update)(bContext *C, TransInfo *t);
|
2023-07-13 17:59:52 +02:00
|
|
|
};
|
2022-07-21 23:44:39 -03:00
|
|
|
|
2024-03-06 13:26:05 -03:00
|
|
|
/**
|
|
|
|
|
* Structure used for Edge Slide operation.
|
2024-03-12 10:04:07 -03:00
|
|
|
* The data is filled based on the 'transform_convert_' type.
|
2024-03-06 13:26:05 -03:00
|
|
|
*/
|
|
|
|
|
struct TransDataEdgeSlideVert {
|
2024-02-22 01:31:30 -03:00
|
|
|
TransData *td;
|
2025-02-18 01:27:04 +01:00
|
|
|
float3 dir_side[2]; /* Directional vectors on the sides. */
|
|
|
|
|
float edge_len; /* Distance between vectors. */
|
|
|
|
|
int loop_nr; /* Number that identifies the group of connected edges. */
|
2024-02-22 01:31:30 -03:00
|
|
|
|
|
|
|
|
const float *v_co_orig() const
|
|
|
|
|
{
|
|
|
|
|
return this->td->iloc;
|
|
|
|
|
}
|
2024-03-06 13:26:05 -03:00
|
|
|
};
|
|
|
|
|
|
2024-03-06 10:50:39 -03:00
|
|
|
/**
|
|
|
|
|
* Structure used for Vert Slide operation.
|
2024-03-12 10:04:07 -03:00
|
|
|
* The data is filled based on the 'transform_convert_' type.
|
2024-03-06 10:50:39 -03:00
|
|
|
*/
|
|
|
|
|
struct TransDataVertSlideVert {
|
2024-02-22 01:31:30 -03:00
|
|
|
TransData *td;
|
2025-02-18 01:27:04 +01:00
|
|
|
Span<float3> co_link_orig_3d; /* Target locations. */
|
2024-03-06 10:50:39 -03:00
|
|
|
int co_link_curr;
|
2024-02-22 01:31:30 -03:00
|
|
|
|
|
|
|
|
const float *co_orig_3d() const
|
|
|
|
|
{
|
|
|
|
|
return this->td->iloc;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
const float3 &co_dest_3d() const
|
2024-02-22 01:31:30 -03:00
|
|
|
{
|
|
|
|
|
return this->co_link_orig_3d[this->co_link_curr];
|
|
|
|
|
}
|
2024-03-06 10:50:39 -03:00
|
|
|
};
|
|
|
|
|
|
2024-04-22 20:02:52 +02:00
|
|
|
/**
|
|
|
|
|
* Structure used for curves transform operation.
|
|
|
|
|
* Used for both curves and grease pencil objects.
|
|
|
|
|
*/
|
|
|
|
|
struct CurvesTransformData {
|
2025-02-18 01:27:04 +01:00
|
|
|
IndexMaskMemory memory;
|
|
|
|
|
Vector<IndexMask> selection_by_layer;
|
2025-07-04 11:27:14 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Masks of aligned points per curve.
|
|
|
|
|
* curves objects will only use the first element.
|
|
|
|
|
*/
|
|
|
|
|
Vector<IndexMask> aligned_with_left;
|
|
|
|
|
Vector<IndexMask> aligned_with_right;
|
2024-04-22 20:02:52 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The offsets of every grease pencil layer into `positions` array.
|
2024-04-26 09:32:26 +02:00
|
|
|
* For curves layers are used to store: positions, handle_positions_left and
|
|
|
|
|
* handle_positions_right.
|
2024-04-22 20:02:52 +02:00
|
|
|
*/
|
2025-02-18 01:27:04 +01:00
|
|
|
Vector<int> layer_offsets;
|
2024-04-22 20:02:52 +02:00
|
|
|
|
2024-12-09 10:40:08 +01:00
|
|
|
/**
|
|
|
|
|
* Grease pencil multi-frame editing falloff. One value for each drawing in a
|
|
|
|
|
* `TransDataContainer`.
|
|
|
|
|
*/
|
2025-02-18 01:27:04 +01:00
|
|
|
Vector<float> grease_pencil_falloffs;
|
2024-12-09 10:40:08 +01:00
|
|
|
|
2024-04-22 20:02:52 +02:00
|
|
|
/**
|
|
|
|
|
* Copy of all positions being transformed.
|
|
|
|
|
*/
|
2025-02-18 01:27:04 +01:00
|
|
|
Array<float3> positions;
|
2024-04-22 20:02:52 +02:00
|
|
|
};
|
|
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Change the chain-length of auto-IK.
|
|
|
|
|
*/
|
2019-09-05 14:34:54 -03:00
|
|
|
void transform_autoik_update(TransInfo *t, short mode);
|
|
|
|
|
int special_transform_moving(TransInfo *t);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Inserting keys, point-cache, redraw events.
|
|
|
|
|
*/
|
2023-07-13 17:59:52 +02:00
|
|
|
void special_aftertrans_update(bContext *C, TransInfo *t);
|
2019-09-05 14:34:54 -03:00
|
|
|
void sort_trans_data_dist(TransInfo *t);
|
2023-07-27 12:04:18 +10:00
|
|
|
void create_trans_data(bContext *C, TransInfo *t);
|
2019-09-05 14:34:54 -03:00
|
|
|
void clipUVData(TransInfo *t);
|
2022-01-07 11:38:08 +11:00
|
|
|
void transform_convert_flush_handle2D(TransData *td, TransData2D *td2d, float y_fac);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Called for updating while transform acts, once per redraw.
|
|
|
|
|
*/
|
2023-07-27 12:04:18 +10:00
|
|
|
void recalc_data(TransInfo *t);
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mesh.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2021-04-24 10:46:46 -03:00
|
|
|
void transform_convert_mesh_customdatacorrect_init(TransInfo *t);
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_sequencer.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
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
|
|
|
bool transform_convert_sequencer_clamp(const TransInfo *t, float r_val[2]);
|
2021-06-29 20:12:19 +02:00
|
|
|
|
2019-09-05 14:34:54 -03:00
|
|
|
/********************* intern **********************/
|
|
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2020-05-15 22:48:00 +10:00
|
|
|
bool transform_mode_use_local_origins(const TransInfo *t);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
2025-06-02 17:13:56 -04:00
|
|
|
* Transforming around ourselves is no use, fall back to individual origins,
|
2021-12-09 00:55:11 +11:00
|
|
|
* useful for curve/armatures.
|
|
|
|
|
*/
|
2020-06-15 01:07:59 +10:00
|
|
|
void transform_around_single_fallback_ex(TransInfo *t, int data_len_all);
|
2019-09-05 14:34:54 -03:00
|
|
|
void transform_around_single_fallback(TransInfo *t);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Little helper function for ObjectToTransData used to give certain
|
|
|
|
|
* constraints (ChildOf, FollowPath, and others that may be added)
|
|
|
|
|
* inverse corrections for transform, so that they aren't in CrazySpace.
|
|
|
|
|
* These particular constraints benefit from this, but others don't, hence
|
|
|
|
|
* this semi-hack ;-) - Aligorith
|
|
|
|
|
*/
|
2019-09-05 14:34:54 -03:00
|
|
|
bool constraints_list_needinv(TransInfo *t, ListBase *list);
|
2020-07-15 12:28:32 +02:00
|
|
|
void calc_distanceCurveVerts(TransData *head, TransData *tail, bool cyclic);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Utility function for getting the handle data from bezier's.
|
|
|
|
|
*/
|
2023-07-13 17:59:52 +02:00
|
|
|
TransDataCurveHandleFlags *initTransDataCurveHandles(TransData *td, BezTriple *bezt);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Used for `TFM_TIME_EXTEND`.
|
|
|
|
|
*/
|
2020-04-27 11:42:18 -03:00
|
|
|
char transform_convert_frame_side_dir_get(TransInfo *t, float cframe);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* This function tests if a point is on the "mouse" side of the cursor/frame-marking.
|
|
|
|
|
*/
|
2019-09-05 14:34:54 -03:00
|
|
|
bool FrameOnMouseSide(char side, float frame, float cframe);
|
2021-04-24 11:15:55 -03:00
|
|
|
void transform_convert_clip_mirror_modifier_apply(TransDataContainer *tc);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* For the realtime animation recording feature, handle overlapping data.
|
|
|
|
|
*/
|
2023-07-13 17:59:52 +02:00
|
|
|
void animrecord_check_state(TransInfo *t, ID *id);
|
2019-09-05 14:34:54 -03:00
|
|
|
|
2023-10-21 15:12:47 +02:00
|
|
|
/* `transform_convert_curves.cc` */
|
|
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
namespace curves {
|
|
|
|
|
|
2023-10-21 15:12:47 +02:00
|
|
|
/**
|
2025-07-04 11:27:14 +02:00
|
|
|
* Used for both curves and Grease Pencil objects.
|
2023-10-21 15:12:47 +02:00
|
|
|
*/
|
2025-02-18 01:27:04 +01:00
|
|
|
void curve_populate_trans_data_structs(const TransInfo &t,
|
|
|
|
|
TransDataContainer &tc,
|
|
|
|
|
bke::CurvesGeometry &curves,
|
|
|
|
|
const float4x4 &transform,
|
|
|
|
|
const bke::crazyspace::GeometryDeformation &deformation,
|
|
|
|
|
std::optional<MutableSpan<float>> value_attribute,
|
2025-07-04 10:51:56 +02:00
|
|
|
Span<IndexMask> points_to_transform_per_attr,
|
2025-02-18 01:27:04 +01:00
|
|
|
const IndexMask &affected_curves,
|
|
|
|
|
bool use_connected_only,
|
|
|
|
|
const IndexMask &bezier_curves,
|
|
|
|
|
void *extra = nullptr);
|
2023-10-21 15:12:47 +02:00
|
|
|
|
2024-04-22 20:02:52 +02:00
|
|
|
CurvesTransformData *create_curves_transform_custom_data(TransCustomData &custom_data);
|
|
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
void copy_positions_from_curves_transform_custom_data(const TransCustomData &custom_data,
|
2025-07-04 10:51:56 +02:00
|
|
|
int layer,
|
2025-02-18 01:27:04 +01:00
|
|
|
MutableSpan<float3> positions_dst);
|
|
|
|
|
|
2025-07-04 11:27:14 +02:00
|
|
|
void create_aligned_handles_masks(const bke::CurvesGeometry &curves,
|
|
|
|
|
Span<IndexMask> points_to_transform_per_attr,
|
|
|
|
|
int curve_index,
|
|
|
|
|
TransCustomData &custom_data);
|
|
|
|
|
void calculate_aligned_handles(const TransCustomData &custom_data,
|
|
|
|
|
bke::CurvesGeometry &curves,
|
|
|
|
|
int curve_index);
|
2025-08-13 18:54:43 +02:00
|
|
|
bool update_handle_types_for_transform(eTfmMode mode,
|
2025-07-08 11:56:46 -04:00
|
|
|
const std::array<IndexMask, 3> &selection_per_attribute,
|
2025-08-13 18:54:43 +02:00
|
|
|
const IndexMask &bezier_points,
|
|
|
|
|
bke::CurvesGeometry &curves);
|
2025-07-04 11:27:14 +02:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
} // namespace curves
|
2024-04-22 20:02:52 +02:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_action.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Action;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_armature.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_EditArmature;
|
|
|
|
|
extern TransConvertTypeInfo TransConvertType_Pose;
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Sets transform flags in the bones.
|
|
|
|
|
* Returns total number of bones with #BONE_TRANSFORM.
|
|
|
|
|
*/
|
2022-02-01 18:38:26 -03:00
|
|
|
void transform_convert_pose_transflags_update(Object *ob, int mode, short around);
|
|
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_cursor.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_CursorImage;
|
|
|
|
|
extern TransConvertTypeInfo TransConvertType_CursorSequencer;
|
|
|
|
|
extern TransConvertTypeInfo TransConvertType_Cursor3D;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_curve.cc` */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Curve;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-10-21 15:12:47 +02:00
|
|
|
/* `transform_convert_curves.cc` */
|
2023-01-21 20:38:36 +01:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
namespace curves {
|
2023-01-21 20:38:36 +01:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Curves;
|
2025-02-18 01:27:04 +01:00
|
|
|
}
|
2023-01-21 20:38:36 +01:00
|
|
|
|
2025-02-19 17:11:08 +01:00
|
|
|
/* `transform_convert_pointcloud.cc` */
|
2025-02-16 23:25:22 -05:00
|
|
|
|
2025-02-19 17:11:08 +01:00
|
|
|
namespace pointcloud {
|
2025-02-16 23:25:22 -05:00
|
|
|
extern TransConvertTypeInfo TransConvertType_PointCloud;
|
2025-02-18 01:27:04 +01:00
|
|
|
}
|
2025-02-16 23:25:22 -05:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_graph.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Graph;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-10-21 15:12:47 +02:00
|
|
|
/* `transform_convert_greasepencil.cc` */
|
|
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
namespace greasepencil {
|
2023-10-21 15:12:47 +02:00
|
|
|
extern TransConvertTypeInfo TransConvertType_GreasePencil;
|
2025-02-18 01:27:04 +01:00
|
|
|
}
|
2023-10-21 15:12:47 +02:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_lattice.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Lattice;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mask.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Mask;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mball.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_MBall;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mesh.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Mesh;
|
|
|
|
|
|
2021-01-04 17:36:51 -03:00
|
|
|
struct TransIslandData {
|
|
|
|
|
float (*center)[3];
|
|
|
|
|
float (*axismtx)[3][3];
|
|
|
|
|
int island_tot;
|
|
|
|
|
int *island_vert_map;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct MirrorDataVert {
|
|
|
|
|
int index;
|
|
|
|
|
int flag;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct TransMirrorData {
|
2023-07-13 17:59:52 +02:00
|
|
|
MirrorDataVert *vert_map;
|
2021-01-04 17:36:51 -03:00
|
|
|
int mirror_elem_len;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct TransMeshDataCrazySpace {
|
|
|
|
|
float (*quats)[4];
|
2025-02-18 01:27:04 +01:00
|
|
|
Array<float3x3, 0> defmats;
|
2021-01-04 17:36:51 -03:00
|
|
|
};
|
|
|
|
|
|
2023-07-13 17:59:52 +02:00
|
|
|
void transform_convert_mesh_islands_calc(BMEditMesh *em,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool calc_single_islands,
|
|
|
|
|
bool calc_island_center,
|
|
|
|
|
bool calc_island_axismtx,
|
2023-07-13 17:59:52 +02:00
|
|
|
TransIslandData *r_island_data);
|
|
|
|
|
void transform_convert_mesh_islanddata_free(TransIslandData *island_data);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \param mtx: Measure distance in this space.
|
|
|
|
|
* \param dists: Store the closest connected distance to selected vertices.
|
|
|
|
|
* \param index: Optionally store the original index we're measuring the distance to (can be NULL).
|
|
|
|
|
*/
|
2023-07-13 17:59:52 +02:00
|
|
|
void transform_convert_mesh_connectivity_distance(BMesh *bm,
|
2021-01-04 17:36:51 -03:00
|
|
|
const float mtx[3][3],
|
|
|
|
|
float *dists,
|
|
|
|
|
int *index);
|
2023-07-13 17:59:52 +02:00
|
|
|
void transform_convert_mesh_mirrordata_calc(BMEditMesh *em,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool use_select,
|
|
|
|
|
bool use_topology,
|
2021-01-04 17:36:51 -03:00
|
|
|
const bool mirror_axis[3],
|
2023-07-13 17:59:52 +02:00
|
|
|
TransMirrorData *r_mirror_data);
|
|
|
|
|
void transform_convert_mesh_mirrordata_free(TransMirrorData *mirror_data);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
2023-07-16 15:50:02 +10:00
|
|
|
* Detect CrazySpace (Blender term).
|
|
|
|
|
* Vertices with space affected by quaternions are marked with #BM_ELEM_TAG.
|
2021-12-09 00:55:11 +11:00
|
|
|
*/
|
2021-01-04 17:36:51 -03:00
|
|
|
void transform_convert_mesh_crazyspace_detect(TransInfo *t,
|
2023-07-13 17:59:52 +02:00
|
|
|
TransDataContainer *tc,
|
|
|
|
|
BMEditMesh *em,
|
|
|
|
|
TransMeshDataCrazySpace *r_crazyspace_data);
|
2021-01-04 17:36:51 -03:00
|
|
|
void transform_convert_mesh_crazyspace_transdata_set(const float mtx[3][3],
|
|
|
|
|
const float smtx[3][3],
|
|
|
|
|
const float defmat[3][3],
|
|
|
|
|
const float quat[4],
|
2023-07-13 17:59:52 +02:00
|
|
|
TransData *r_td);
|
|
|
|
|
void transform_convert_mesh_crazyspace_free(TransMeshDataCrazySpace *r_crazyspace_data);
|
2021-01-04 17:36:51 -03:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
Array<TransDataVertSlideVert> transform_mesh_vert_slide_data_create(
|
|
|
|
|
const TransDataContainer *tc, Vector<float3> &r_loc_dst_buffer);
|
2024-03-06 10:50:39 -03:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
Array<TransDataEdgeSlideVert> transform_mesh_edge_slide_data_create(const TransDataContainer *tc,
|
|
|
|
|
int *r_group_len);
|
2024-03-06 13:26:05 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mesh_edge.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_MeshEdge;
|
2020-06-06 10:57:05 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mesh_skin.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_MeshSkin;
|
2021-01-04 17:36:51 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mesh_uv.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_MeshUV;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
Array<TransDataVertSlideVert> transform_mesh_uv_vert_slide_data_create(
|
|
|
|
|
const TransInfo *t, TransDataContainer *tc, Vector<float3> &r_loc_dst_buffer);
|
2024-03-12 10:04:07 -03:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
Array<TransDataEdgeSlideVert> transform_mesh_uv_edge_slide_data_create(const TransInfo *t,
|
|
|
|
|
TransDataContainer *tc,
|
|
|
|
|
int *r_group_len);
|
2024-03-12 10:04:07 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_mesh_vert_cdata.cc` */
|
2022-07-19 11:43:38 -03:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_MeshVertCData;
|
2022-07-19 11:43:38 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_nla.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_NLA;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2024-03-09 23:25:40 +11:00
|
|
|
/* `transform_convert_node.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Node;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_object.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Object;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_object_texspace.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_ObjectTexSpace;
|
2021-02-06 16:37:16 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_paintcurve.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_PaintCurve;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_particle.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Particle;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2024-03-09 23:25:40 +11:00
|
|
|
/* `transform_convert_sculpt.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Sculpt;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_sequencer.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Sequencer;
|
2020-02-07 10:02:11 -03:00
|
|
|
|
2025-02-18 01:27:04 +01:00
|
|
|
bool seq_transform_check_overlap(Span<Strip *> transformed_strips);
|
2024-07-10 02:21:14 +02:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_sequencer_image.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_SequencerImage;
|
2021-09-21 09:38:30 +02:00
|
|
|
|
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
|
|
|
/* `transform_convert_sequencer_retiming.cc` */
|
|
|
|
|
|
|
|
|
|
extern TransConvertTypeInfo TransConvertType_SequencerRetiming;
|
|
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_tracking.cc` */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2022-07-21 23:44:39 -03:00
|
|
|
extern TransConvertTypeInfo TransConvertType_Tracking;
|
2022-10-11 18:01:08 -05:00
|
|
|
|
2023-07-31 11:50:54 +10:00
|
|
|
/* `transform_convert_tracking_curves.cc` */
|
2023-03-06 19:24:56 -03:00
|
|
|
|
|
|
|
|
extern TransConvertTypeInfo TransConvertType_TrackingCurves;
|
2025-02-18 01:27:04 +01:00
|
|
|
|
|
|
|
|
} // namespace blender::ed::transform
|