updated the animaiton tool readme
This commit is contained in:
@@ -28,4 +28,53 @@ source venv/Scripts/activate
|
||||
4. Run
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
```
|
||||
|
||||
# How to Use
|
||||
The animation tool was made to allow anyone to easily create animaitons without much practice. You can create a sequence of frames in the studio, export them and then copy them over to the firmware
|
||||
|
||||
## Creating a Frame
|
||||
When you first run the program the window will look like this:
|
||||
|
||||

|
||||
|
||||
### Rotating the view
|
||||
Press and hold the middle mouse button and move around the mouse to rotate the view.
|
||||
|
||||
### Changing Cube Colors
|
||||
Click on a cube to select it. Selected cubes will be highlighted in red. All selected cubes will be set to the current color picker color. You can deselect a block by clicking on it again.
|
||||
|
||||
The color picker consists of 3 sliders on the left of the screen. A preview of the color is in a small box underneath the sliders. Move the sliders around to change colors.
|
||||
|
||||
### Fill Options
|
||||
Fill options tell the board how to color cubes which are set to black in the animator. There are four options:
|
||||
|
||||
#### No Fill
|
||||
Cubes that are set to black will be off
|
||||
|
||||
#### Closest Color
|
||||
Cubes that are set to black will become the same color as their closest colored neighbor
|
||||
|
||||
#### Linear
|
||||
Cubes that are set to black will become a distance weighted average of all of the colored cubes
|
||||
|
||||
#### Square
|
||||
Same as linear, but the distance weighting is squared. This means a cube that's twice as far away will have only 1/4 the effect.
|
||||
|
||||
### Fade options
|
||||
The fade options tell the board how to transition between frames
|
||||
|
||||
#### Snap
|
||||
The colors will remain constant until the delay time for the current frame has passed. At that point, the frame will immediatly switch to the next frame.
|
||||
|
||||
#### Fade
|
||||
The colors will linearly transition from one frame to the next. This often results in very interesting colors and patterns emerging.
|
||||
|
||||
### Creating more than one frame
|
||||
An animation isn't really an animation with only one frame. You can add more frames to your animation with the "Next Frame" button. This will create a new frame for you to edit. You'll also notice the frame counter above the next frame button will go up. That shows you the current frame number that you're editing. You can view previous frames but clicking on the last frame button.
|
||||
|
||||
### Exporting your Animation
|
||||
Now that you're done creating your lovely animation you can export it! Click the save button and C++ code will automatically be generated which describes all of the frames you just created. The code is saved in output.txt in the animation-tools folder. How to use that code is beyond the scope of this README. Reach out to Quinn for more instruction.
|
||||
|
||||
# Future features
|
||||
Eventually I would like to add the ability to send the animations directly to the board without having to mess with the firmware at all. This will take a pretty big rework though.
|
||||
@@ -118,8 +118,8 @@ class AnimatorUI:
|
||||
self.sceneManager: SceneManager = SceneManager(window, self.colorPicker)
|
||||
|
||||
self.save_button: Button = Button(self.window, *self.rel2abs(5, 90, 10, 10), text="Save",onClick=self.sceneManager.save_frame_to_file)
|
||||
self.next_frame_button: Button = Button(self.window, *self.rel2abs(75, 90, 25, 5), text="Next Frame",onClick=self._next_scene)
|
||||
self.last_frame_button: Button = Button(self.window, *self.rel2abs(50, 90, 25, 5), text="last Frame",onClick=self._last_scene)
|
||||
self.next_frame_button: Button = Button(self.window, *self.rel2abs(75, 95, 25, 5), text="Next Frame",onClick=self._next_scene)
|
||||
self.last_frame_button: Button = Button(self.window, *self.rel2abs(50, 95, 25, 5), text="last Frame",onClick=self._last_scene)
|
||||
self.trackMouseMotion: bool = False
|
||||
|
||||
self.fill_dropdown: Dropdown = Dropdown(self.window, *self.rel2abs(30, 0, 40, 5), name="Fill Type",
|
||||
@@ -135,7 +135,7 @@ class AnimatorUI:
|
||||
|
||||
# Make a frame counter as a button but make it not look like a button
|
||||
default_color=(150,150,150)
|
||||
self.frame_counter_text: Button = Button(self.window, *self.rel2abs(15, 90, 10, 10), text="0", inactiveColour=default_color, hoverColour=default_color, pressedColour=default_color)
|
||||
self.frame_counter_text: Button = Button(self.window, *self.rel2abs(70, 85, 10, 10), text="0", inactiveColour=default_color, hoverColour=default_color, pressedColour=default_color)
|
||||
|
||||
def rel2abs(self, x: float, y: float, width: float, height: float) -> tuple[int,int,int,int]:
|
||||
scr_wdt, scr_hgt = self.window.get_size()
|
||||
@@ -161,8 +161,8 @@ class AnimatorUI:
|
||||
elif self.trackMouseMotion and game_event.type == pygame.MOUSEMOTION:
|
||||
mouseMovement = pygame.mouse.get_rel()
|
||||
current_scene = self.sceneManager.get_current_scene()
|
||||
current_scene.euler_angles[0] -= mouseMovement[1]
|
||||
current_scene.euler_angles[1] -= mouseMovement[0]
|
||||
current_scene.scene.euler_angles[0] -= mouseMovement[1]
|
||||
current_scene.scene.euler_angles[1] -= mouseMovement[0]
|
||||
|
||||
def draw(self):
|
||||
if self.updateOptions:
|
||||
|
||||
BIN
tools/animation-tools/images/open-animator.png
Normal file
BIN
tools/animation-tools/images/open-animator.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user