Calling Invoke when Executing an operator from another operator

I am trying to call

bpy.ops.object.paths_calculate()

from an addon I am writing. It works except that the frame range that is calculated is always the same (1 to 250). I would like to be able to set this range before or during the call to paths_calculate. When I press the button on the UI that calls this operator a popup dialog appears that lets the user set the frame range. I looked at the sourcecode and this popup happens in the invoke function for this operator. Is there any way that I can call bpy.ops.object.paths_calculate() in a way that triggers its invoke?

Is there some other solution for intializing the operator properties before its execute is called?

bpy.ops.object.paths_calculate(‘INVOKE_DEFAULT’) should do the trick. Calling modal operators from other operators can be tricky however. You may wanna check out Macros, although they can’t solve everything either.

Thanks! This sounds perfect.

I did find a workaround for my situation. If I call paths_calculate() first, I can then set the frame range in the animation_visualization parameters and call paths_update(). This works but it does a lot of extra unnecessary calculation. I will try your solution.