0
$\begingroup$

I'm using a handler (frame_change_pre) and trying to force Blender to stay on one frame while scrubbing by using

scene.frame_set(frameNumber)

However, while the blue scrubber and the frame display number in the 3D viewport stay set, the animation still scrubs. How can I cancel that behavior and stop the animation from scrubbing in the viewport.

$\endgroup$
  • $\begingroup$ From what I understand, you're trying to change the current frame without changing the current frame. What do you expect to happen exactly? $\endgroup$ – dr. Sybren Feb 18 at 11:14
  • $\begingroup$ @dr.Sybren I wan't Blender to be stuck at the frame I've set and not to scrub through the animation (while scrubbing with mouse). However I still want to catch the current frame beneath the mouse cursor so I don't want to cancel the whole scrub behaviour. I need this for my plugin which jumps from keyframe to keyframe, but currently while the scrubber jumps correctly, the whole animation still displays during mouse movement (if the animation is splined). $\endgroup$ – Blendermonkey Feb 18 at 11:38
  • $\begingroup$ That sounds like you want to make a modal operator that captures the mouse position and clicks. That'll be much easier to build than trying to fight Blender to half-ignore its own functionality. $\endgroup$ – dr. Sybren Feb 18 at 12:33
  • $\begingroup$ @dr.Sybren True, but since I'm trying to modify the behavior of an existing tool I would either have to do it in the source code itself (which would mean it can't be distributed as a plugin) or I would have to switch off the tool off and override it with my version. Since I don't think I'd be capable of changing the blender source I think I should go with the second option, if it's even possible. $\endgroup$ – Blendermonkey Feb 18 at 13:28
  • $\begingroup$ A modal operator can 'eat up' events, so you can make it so that the scrubbing mouse events are handled by your code only. $\endgroup$ – dr. Sybren Feb 18 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.