diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-08-22 17:00:59 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-08-22 17:07:36 +0300 |
commit | e6f3d8b3e1158ebdc89ceae1de5ce7bc5c420f51 (patch) | |
tree | 197389a2268b472a19119fa3faf1f9ab1223240a /source/blender/editors/interface/interface_ops.c | |
parent | eae9b86297876d2172681e880fe2bcc8450a01ed (diff) |
Revert "Fix T68971: Copy As New Driver from Material node creates a bad reference."
This reverts commits 54fd8176d7e91, 4c5becb6b1 and 8f578150e.
Those kind of commits must be reviewed and approved by project owners.
That one:
* Broke Collada building by not properly updating all calls to modified
function.
* Broke *whole* ID management by not properly updating library_query.c.
And in general, I am strongly against backward ID pointers, those are
*always* a serious PITA for ID management. Sometimes they cannot be
avoided, but in general other ways to get that kind of info should be
investigated first.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 8 |
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; } |