diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-09 09:17:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-09 09:24:50 +0300 |
commit | f88d59ecf8e59aa8f5f4b0449a04122ea0c8acd0 (patch) | |
tree | fb5d2987b5dc7a79b5c6927be8f0cebb217b4527 /source/blender/editors/interface/interface_ops.c | |
parent | 0c4bc09092de6a948a6cc46da3b2f1fcc31ed8f7 (diff) |
Fix T77148: Crash changing multiple values for sequencer strips
This was caused by assuming all strips were the same type.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 909da434554..41c89d2d832 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -737,6 +737,8 @@ bool UI_context_copy_to_selected_list(bContext *C, *r_path = NULL; /* special case for bone constraints */ char *path_from_bone = NULL; + /* Remove links from the collection list which don't contain 'prop'. */ + bool ensure_list_items_contain_prop = false; /* PropertyGroup objects don't have a reference to the struct that actually owns * them, so it is normally necessary to do a brute force search to find it. This @@ -803,6 +805,8 @@ bool UI_context_copy_to_selected_list(bContext *C, else { *r_lb = CTX_data_collection_get(C, "selected_editable_sequences"); } + /* Account for properties only being available for some sequence types. */ + ensure_list_items_contain_prop = true; } else if (RNA_struct_is_a(ptr->type, &RNA_FCurve)) { *r_lb = CTX_data_collection_get(C, "selected_editable_fcurves"); @@ -921,6 +925,8 @@ bool UI_context_copy_to_selected_list(bContext *C, else { *r_lb = CTX_data_collection_get(C, "selected_editable_sequences"); } + /* Account for properties only being available for some sequence types. */ + ensure_list_items_contain_prop = true; } } return (*r_path != NULL); @@ -929,6 +935,17 @@ bool UI_context_copy_to_selected_list(bContext *C, return false; } + if (ensure_list_items_contain_prop) { + const char *prop_id = RNA_property_identifier(prop); + LISTBASE_FOREACH_MUTABLE (CollectionPointerLink *, link, r_lb) { + if ((ptr->type != link->ptr.type) && + (RNA_struct_type_find_property(link->ptr.type, prop_id) != prop)) { + BLI_remlink(r_lb, link); + MEM_freeN(link); + } + } + } + return true; } |