[Bf-blender-cvs] [f4e492a] master: Partial fix for T48734
Joshua Leung
noreply at git.blender.org
Mon Jun 27 14:28:52 CEST 2016
Commit: f4e492ad7116f056798ea7b8af22aea01b5e47af
Author: Joshua Leung
Date: Mon Jun 27 19:01:25 2016 +1200
Branches: master
https://developer.blender.org/rBf4e492ad7116f056798ea7b8af22aea01b5e47af
Partial fix for T48734
The create drivers operator should not use the "Transform Channel" variable type
when driving one transform with another on the same object/bone. Otherwise, you
end up with a situation which technically results in a bit of a pseudo-dependency
cycle.
===================================================================
M source/blender/editors/animation/drivers.c
===================================================================
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index a82cca9..c24ca1e 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -158,7 +158,7 @@ static int add_driver_with_target(
ReportList *UNUSED(reports),
ID *dst_id, const char dst_path[], int dst_index,
ID *src_id, const char src_path[], int src_index,
- PointerRNA *UNUSED(dst_ptr), PropertyRNA *dst_prop,
+ PointerRNA *dst_ptr, PropertyRNA *dst_prop,
PointerRNA *src_ptr, PropertyRNA *src_prop,
short flag, int driver_type)
{
@@ -207,11 +207,15 @@ static int add_driver_with_target(
/* Create a driver variable for the target
* - For transform properties, we want to automatically use "transform channel" instead
* (The only issue is with quat rotations vs euler channels...)
+ * - To avoid problems with transform properties depending on the final transform that they
+ * control (thus creating pseudo-cycles - see T48734), we don't use transform channels
+ * when both the source and destinaions are in same places.
*/
dvar = driver_add_new_variable(driver);
if (ELEM(src_ptr->type, &RNA_Object, &RNA_PoseBone) &&
- (STREQ(prop_name, "location") || STREQ(prop_name, "scale") || STRPREFIX(prop_name, "rotation_")))
+ (STREQ(prop_name, "location") || STREQ(prop_name, "scale") || STRPREFIX(prop_name, "rotation_")) &&
+ (src_ptr->data != dst_ptr->data))
{
/* Transform Channel */
DriverTarget *dtar;
More information about the Bf-blender-cvs
mailing list