Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/interface/interface_ops.c17
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;
}