I am trying to make a simple panel with buttons for snapping bones between IK and FK configurations, and I need to change attributes of bone constraints with python scripting.
I can quite easily change something like the Influence of a constraint this way, however I am a little lost when it comes to executing/applying/pressing the Disable and Keep Transform button through script.
I found the operator: bpy.ops.constraint.disable_keep_transform()
and I know you should be able to use "Context Override" on the operator to feed it the appropriate context
(found here: https://docs.blender.org/api/current/bpy.ops.html#overriding-context)
I have tried to copy "similiar" solutions from other people like in this question:
How do I reset a specific bone's "Stretch To" Rest Length, via code?
but I havn't been able to find much information about how these operators and the "Context Override" works.
I feel like I am close.. but someone who knows how these operators work would be a big help.
So the simple question:
What context does the disable_keep_transform()
operator need?
for area in bpy.context.screen.areas : if area.type == "PROPERTIES" : override["area"] = area
.. Is there a better way of getting the correct area type for the override? $\endgroup$