I have a bone with various custom properties and I want to change the value of all of them, from 0 to 1 at the same time (pressing a button).
Have a look at the operator simple template in the text editor. Replace
main(context) with this
def main(context): #active pose bone pb = context.active_pose_bone # all custom properties on bone for key in pb.keys(): #ignore _RNA_UI if key == '_RNA_UI': continue pb[key] = 1 # insert a keyframe pb.keyframe_insert('["%s"]' % key)
and the poll method to
def poll(cls, context): return context.active_pose_bone is not None
to make sure that there is an active pose bone selected.
and change the idname from object.simple_operator to something meaningful like posebone.set
Then have a look at the panel simple template and
will give you a UI button.