I want to create an operator to preview a physic animation in real time. I have this set of object and I wanted to move them for example using a basic equation like this:
locx = locx - 0.1
a certain number of times a frame. (The number depends on a subframes
Variable.).
and then using bpy.context.scene.frame_set()
move to the next frame and subframe, and while I execute operations the viewport should update (so 10 times per frame, in this case).
The problem is that to keep a velocity that's pertinent to scene fps, the time elapsing from x*y operation should be 1 second, or in case blender couldn't keep up, more. (Where x is subframes and y is scene fps.)
(I wanted to state that moving objects isn't the only thing I'd like to do, I should also create objects and delete them, which isn't exactly a fast operation as moving objects can be.)
So, in other words I would like the operator to behave a bit like the 3d view animation when set to No-Sync as scene sync setting, infact, if the scene fps are 60 it will not proceed for more than 60 frames in a time of a second.
I know not so much about real-time operators, I know you could use modal but I've never found anything useful on how tu use them.
frame_set(frame=3, subframe=0.01)
, that should force the scene to update automatically. $\endgroup$ – brockmann May 12 '18 at 15:26