0
$\begingroup$

I'm trying to add a custom property to a bone using python. I think I can add the property using

bpy.types.PoseBone.customProp = bpy.props.FloatProperty(name="customProp", default=0.0, min=0.0, max=1)
bpy.context.active_object.pose.bones["BoneName"].customProp = 0.0

However, in the bone's 'Custom Properties' panel the property doesn't appear. enter image description here

Can anyone help me please?

$\endgroup$

1 Answer 1

0
$\begingroup$

Add Custom Properties to bone

bpy.context.active_object.pose.bones["Bone"].bone["my_prop"] = 0
$\endgroup$
2
  • $\begingroup$ Thank you. It definitely appears in OBJECT mode, but not in POSE mode. $\endgroup$
    – Andy B
    Aug 20, 2022 at 20:23
  • $\begingroup$ Saving/Restarting Blender results in the property appearing btw $\endgroup$
    – Andy B
    Aug 22, 2022 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .