From 4b21067aea415f7eb4604de6dd133a67a4063640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 17 Dec 2021 17:31:15 +0100 Subject: Fix T94116: Drivers can have multiple variables with same name The RNA setter now ensures that driver variables are uniquely named (within the scope of the driver). Versioning code has been added to ensure this uniqueness. The last variable with the non-unique name retains the original name; this ensures that the driver will still evaluate to the same value as before this fix. This also introduces a new blenlib function `BLI_listbase_from_link()`, which can be used to find the entire list from any item within the list. Manifest Task: T94116 Reviewed By: mont29, JacquesLucke Maniphest Tasks: T94116 Differential Revision: https://developer.blender.org/D13594 --- source/blender/makesrna/intern/rna_fcurve.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesrna/intern/rna_fcurve.c') diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index a38bbd3d6d2..d3175c445a9 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -388,6 +388,7 @@ void rna_DriverVariable_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(data->name, value, 64); driver_variable_name_validate(data); + driver_variable_unique_name(data); } /* ----------- */ -- cgit v1.2.3