Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed 2D animation to use same type of animation speed as 3d #1173

Merged
merged 1 commit into from
Mar 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Packages/vcs/Lib/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def setup_animation(self):
def get_frame():
return self.canvas.animate.frame_num
anim_toolbar.add_slider_button(get_frame, 0, self.canvas.animate.number_of_frames(), "Time Slider", update=self.set_animation_frame)
anim_toolbar.add_slider_button(self.animation_speed, 1, 30, "Frames Per Second", update=self.set_animation_speed)
anim_toolbar.add_slider_button(self.animation_speed, 1, 100, "Speed (Step Delay)", update=self.set_animation_speed)
self.save_anim_button = anim_toolbar.add_button(["Save Animation", "Cancel Save"], action=self.save_animation_press)
self.initialized = True

Expand Down Expand Up @@ -582,7 +582,7 @@ def save_animation_press(self, state):

def save_animation(self):
# Save the animation
self.canvas.animate.fps(self.animation_speed)
self.canvas.animate.fps(int(1000.0 / self.animation_speed))

data_titles = {}
name_to_type = {}
Expand Down Expand Up @@ -625,10 +625,10 @@ def save_tick(self, obj, event):

def set_animation_speed(self, value):
v = int(value)
self.animation_speed = v
self.animation_speed = 10 * v
if self.animation_timer is not None:
self.interactor.DestroyTimer(self.animation_timer)
self.animation_timer = self.interactor.CreateRepeatingTimer(int(1000.0 / self.animation_speed))
self.animation_timer = self.interactor.CreateRepeatingTimer(self.animation_speed)
return v

def animate(self, obj, event):
Expand All @@ -638,7 +638,7 @@ def animate(self, obj, event):

def start_animating(self):
if self.animation_timer is None:
self.animation_timer = self.interactor.CreateRepeatingTimer(int(1000.0 / self.animation_speed))
self.animation_timer = self.interactor.CreateRepeatingTimer(self.animation_speed)

def stop_animating(self):
if self.animation_timer is not None:
Expand Down