Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-05-09 13:30:06 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-09 13:30:38 +0300
commit8564a9d406d6d1a4eb0d87a309ac9ef01a5f4d0c (patch)
treee17a51435149c126348e494017f18e1abbe1b6f7
parentd814cec587f7842e6ea0bfcef06a158b2c6fbb2d (diff)
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.
-rw-r--r--rigify/utils/mechanism.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/rigify/utils/mechanism.py b/rigify/utils/mechanism.py
index e4344ef1..ee1e3dfc 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():