Fix T74434: Video Sequencer: Alt+ clicking (assign to all selected) does

not work for unlocking

Special case for when we do this on "lock":
- locked sequences are not in "selected_editable_sequences"
- use "selected_sequences" in that case

Maniphest Tasks: T74434

Differential Revision: https://developer.blender.org/D7023
This commit is contained in:
Philipp Oeser 2020-03-04 15:55:22 +01:00
parent 765f2a1bca
commit 2a4f350940
Notes: blender-bot 2023-02-14 06:25:25 +01:00
Referenced by issue #74434, Video Sequencer: Unlock icon +Alt doesn't unlock the full selection
1 changed files with 18 additions and 2 deletions

View File

@ -794,7 +794,15 @@ bool UI_context_copy_to_selected_list(bContext *C,
ui_context_selected_bones_via_pose(C, r_lb);
}
else if (RNA_struct_is_a(ptr->type, &RNA_Sequence)) {
*r_lb = CTX_data_collection_get(C, "selected_editable_sequences");
/* Special case when we do this for 'Sequence.lock'.
* (if the sequence is locked, it wont be in "selected_editable_sequences"). */
const char *prop_id = RNA_property_identifier(prop);
if (STREQ(prop_id, "lock")) {
*r_lb = CTX_data_collection_get(C, "selected_sequences");
}
else {
*r_lb = CTX_data_collection_get(C, "selected_editable_sequences");
}
}
else if (RNA_struct_is_a(ptr->type, &RNA_FCurve)) {
*r_lb = CTX_data_collection_get(C, "selected_editable_fcurves");
@ -901,7 +909,15 @@ bool UI_context_copy_to_selected_list(bContext *C,
/* Try to recursively find an RNA_Sequence ancestor,
* to handle situations like T41062... */
if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence)) != NULL) {
*r_lb = CTX_data_collection_get(C, "selected_editable_sequences");
/* Special case when we do this for 'Sequence.lock'.
* (if the sequence is locked, it wont be in "selected_editable_sequences"). */
const char *prop_id = RNA_property_identifier(prop);
if (STREQ(prop_id, "lock")) {
*r_lb = CTX_data_collection_get(C, "selected_sequences");
}
else {
*r_lb = CTX_data_collection_get(C, "selected_editable_sequences");
}
}
}
return (*r_path != NULL);