Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions manimlib/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ key_bindings:
grab: "g"
x_grab: "h"
y_grab: "v"
z_grab: "z"
resize: "t"
color: "c"
information: "i"
Expand Down
7 changes: 5 additions & 2 deletions manimlib/scene/interactive_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
GRAB_KEY = manim_config.key_bindings.grab
X_GRAB_KEY = manim_config.key_bindings.x_grab
Y_GRAB_KEY = manim_config.key_bindings.y_grab
GRAB_KEYS = [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY]
Z_GRAB_KEY = manim_config.key_bindings.z_grab
GRAB_KEYS = [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY, Z_GRAB_KEY]
RESIZE_KEY = manim_config.key_bindings.resize # TODO
COLOR_KEY = manim_config.key_bindings.color
INFORMATION_KEY = manim_config.key_bindings.information
Expand Down Expand Up @@ -528,7 +529,7 @@ def on_key_press(self, symbol: int, modifiers: int) -> None:
self.add(self.crosshair)

# Conditions for saving state
if char in [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY, RESIZE_KEY]:
if char in [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY, Z_GRAB_KEY, RESIZE_KEY]:
self.save_state()

def on_key_release(self, symbol: int, modifiers: int) -> None:
Expand All @@ -551,6 +552,8 @@ def handle_grabbing(self, point: Vect3):
self.selection.set_x(diff[0])
elif self.window.is_key_pressed(ord(Y_GRAB_KEY)):
self.selection.set_y(diff[1])
elif self.window.is_key_pressed(ord(Z_GRAB_KEY)):
self.selection.set_z(diff[2])

def handle_resizing(self, point: Vect3):
if not hasattr(self, "scale_about_point"):
Expand Down