[Bf-blender-cvs] [0178e7b3939] blender-v2.83-release: Fix T77148: Crash changing multiple values for sequencer strips
Campbell Barton
noreply at git.blender.org
Thu Jun 18 10:15:25 CEST 2020
Commit: 0178e7b3939879323fefba798b7aff8ef1ea1cca
Author: Campbell Barton
Date: Tue Jun 9 16:17:35 2020 +1000
Branches: blender-v2.83-release
https://developer.blender.org/rB0178e7b3939879323fefba798b7aff8ef1ea1cca
Fix T77148: Crash changing multiple values for sequencer strips
This was caused by assuming all strips were the same type.
===================================================================
M source/blender/editors/interface/interface_ops.c
===================================================================
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 53ea51c9e97..45e117efed4 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;
}
More information about the Bf-blender-cvs
mailing list