3
$\begingroup$

I'm trying to write a modal operator for the timeline, but I'm confused about how to get the current frame cursor in the timeline to follow a 'mousemove' event (and consequently, how to set the new current frame when the operator finishes).

$\endgroup$

1 Answer 1

1
$\begingroup$

Solved - in the invoke() function, I set these:

self._initial_mouse = event.mouse_x
self._initial_frame = scene.frame_current

in modal():

self.offset = (self._initial_mouse - event.mouse_x) * -0.1
scene.frame_current = self._initial_frame + self.offset
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .