Rigify - saving pbone custom properties to metarig #104695

Merged
Alexander Gavrilov merged 6 commits from Andrej730/blender-addons:rigify_custom_props into main 2023-09-25 21:52:59 +02:00
Showing only changes of commit e2b63e1a4b - Show all commits

View File

@ -427,7 +427,7 @@ def write_metarig(obj: ArmatureObject, layers=False, func_name="create",
props_data = pbone.id_properties_ui(custom_property).as_dict() props_data = pbone.id_properties_ui(custom_property).as_dict()
code.append(f" rna_idprop_ui_create(") code.append(f" rna_idprop_ui_create(")
code.append(f" pbone, ") code.append(f" pbone, ")
code.append(f" '{custom_property}', ") code.append(f" {custom_property!r}, ")
code.append(f" default={props_data['default']}, ") code.append(f" default={props_data['default']}, ")
if 'min' in props_data: if 'min' in props_data:
code.append(f" min={props_data['min']}, ") code.append(f" min={props_data['min']}, ")
@ -438,7 +438,7 @@ def write_metarig(obj: ArmatureObject, layers=False, func_name="create",
if 'soft_max' in props_data: if 'soft_max' in props_data:
code.append(f" soft_max={props_data['soft_max']}, ") code.append(f" soft_max={props_data['soft_max']}, ")
if 'description' in props_data: if 'description' in props_data:
code.append(f" description='{props_data['description']}'") code.append(f" description={props_data['description']!r}")
code.append(f" )") code.append(f" )")
if 'precision' in props_data: if 'precision' in props_data:
code.append(f" pbone.id_properties_ui('{custom_property}').update(precision={props_data['precision']})") code.append(f" pbone.id_properties_ui('{custom_property}').update(precision={props_data['precision']})")