What is the required context for the operator bpy.ops.ptcache.bake()?
This is my script so far which triggers poll failed incorrect context error:
import bpy
bpy.context.area.ui_type = 'PROPERTIES'
bpy.context.space_data.context = 'PHYSICS'
bpy.ops.ptcache.bake(bake=True)
An object with a cloth modifier is active when the script is run.
I've tried to look at the source code to view the poll method but whenever I use the Edit Operator Source tool in the text editor it gives me a recursion depth error. How else can I view the code? Or maybe someone can paste it here if they're not getting the same error.