Skip to content
Snippets Groups Projects
Commit 8564a9d4 authored by Alexander Gavrilov's avatar Alexander Gavrilov
Browse files

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.
parent d814cec5
No related branches found
No related tags found
No related merge requests found
...@@ -179,10 +179,10 @@ def make_driver(owner, prop, *, index=-1, type='SUM', expression=None, variables ...@@ -179,10 +179,10 @@ def make_driver(owner, prop, *, index=-1, type='SUM', expression=None, variables
Specification format: Specification format:
If the variables argument is a dictionary, keys specify variable names. 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 = [ ..., ..., ... ]
variables = { 'var0': ..., 'var1': ..., 'var2': ... } variables = { 'var': ..., 'var1': ..., 'var2': ... }
Variable specifications are constructed as nested dictionaries and lists that Variable specifications are constructed as nested dictionaries and lists that
follow the property structure of the original Blender objects, but the most 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 ...@@ -226,7 +226,8 @@ def make_driver(owner, prop, *, index=-1, type='SUM', expression=None, variables
if isinstance(variables, list): if isinstance(variables, list):
# variables = [ info, ... ] # variables = [ info, ... ]
for i, var_info in enumerate(variables): 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: else:
# variables = { 'varname': info, ... } # variables = { 'varname': info, ... }
for var_name, var_info in variables.items(): for var_name, var_info in variables.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment