From e6f3d8b3e1158ebdc89ceae1de5ce7bc5c420f51 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 22 Aug 2019 16:00:59 +0200 Subject: 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. --- source/blender/editors/animation/drivers.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index bf2056a7ec6..e341a16378c 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -846,36 +846,6 @@ bool ANIM_driver_vars_paste(ReportList *reports, FCurve *fcu, bool replace) /* -------------------------------------------------- */ -/** Compute an ID pointer and path to property valid for use in a driver. - * Corrects for ID references that are not independent (e.g. material NodeTree). */ -bool ANIM_get_target_ID_and_path_to_property( - PointerRNA *ptr, PropertyRNA *prop, int index, ID **r_id, char **r_path) -{ - int dim = RNA_property_array_dimension(ptr, prop, NULL); - char *path = RNA_path_from_ID_to_property_index(ptr, prop, dim, index); - ID *id = ptr->id.data; - - if (!path) { - return false; - } - - if (GS(id->name) == ID_NT) { - bNodeTree *node_tree = (bNodeTree *)id; - - if (node_tree->owner) { - id = node_tree->owner; - - char *new_path = BLI_sprintfN("node_tree%s%s", path[0] == '[' ? "" : ".", path); - MEM_freeN(path); - path = new_path; - } - } - - *r_id = id; - *r_path = path; - return true; -} - /* Create a driver & variable that reads the specified property, * and store it in the buffers for Paste Driver and Paste Variables. */ void ANIM_copy_as_driver(struct ID *target_id, const char *target_path, const char *var_name) -- cgit v1.2.3