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]};
98 if (vert_index == 1) {
102 else if (vert_index == 2) {
109 td2d->loc2d =
nullptr;
113 td->
center[0] = origin[0];
114 td->
center[1] = origin[1];
123 if (vert_index == 0) {
138 for (
int i = 0; i < tc->
data_len; i += 3) {
139 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>((td + i)->extra);
176 "TransSeq TransData2D");
178 for (
Strip *strip : strips) {
203 bool changed =
false;
207 C, scene, &ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
212 C, scene, &ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
215 C, scene, &ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
220 C, scene, &ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
223 C, scene, &ptr, prop, -1, scene->
r.
cfra, only_when_keyed);
243 float2 handle_x =
float2((td2d + 1)->loc) - handle_origin;
244 float2 handle_y =
float2((td2d + 2)->loc) - handle_origin;
247 float2 orig_strip_origin_pixelspace = tdseq->orig_origin_pixelspace;
249 return TransformResult{(orig_strip_origin_pixelspace - handle_origin) * mirror * aspect,
263 for (i = 0, td = tc->
data, td2d = tc->
data_2d; i < tc->data_len; i += 3, td += 3, td2d += 3) {
264 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>(td->
extra);
265 Strip *strip = tdseq->strip;
292 if (strip ==
ed->act_strip) {
293 transform->rotation = tdseq->orig_rotation;
296 transform->rotation = tdseq->orig_rotation + (2 * tdseq->active_seq_orig_rotation);
300 transform->rotation = tdseq->orig_rotation;
303 strip->flag = tdseq->orig_flag;
324 Strip *strip = tdseq->strip;
329 transform->xofs = tdseq->orig_translation[0];
330 transform->yofs = tdseq->orig_translation[1];
336 return (quad_new[0] - tdseq->quad_orig[0]) * mirror / viewport_pixel_aspect;
342 Strip *strip = tdseq->strip;
349 const float2 origin = tdseq->orig_origin_pixelspace;
351 const float2 origin_translated = origin - translation * viewport_pixel_aspect * mirror;
353 const float2 origin_abs = origin_raw_space + box_size / 2;
354 const float2 origin_rel = origin_abs / box_size;
366 for (i = 0, td = tc->
data, td2d = tc->
data_2d; i < tc->data_len; i += 3, td += 3, td2d += 3) {
367 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>(td->
extra);
368 Strip *strip = tdseq->strip;
377 transform->xofs = tdseq->orig_translation.x - delta_translation.x;
378 transform->yofs = tdseq->orig_translation.y - delta_translation.y;
402 for (i = 0, td = tc->
data; i < tc->data_len; i += 3, td += 3) {
403 TransDataSeq *tdseq =
static_cast<TransDataSeq *
>(td->
extra);
404 Strip *strip = tdseq->strip;
407 transform->xofs = tdseq->orig_translation.x;
408 transform->yofs = tdseq->orig_translation.y;
409 transform->rotation = tdseq->orig_rotation;
410 transform->scale_x = tdseq->orig_scale.x;
411 transform->scale_y = tdseq->orig_scale.y;
412 transform->origin[0] = tdseq->orig_origin_relative.x;
413 transform->origin[1] = tdseq->orig_origin_relative.y;
414 strip->flag = tdseq->orig_flag;
Functions to insert, delete or modify keyframes.
Read Blender memory allocation and freeing.
int64_t remove_if(Predicate &&predicate)
const T & data(const Action &owning_action) const
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)
int2 image_transform_box_size_get(const Scene *scene, const Strip *strip)
float2 image_transform_mirror_factor_get(const Strip *strip)
void relations_invalidate_cache(Scene *scene, Strip *strip)
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
Array< float2 > image_transform_quad_get(const Scene *scene, const Strip *strip)
Editing * editing_get(const Scene *scene)
float3x3 image_transform_matrix_get(const Scene *scene, const Strip *strip)
float2 image_transform_origin_preview_offset_get(const Scene *scene, const Strip *strip)
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
VectorSet< Strip * > query_rendered_strips(const Scene *scene, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbase, const int timeline_frame, const int displayed_channel)
Scene * CTX_data_sequencer_scene(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
@ SEQ_VIEW_SEQUENCE_PREVIEW
VecBase< float, 2 > float2
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
MatBase< float, 3, 3 > float3x3
void unit_m3(float m[3][3])
@ AUTOKEY_FLAG_INSERTAVAILABLE
void axis_angle_to_mat3_single(float R[3][3], char axis, float angle)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
struct ToolSettings * toolsettings
ListBaseT< SpaceLink > spacedata
eSpaceSeq_RegionType mainb