From 8564a9d406d6d1a4eb0d87a309ac9ef01a5f4d0c Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov <angavrilov@gmail.com> Date: Thu, 9 May 2019 13:30:06 +0300 Subject: [PATCH] Rigify: change the first variable name for var0 to var in make_driver. Only my own branch and feature sets use this, so should be safe to change. This naming is more similar to what blender UI does when adding vars. --- rigify/utils/mechanism.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rigify/utils/mechanism.py b/rigify/utils/mechanism.py index e4344ef1f..ee1e3dfc0 100644 --- a/rigify/utils/mechanism.py +++ b/rigify/utils/mechanism.py @@ -179,10 +179,10 @@ def make_driver(owner, prop, *, index=-1, type='SUM', expression=None, variables Specification format: If the variables argument is a dictionary, keys specify variable names. - Otherwise names are set to var0, var1... etc: + Otherwise names are set to var, var1, var2, ... etc: variables = [ ..., ..., ... ] - variables = { 'var0': ..., 'var1': ..., 'var2': ... } + variables = { 'var': ..., 'var1': ..., 'var2': ... } Variable specifications are constructed as nested dictionaries and lists that follow the property structure of the original Blender objects, but the most @@ -226,7 +226,8 @@ def make_driver(owner, prop, *, index=-1, type='SUM', expression=None, variables if isinstance(variables, list): # variables = [ info, ... ] for i, var_info in enumerate(variables): - _add_driver_variable(drv, 'var'+str(i), var_info, target_id) + var_name = 'var' if i == 0 else 'var' + str(i) + _add_driver_variable(drv, var_name, var_info, target_id) else: # variables = { 'varname': info, ... } for var_name, var_info in variables.items(): -- GitLab