Rigify - saving pbone custom properties to metarig #104695
@ -428,7 +428,7 @@ def write_metarig(obj: ArmatureObject, layers=False, func_name="create",
|
|||||||
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!r},")
|
code.append(f" {custom_property!r},")
|
||||||
code.append(f" default={props_data['default']}, ")
|
code.append(f" default={props_data['default']!r},")
|
||||||
|
|||||||
if 'min' in props_data:
|
if 'min' in props_data:
|
||||||
code.append(f" min={props_data['min']},")
|
code.append(f" min={props_data['min']},")
|
||||||
if 'max' in props_data:
|
if 'max' in props_data:
|
||||||
@ -443,7 +443,8 @@ def write_metarig(obj: ArmatureObject, layers=False, func_name="create",
|
|||||||
code.append(f" description={props_data['description']!r}")
|
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!r}).update(precision={props_data['precision']})")
|
||||||
Alexander Gavrilov
commented
This is still not using repr. Also, step and precision should now be supported directly by This is still not using repr. Also, step and precision should now be supported directly by `rna_idprop_ui_create`, I fixed that recently.
Andrej
commented
Resolved in Resolved in ca78100418069ed45b340504ffcb55a03327627e
|
|||||||
|
if props_data['default'] != current_value:
|
||||||
Alexander Gavrilov
commented
If current_value is actually equal to default, this would be redundant. If current_value is actually equal to default, this would be redundant.
Andrej
commented
resolved in resolved in 076763507e82ff209f546aba4b2ab03061254d9d
|
|||||||
code.append(f" pbone[{custom_property!r}] = {current_value}")
|
code.append(f" pbone[{custom_property!r}] = {current_value}")
|
||||||
|
|
||||||
# Constraints
|
# Constraints
|
||||||
|
Loading…
Reference in New Issue
Block a user
What if the default isn't equal to the current value? This code doesn't preserve the value anywhere.
resolved in
3677cc4549
I'd quote default with repr too. Also, get rid of trailing spaces.
resolved in
076763507e