Cleanup: VSE: Rename deprecated DNA fields with _legacy suffix

No functional changes intended.
This commit is contained in:
John Kiril Swenson
2025-08-04 23:17:52 -05:00
committed by John Kiril Swenson
parent cedf2d9949
commit 54c63c4138
10 changed files with 54 additions and 44 deletions

View File

@@ -2077,14 +2077,15 @@ struct Seq_callback_data {
static bool strip_convert_callback(Strip *strip, void *userdata)
{
IpoCurve *icu = static_cast<IpoCurve *>((strip->ipo) ? strip->ipo->curve.first : nullptr);
IpoCurve *icu = static_cast<IpoCurve *>((strip->ipo_legacy) ? strip->ipo_legacy->curve.first :
nullptr);
short adrcode = STRIP_FAC1;
if (G.debug & G_DEBUG) {
printf("\tconverting sequence strip %s\n", strip->name + 2);
}
if (ELEM(nullptr, strip->ipo, icu)) {
if (ELEM(nullptr, strip->ipo_legacy, icu)) {
strip->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
return true;
}
@@ -2107,14 +2108,14 @@ static bool strip_convert_callback(Strip *strip, void *userdata)
Seq_callback_data *cd = (Seq_callback_data *)userdata;
/* convert IPO */
ipo_to_animdata(cd->bmain, (ID *)cd->scene, strip->ipo, nullptr, nullptr, strip);
ipo_to_animdata(cd->bmain, (ID *)cd->scene, strip->ipo_legacy, nullptr, nullptr, strip);
if (cd->adt->action && !blender::animrig::versioning::action_is_layered(*cd->adt->action)) {
cd->adt->action->idroot = ID_SCE; /* scene-rooted */
}
id_us_min(&strip->ipo->id);
strip->ipo = nullptr;
id_us_min(&strip->ipo_legacy->id);
strip->ipo_legacy = nullptr;
return true;
}

View File

@@ -810,7 +810,7 @@ static bool strip_foreach_member_id_cb(Strip *strip, void *user_data)
}
if (flag & IDWALK_DO_DEPRECATED_POINTERS) {
FOREACHID_PROCESS_ID_NOCHECK(data, strip->ipo, IDWALK_CB_USER);
FOREACHID_PROCESS_ID_NOCHECK(data, strip->ipo_legacy, IDWALK_CB_USER);
}
#undef FOREACHID_PROCESS_IDSUPER

View File

@@ -648,7 +648,7 @@ static bool strip_set_sat_cb(Strip *strip, void * /*user_data*/)
static bool strip_set_pitch_cb(Strip *strip, void * /*user_data*/)
{
strip->pitch = 1.0f;
strip->pitch_legacy = 1.0f;
return true;
}

View File

@@ -1028,12 +1028,12 @@ static bool strip_colorbalance_update_cb(Strip *strip, void * /*user_data*/)
{
StripData *data = strip->data;
if (data && data->color_balance) {
if (data && data->color_balance_legacy) {
StripModifierData *smd = blender::seq::modifier_new(
strip, nullptr, seqModifierType_ColorBalance);
ColorBalanceModifierData *cbmd = (ColorBalanceModifierData *)smd;
cbmd->color_balance = *data->color_balance;
cbmd->color_balance = *data->color_balance_legacy;
/* multiplication with color balance used is handled differently,
* so we need to move multiplication to modifier so files would be
@@ -1042,8 +1042,8 @@ static bool strip_colorbalance_update_cb(Strip *strip, void * /*user_data*/)
cbmd->color_multiply = strip->mul;
strip->mul = 1.0f;
MEM_freeN(data->color_balance);
data->color_balance = nullptr;
MEM_freeN(data->color_balance_legacy);
data->color_balance_legacy = nullptr;
}
return true;
}

View File

@@ -428,48 +428,49 @@ static void do_versions_sequencer_speed_effect_recursive(Scene *scene, const Lis
if (strip->type == STRIP_TYPE_SPEED) {
SpeedControlVars *v = (SpeedControlVars *)strip->effectdata;
const char *substr = nullptr;
float globalSpeed = v->globalSpeed;
float globalSpeed_legacy = v->globalSpeed_legacy;
if (strip->flag & SEQ_USE_EFFECT_DEFAULT_FADE) {
if (globalSpeed == 1.0f) {
if (globalSpeed_legacy == 1.0f) {
v->speed_control_type = SEQ_SPEED_STRETCH;
}
else {
v->speed_control_type = SEQ_SPEED_MULTIPLY;
v->speed_fader = globalSpeed * (float(strip->input1->len) /
max_ff(float(blender::seq::time_right_handle_frame_get(
scene, strip->input1) -
strip->input1->start),
1.0f));
v->speed_fader = globalSpeed_legacy *
(float(strip->input1->len) /
max_ff(float(blender::seq::time_right_handle_frame_get(scene,
strip->input1) -
strip->input1->start),
1.0f));
}
}
else if (v->flags & STRIP_SPEED_INTEGRATE) {
v->speed_control_type = SEQ_SPEED_MULTIPLY;
v->speed_fader = strip->speed_fader * globalSpeed;
v->speed_fader = strip->speed_fader_legacy * globalSpeed_legacy;
}
else if (v->flags & STRIP_SPEED_COMPRESS_IPO_Y) {
globalSpeed *= 100.0f;
globalSpeed_legacy *= 100.0f;
v->speed_control_type = SEQ_SPEED_LENGTH;
v->speed_fader_length = strip->speed_fader * globalSpeed;
v->speed_fader_length = strip->speed_fader_legacy * globalSpeed_legacy;
substr = "speed_length";
}
else {
v->speed_control_type = SEQ_SPEED_FRAME_NUMBER;
v->speed_fader_frame_number = int(strip->speed_fader * globalSpeed);
v->speed_fader_frame_number = int(strip->speed_fader_legacy * globalSpeed_legacy);
substr = "speed_frame_number";
}
v->flags &= ~(STRIP_SPEED_INTEGRATE | STRIP_SPEED_COMPRESS_IPO_Y);
if (substr || globalSpeed != 1.0f) {
if (substr || globalSpeed_legacy != 1.0f) {
FCurve *fcu = id_data_find_fcurve(
&scene->id, strip, &RNA_Strip, "speed_factor", 0, nullptr);
if (fcu) {
if (globalSpeed != 1.0f) {
if (globalSpeed_legacy != 1.0f) {
for (int i = 0; i < fcu->totvert; i++) {
BezTriple *bezt = &fcu->bezt[i];
bezt->vec[0][1] *= globalSpeed;
bezt->vec[1][1] *= globalSpeed;
bezt->vec[2][1] *= globalSpeed;
bezt->vec[0][1] *= globalSpeed_legacy;
bezt->vec[1][1] *= globalSpeed_legacy;
bezt->vec[2][1] *= globalSpeed_legacy;
}
}
if (substr) {
@@ -665,11 +666,11 @@ static bool strip_speed_factor_set(Strip *strip, void *user_data)
}
/* Pitch value of 0 has been found in some files. This would cause problems. */
if (strip->pitch <= 0.0f) {
strip->pitch = 1.0f;
if (strip->pitch_legacy <= 0.0f) {
strip->pitch_legacy = 1.0f;
}
strip->speed_factor = strip->pitch;
strip->speed_factor = strip->pitch_legacy;
}
else {
strip->speed_factor = 1.0f;
@@ -1743,10 +1744,10 @@ static void version_node_tree_socket_id_delim(bNodeTree *ntree)
static bool version_merge_still_offsets(Strip *strip, void * /*user_data*/)
{
strip->startofs -= strip->startstill;
strip->endofs -= strip->endstill;
strip->startstill = 0;
strip->endstill = 0;
strip->startofs -= strip->startstill_legacy;
strip->endofs -= strip->endstill_legacy;
strip->startstill_legacy = 0;
strip->endstill_legacy = 0;
return true;
}

View File

@@ -542,7 +542,7 @@ static bool versioning_convert_seq_text_anchor(Strip *strip, void * /*user_data*
TextVars *data = static_cast<TextVars *>(strip->effectdata);
data->anchor_x = data->align;
data->anchor_y = data->align_y;
data->anchor_y = data->align_y_legacy;
data->align = SEQ_TEXT_ALIGN_X_LEFT;
return true;

View File

@@ -2008,7 +2008,7 @@ static wmOperatorStatus sequencer_separate_images_exec(bContext *C, wmOperator *
Strip *strip_next;
/* TODO: remove f-curve and assign to split image strips.
* The old animation system would remove the user of `strip->ipo`. */
* The old animation system would remove the user of `strip->ipo_legacy`. */
start_ofs = timeline_frame = seq::time_left_handle_frame_get(scene, strip);
frame_end = seq::time_right_handle_frame_get(scene, strip);

View File

@@ -137,7 +137,7 @@ typedef struct StripData {
StripCrop *crop;
StripTransform *transform;
/* Replaced by #ColorBalanceModifierData::color_balance in 2.64. */
StripColorBalance *color_balance DNA_DEPRECATED;
StripColorBalance *color_balance_legacy DNA_DEPRECATED;
/* Color management */
ColorManagedColorspaceSettings colorspace_settings;
@@ -191,7 +191,7 @@ typedef struct Strip {
*/
float startofs, endofs;
/** Replaced by `startofs` and `endofs` in 3.3. */
float startstill DNA_DEPRECATED, endstill DNA_DEPRECATED;
float startstill_legacy DNA_DEPRECATED, endstill_legacy DNA_DEPRECATED;
/** The current channel index of the strip in the timeline. */
int channel;
/** Starting and ending points of the effect strip. Undefined for other strip types. */
@@ -209,7 +209,7 @@ typedef struct Strip {
StripData *data;
/** Old animation system, deprecated for 2.5. */
struct Ipo *ipo DNA_DEPRECATED;
struct Ipo *ipo_legacy DNA_DEPRECATED;
/** These ID vars should never be NULL but can be when linked libraries fail to load,
* so check on access. */
@@ -227,7 +227,7 @@ typedef struct Strip {
/** Only for transition effect strips. Allows keyframing custom fade progression over time. */
float effect_fader;
/** Moved to #SpeedControlVars::speed_fader in 3.0. */
float speed_fader DNA_DEPRECATED;
float speed_fader_legacy DNA_DEPRECATED;
/** Effect strip inputs (`nullptr` if not an effect strip). */
struct Strip *input1, *input2;
@@ -253,7 +253,7 @@ typedef struct Strip {
/** Pitch ranges from -0.1 to 10, replaced in 3.3 with #Strip::speed_factor on sound strips.
* Pan ranges from -2 to 2. */
float pitch DNA_DEPRECATED, pan;
float pitch_legacy DNA_DEPRECATED, pan;
float strobe;
float sound_offset;
@@ -412,7 +412,7 @@ typedef struct SolidColorVars {
typedef struct SpeedControlVars {
float *frameMap;
/** Replaced by `speed_fader_*` fields in 3.0. */
float globalSpeed;
float globalSpeed_legacy DNA_DEPRECATED;
int flags; /* eEffectSpeedControlFlags */
int speed_control_type; /* eEffectSpeedControlType */
@@ -466,7 +466,7 @@ typedef struct TextVars {
int selection_end_offset;
/** Replaced by `anchor_y` in 4.4. */
char align_y DNA_DEPRECATED /* eEffectTextAlignY */;
char align_y_legacy DNA_DEPRECATED; /* eEffectTextAlignY */
char anchor_x; /* eEffectTextAlignX */
char anchor_y; /* eEffectTextAlignY */
char _pad1;

View File

@@ -199,13 +199,20 @@ DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, shadow_cube_size, shadow_cube_size_deprecat
DNA_STRUCT_RENAME_MEMBER(Sculpt, radial_symm, radial_symm_legacy)
DNA_STRUCT_RENAME_MEMBER(SpaceImage, pixel_snap_mode, pixel_round_mode)
DNA_STRUCT_RENAME_MEMBER(SpaceSeq, overlay_type, overlay_frame_type)
DNA_STRUCT_RENAME_MEMBER(SpeedControlVars, globalSpeed, globalSpeed_legacy)
DNA_STRUCT_RENAME_MEMBER(Strip, endstill, endstill_legacy)
DNA_STRUCT_RENAME_MEMBER(Strip, ipo, ipo_legacy)
DNA_STRUCT_RENAME_MEMBER(Strip, machine, channel)
DNA_STRUCT_RENAME_MEMBER(Strip, pitch, pitch_legacy)
DNA_STRUCT_RENAME_MEMBER(Strip, retiming_handle_num, retiming_keys_num)
DNA_STRUCT_RENAME_MEMBER(Strip, retiming_handles, retiming_keys)
DNA_STRUCT_RENAME_MEMBER(Strip, seq1, input1)
DNA_STRUCT_RENAME_MEMBER(Strip, seq2, input2)
DNA_STRUCT_RENAME_MEMBER(Strip, speed_fader, speed_fader_legacy)
DNA_STRUCT_RENAME_MEMBER(Strip, startstill, startstill_legacy)
DNA_STRUCT_RENAME_MEMBER(Strip, strip, data)
DNA_STRUCT_RENAME_MEMBER(StripConnection, seq_ref, strip_ref)
DNA_STRUCT_RENAME_MEMBER(StripData, color_balance, color_balance_legacy)
DNA_STRUCT_RENAME_MEMBER(StripData, dir, dirpath)
DNA_STRUCT_RENAME_MEMBER(StripElem, name, filename)
DNA_STRUCT_RENAME_MEMBER(StripModifierData, mask_sequence, mask_strip)
@@ -215,6 +222,7 @@ DNA_STRUCT_RENAME_MEMBER(SurfaceDeformModifierData, num_mesh_verts, mesh_verts_n
DNA_STRUCT_RENAME_MEMBER(SurfaceDeformModifierData, numpoly, target_polys_num)
DNA_STRUCT_RENAME_MEMBER(SurfaceDeformModifierData, numverts, bind_verts_num)
DNA_STRUCT_RENAME_MEMBER(Text, name, filepath)
DNA_STRUCT_RENAME_MEMBER(TextVars, align_y, align_y_legacy)
DNA_STRUCT_RENAME_MEMBER(TextVars, text, text_legacy)
DNA_STRUCT_RENAME_MEMBER(ThemeSpace, scrubbing_background, time_scrub_background)
DNA_STRUCT_RENAME_MEMBER(ThemeSpace, show_back_grad, background_type)

View File

@@ -938,7 +938,7 @@ static bool strip_read_data_cb(Strip *strip, void *user_data)
}
/* need to load color balance to it could be converted to modifier */
BLO_read_struct(reader, StripColorBalance, &strip->data->color_balance);
BLO_read_struct(reader, StripColorBalance, &strip->data->color_balance_legacy);
}
modifier_blend_read_data(reader, &strip->modifiers);