Python: VSE: Remove deprecated "sequence" context API

Remove APIs that have been deprecated since Blender 4.4.
See https://developer.blender.org/docs/release_notes/4.4/python_api/#deprecated_1.

Pull Request: https://projects.blender.org/blender/blender/pulls/145597
This commit is contained in:
Falk David
2025-09-03 19:31:30 +02:00
committed by Falk David
parent 5efeb06613
commit 3978908c98
3 changed files with 3 additions and 115 deletions

View File

@@ -86,10 +86,6 @@ const char *screen_context_dir[] = {
"image_paint_object",
"particle_edit_object",
"pose_object",
"active_sequence_strip", /* DEPRECATED - use "active_strip" */
"sequences", /* DEPRECATED - use "strips" */
"selected_sequences", /* DEPRECATED - use "selected_strips" */
"selected_editable_sequences", /* DEPRECATED - use "selected_editable_strips" */
"active_nla_track",
"active_nla_strip",
"selected_nla_strips", /* nla editor */
@@ -671,75 +667,6 @@ static eContextResult screen_ctx_pose_object(const bContext *C, bContextDataResu
}
return CTX_RESULT_OK;
}
static eContextResult screen_ctx_active_sequence_strip(const bContext *C,
bContextDataResult *result)
{
Scene *scene = CTX_data_sequencer_scene(C);
if (!scene) {
return CTX_RESULT_NO_DATA;
}
Strip *strip = blender::seq::select_active_get(scene);
if (strip) {
CTX_data_pointer_set(result, &scene->id, &RNA_Strip, strip);
return CTX_RESULT_OK;
}
return CTX_RESULT_NO_DATA;
}
static eContextResult screen_ctx_sequences(const bContext *C, bContextDataResult *result)
{
Scene *scene = CTX_data_sequencer_scene(C);
if (!scene) {
return CTX_RESULT_NO_DATA;
}
Editing *ed = blender::seq::editing_get(scene);
if (ed) {
LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) {
CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
}
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return CTX_RESULT_OK;
}
return CTX_RESULT_NO_DATA;
}
static eContextResult screen_ctx_selected_sequences(const bContext *C, bContextDataResult *result)
{
Scene *scene = CTX_data_sequencer_scene(C);
if (!scene) {
return CTX_RESULT_NO_DATA;
}
Editing *ed = blender::seq::editing_get(scene);
if (ed) {
LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) {
if (strip->flag & SELECT) {
CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
}
}
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return CTX_RESULT_OK;
}
return CTX_RESULT_NO_DATA;
}
static eContextResult screen_ctx_selected_editable_sequences(const bContext *C,
bContextDataResult *result)
{
Scene *scene = CTX_data_sequencer_scene(C);
if (!scene) {
return CTX_RESULT_NO_DATA;
}
Editing *ed = blender::seq::editing_get(scene);
if (ed == nullptr) {
return CTX_RESULT_NO_DATA;
}
ListBase *channels = blender::seq::channels_displayed_get(ed);
LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) {
if (strip->flag & SELECT && !blender::seq::transform_is_locked(channels, strip)) {
CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
}
}
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return CTX_RESULT_OK;
}
static eContextResult screen_ctx_active_nla_track(const bContext *C, bContextDataResult *result)
{
@@ -1259,11 +1186,6 @@ ensure_ed_screen_context_functions()
map.add("image_paint_object", screen_ctx_image_paint_object);
map.add("particle_edit_object", screen_ctx_particle_edit_object);
map.add("pose_object", screen_ctx_pose_object);
map.add("active_sequence_strip", screen_ctx_active_sequence_strip); /* DEPRECATED */
map.add("sequences", screen_ctx_sequences); /* DEPRECATED */
map.add("selected_sequences", screen_ctx_selected_sequences); /* DEPRECATED */
map.add("selected_editable_sequences",
screen_ctx_selected_editable_sequences); /* DEPRECATED */
map.add("active_nla_track", screen_ctx_active_nla_track);
map.add("active_nla_strip", screen_ctx_active_nla_strip);
map.add("selected_nla_strips", screen_ctx_selected_nla_strips);

View File

@@ -2468,32 +2468,6 @@ static void rna_def_editor(BlenderRNA *brna)
rna_def_strips_top_level(brna);
/* DEPRECATED */
prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_srna(prop, "StripsTopLevel");
RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
RNA_def_property_struct_type(prop, "Strip");
RNA_def_property_ui_text(
prop, "Strips", "(Deprecated: Replaced by '.strips') Top-level strips only");
/* DEPRECATED */
prop = RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
RNA_def_property_struct_type(prop, "Strip");
RNA_def_property_ui_text(prop,
"All Strips",
"(Deprecated: Replaced by '.strips_all') All strips, recursively "
"including those inside metastrips");
RNA_def_property_collection_funcs(prop,
"rna_SequenceEditor_strips_all_begin",
"rna_SequenceEditor_strips_all_next",
"rna_SequenceEditor_strips_all_end",
"rna_SequenceEditor_strips_all_get",
nullptr,
nullptr,
"rna_SequenceEditor_strips_all_lookup_string",
nullptr);
prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_srna(prop, "StripsTopLevel");
RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
@@ -2905,14 +2879,6 @@ static void rna_def_meta(BlenderRNA *brna)
rna_def_strips_meta(brna);
/* DEPRECATED */
prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_srna(prop, "StripsMeta");
RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
RNA_def_property_struct_type(prop, "Strip");
RNA_def_property_ui_text(
prop, "Strips", "(Deprecated: Replaced by '.strips') Strips nested in meta strip");
prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_srna(prop, "StripsMeta");
RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);

View File

@@ -23,10 +23,10 @@ class SequencerLoadMetastaskTest(unittest.TestCase):
self.assertEqual(len(meta_stack), 1)
self.assertEqual(meta_stack[0].name, "MetaStrip")
self.assertEqual(len(meta_stack[0].sequences), 1)
self.assertEqual(meta_stack[0].sequences[0].name, "Color")
self.assertEqual(len(meta_stack[0].strips), 1)
self.assertEqual(meta_stack[0].strips[0].name, "Color")
# accesses ed->current_strips() through screen_ctx_selected_editable_sequences
# accesses ed->current_strips() through screen_ctx_selected_editable_strips
bpy.context.copy()