33#include "RNA_prototypes.hh"
45 Array<float2> quad_orig;
48 float2 orig_origin_relative;
49 float2 orig_origin_pixelspace;
54 float active_seq_orig_rotation;
67 TransDataSeq *tdseq = MEM_new<TransDataSeq>(
"TransSeq TransDataSeq");
70 tdseq->orig_origin_pixelspace = origin;
74 tdseq->orig_translation[0] =
transform->xofs;
75 tdseq->orig_translation[1] =
transform->yofs;
76 tdseq->orig_scale[0] =
transform->scale_x;
77 tdseq->orig_scale[1] =
transform->scale_y;
78 tdseq->orig_rotation =
transform->rotation;
79 tdseq->orig_flag = strip->
flag;
81 tdseq->active_seq_orig_rotation =
ed->act_strip &&
ed->act_strip->data->
transform ?
85 td->
extra =
static_cast<void *
>(tdseq);
94 float vertex[2] = {origin[0], origin[1]};
99 if (vert_index == 1) {
103 else if (vert_index == 2) {
108 td2d->
loc[0] = vertex[0];
109 td2d->
loc[1] = vertex[1];
110 td2d->
loc2d =
nullptr;
114 td->
center[0] = origin[0];
115 td->
center[1] = origin[1];
124 if (vert_index == 0) {
140 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>((td +
i)->extra);
177 "TransSeq TransData2D");
179 for (
Strip *strip : strips) {
204 bool changed =
false;
208 C, scene, &
ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
213 C, scene, &
ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
216 C, scene, &
ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
221 C, scene, &
ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
224 C, scene, &
ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
244 float2 handle_x =
float2((td2d + 1)->loc) - handle_origin;
245 float2 handle_y =
float2((td2d + 2)->loc) - handle_origin;
248 float2 orig_strip_origin_pixelspace = tdseq->orig_origin_pixelspace;
250 return TransformResult{(orig_strip_origin_pixelspace - handle_origin) * mirror * aspect,
265 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>(td->
extra);
266 Strip *strip = tdseq->strip;
293 if (strip ==
ed->act_strip) {
294 transform->rotation = tdseq->orig_rotation;
297 transform->rotation = tdseq->orig_rotation + (2 * tdseq->active_seq_orig_rotation);
301 transform->rotation = tdseq->orig_rotation;
304 strip->
flag = tdseq->orig_flag;
325 Strip *strip = tdseq->strip;
330 transform->xofs = tdseq->orig_translation[0];
331 transform->yofs = tdseq->orig_translation[1];
337 return (quad_new[0] - tdseq->quad_orig[0]) * mirror / viewport_pixel_aspect;
343 Strip *strip = tdseq->strip;
350 const float2 origin = tdseq->orig_origin_pixelspace;
352 const float2 origin_pixelspace_unscaled = origin / viewport_pixel_aspect * mirror;
353 const float2 origin_translated = origin_pixelspace_unscaled - translation;
355 const float2 origin_abs = origin_raw_space + image_size / 2;
356 const float2 origin_rel = origin_abs / image_size;
369 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>(td->
extra);
370 Strip *strip = tdseq->strip;
379 transform->xofs = tdseq->orig_translation.x - delta_translation.x;
380 transform->yofs = tdseq->orig_translation.y - delta_translation.y;
406 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>(td->
extra);
407 Strip *strip = tdseq->strip;
410 transform->xofs = tdseq->orig_translation.x;
411 transform->yofs = tdseq->orig_translation.y;
412 transform->rotation = tdseq->orig_rotation;
413 transform->scale_x = tdseq->orig_scale.x;
414 transform->scale_y = tdseq->orig_scale.y;
415 transform->origin[0] = tdseq->orig_origin_relative.x;
416 transform->origin[1] = tdseq->orig_origin_relative.y;
417 strip->
flag = tdseq->orig_flag;
Functions to insert, delete or modify keyframes.
Scene * CTX_data_sequencer_scene(const bContext *C)
void unit_m3(float m[3][3])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void axis_angle_to_mat3_single(float R[3][3], char axis, float angle)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ AUTOKEY_FLAG_INSERTAVAILABLE
Read Guarded memory(de)allocation.
int64_t remove_if(Predicate &&predicate)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
bool is_autokey_on(const Scene *scene)
bool autokeyframe_property(bContext *C, Scene *scene, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, float cfra, bool only_if_property_keyed)
bool is_keying_flag(const Scene *scene, eKeying_Flag flag)
T length(const VecBase< T, Size > &a)
CartesianBasis invert(const CartesianBasis &basis)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
float2 transform_image_raw_size_get(const Scene *scene, const Strip *strip)
Array< float2 > image_transform_final_quad_get(const Scene *scene, const Strip *strip)
void relations_invalidate_cache(Scene *scene, Strip *strip)
ListBase * channels_displayed_get(const Editing *ed)
float3x3 image_transform_matrix_get(const Scene *scene, const Strip *strip)
Editing * editing_get(const Scene *scene)
float2 image_transform_mirror_factor_get(const Strip *strip)
float2 image_transform_origin_offset_pixelspace_get(const Scene *scene, const Strip *strip)
VectorSet< Strip * > query_rendered_strips(const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int displayed_channel)
ListBase * active_seqbase_get(const Editing *ed)
VecBase< float, 2 > float2
MatBase< float, 3, 3 > float3x3
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
struct ToolSettings * toolsettings
StripTransform * transform