Rigify - saving pbone custom properties to metarig #104695
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104695
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Andrej730/blender-addons:rigify_custom_props"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added support for some pbone custom properties saving to metarig.
Custom properties widely used as a way to tweak rigs with drivers - so an option to save them to metarig will definitely help.
PS Accidentally removed the branch for #104414 so recreating PR
@angavrilov hi, could you review this PR? :)
@ -414,1 +415,4 @@
# Custom properties
custom_properties = [
custom_property for custom_property in pbone.keys()
Iterate over
items()
to get both key and value.resolved in
3677cc4549
@ -415,0 +428,4 @@
code.append(f" rna_idprop_ui_create(")
code.append(f" pbone, ")
code.append(f" '{custom_property}', ")
code.append(f" default={props_data['default']}, ")
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
@ -415,0 +438,4 @@
if 'soft_max' in props_data:
code.append(f" soft_max={props_data['soft_max']}, ")
if 'description' in props_data:
code.append(f" description='{props_data['description']}'")
Rather than doing
'{foo}'
, use{repr(foo)}
. Manual quoting could be barely tolerated for property names, but for the description it is simply unacceptable.that's really neat thing about
repr
, didn't know it can be used that way!resolved in
e2b63e1a4b
@ -415,0 +443,4 @@
code.append(f" description={props_data['description']!r}")
code.append(f" )")
if 'precision' in props_data:
code.append(f" pbone.id_properties_ui('{custom_property}').update(precision={props_data['precision']})")
This is still not using repr. Also, step and precision should now be supported directly by
rna_idprop_ui_create
, I fixed that recently.Resolved in
ca78100418
@ -415,0 +444,4 @@
code.append(f" )")
if 'precision' in props_data:
code.append(f" pbone.id_properties_ui('{custom_property}').update(precision={props_data['precision']})")
code.append(f" pbone[{custom_property!r}] = {current_value}")
If current_value is actually equal to default, this would be redundant.
resolved in
076763507e