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:
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index f8df8966297..c7ce66cfcf6 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -195,11 +195,11 @@ static int copy_as_driver_button_exec(bContext *C, wmOperator *UNUSED(op))
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
if (ptr.id.data && ptr.data && prop) {
- ID *id;
- char *path;
+ int dim = RNA_property_array_dimension(&ptr, prop, NULL);
+ char *path = RNA_path_from_ID_to_property_index(&ptr, prop, dim, index);
- if (ANIM_get_target_ID_and_path_to_property(&ptr, prop, index, &id, &path)) {
- ANIM_copy_as_driver(id, path, RNA_property_identifier(prop));
+ if (path) {
+ ANIM_copy_as_driver(ptr.id.data, path, RNA_property_identifier(prop));
MEM_freeN(path);
return OPERATOR_FINISHED;
}