Skip to content

Rickaym/manim-sideview

Repository files navigation

Manim Sideview

Extension Homepage Extension Version Discord Discord Extension% Homepage

A Visual Studio code extension with rich support for working with the manim framework, providing features such as gallery-based code snippet catalogs and video and image live preview with flexible configurations.

Ensure you have manim installed on your PATH. Check out this guide for installing manim. Follow this guide to set a custom executable path.

Table Of Contents

Getting Started

After the extension is installed, open the source file with the scene classes and press the icon from the menu bar or use Ctrl+' r to immediately start rendering with a live preview!

That's it, folks!

If you have any questions or find any issues, create a GitHub issue here, seek support through the extension development discord server or you can ping @Neo#1844 with a question on the official manim community discord server.

Rendering Scenes

We've looked at how to render a scene in quickstart, now how do work with multiple scenes?

In any event, the extension creates a job tied to the source file to ensure persistence in scene names, and configurations right after it is rendered for the first time.

Changing the scene name!

Manim Sideview is made to render a single scene at any given moment recurrently. To hop from scene to scene, you'll have to explicitly change the scene name through:

  1. Using the Manim: Set A New SceneName command through the command palette Shift + Command + P (Mac) / Ctrl + Shift + P.
  2. Using the following default hotkey Ctrl + ' c.
  3. Using the render-change icon from the sideview

Configuring

There are two main ways to configure your render using manim-sideview:

  1. manim-sideview.commandLineArgs

By setting this configuration through File -> Preferences -> Settings you can pass CLI arguments to the manim.exe call.

Warning

Do not use args that change the path of the output file, i.e., quality args like 'ql'. Use the config file instead.

  1. manim.cfg file

Use a configuration file for your renders! The extension recognizes the manim configuration under the guideline manim.cfg that exists in the current working directory.

If a manim.cfg file is found, all command line arguments given through manim-sideview.commandLineArgs is ignored.

Mobject Gallery

The Mobject gallery is a web view that allows users to insert code snippets for commonly used manim objects, like squares, text, and also complex graphs.

How do I open the gallery?

  1. Open the command palette using Shift + Command + P (Mac) / Ctrl + Shift + P
  2. Use the command Manim: Open Mobject Gallery

You can place the cursor at the desired location and click the image of the manim object to insert the code into a Python file or Jupyter Notebook!

Frequently Asked Questions

  1. How do I render on save?
  2. How do I change the default manim executable path?
  3. How do I execute a command after the rendering is finished?

1. How do I render on save?

Enable the manim-sideview.runOnSave settings inside vscode File -> Preferences -> Settings menu.

2. How do I change the default manim executable path?

You can set the default manim executable path by changing the manim-sideview.defaultManimPath configuration in File -> Preferences -> Settings.

3. How do I execute a command after the rendering is finished?

We can achieve this via the extension preference manim-sideview.terminalCommand that accepts a command string.

The command is executed in an external terminal as soon as all the rendering is finished.

You can use the following variables in your terminal command:

  1. {outputPath} - the path to the rendered media output (video/image)
  2. {sourcePath} - the path to the source file
  3. {sceneName} - the name of the scene rendered

Credits

Icons made by Smashicons and Freepik from www.flaticon.com, mobject gallery by kolibril13 and ofcourse the logo by the manim/community project!

Made and Maintained with <3 by Ricky Consider supporting this project through starring the repository or buying me a coffee!!

Buy Me A Coffee

Changelog

0.2.13

  • Fix missing icons in sideview

0.2.12

  • Fix manim config parsing
  • Bumped vscode engine to v1.68.0

0.2.11

  • Manim command args with special characters are quoted
  • Manim config parsing is more reliable

0.2.9

  • Fix virtual env detection and activation
  • Added settings to enable/disable the checkered background

0.2.8

  • Fix video autoplay not working
  • Renamed autoPreview preference option to preview

0.2.7

  • Fix commands not found error for VSCode engines under 1.75

0.2.6

  • Virtual env detection and activation
  • Added portrait mode display

0.2.5

  • Allowed pixel_width and pixel_height as quality flags

0.2.4

  • Fix outputFileType always being undefined
  • Repackage dependencies

0.2.3

  • Saves user given output file type to job.

0.2.1

  • Uses Return code 15 for last-process killing SIGTERM signals

0.2.0

  • Added video preview seeking ✨

0.1.5

  • Added manim-sideview.autoPreview command
  • Added manim-sideview.terminalCommand command
  • Added manim-sideview.showManimExecTerminal option
  • Users are able to execute a terminal command at the end of a render

0.1.4

  • Source JS files repackaged

0.1.3

  • Targeted vscode engine downgraded to 1.62.3

0.1.2

  • (Bugfix) frame_rate assumed as 60 on every quality
  • Temporarily dropped frame_rate key in manim.cfg for output directory name

0.1.1 [Latest]

  • @vscode/codicons dependency changed from devDependency to general dependency

0.1.0

  • Extension terminal output format changed & added message persistence
  • Video Player renamed to "Media Player" and now handles both image and video media
  • Added image support for rendering previews and its corresponding config flags
  • New GUI User Interface for the Media Player
  • Uses the plywood-gallery-for-vsce template engine for Mobject Gallery
  • Uses the plywood-gallery-for-vsce template engine for Media Player
  • Added a new output channel called Manim Sideview for the extension to log all window and debug information
  • README write simplification and rewrite
  • Added support to rendering scenes without loading the source file workspace
  • Fontawesome CSS and JS files removed
  • Extension excess terminal output removed
  • Just in-time configuration
  • Changed command manim-sideview.setRenderingSceneName name to manim-sideview.renderNewScene
  • Added command manim-sideview.showOutputChannel command for opening the log output channel
  • manim.cfg files are reloaded every run

0.0.13

  • Optional Terminal Output
  • Jupyter Notebook Fix
  • Webview URI error fix

0.0.12

  • Added configurations to disable or enable auto-play
  • Added configurations to disable or enable looping

0.0.11

  • Patched the local incorrect version file path for mobject gallery

0.0.10

  • Run-time configuration settings can be set for jobless scenes where it'll create a new job for the user
  • Changed default quality mappings with responsiveness to Manim 0.13.1
  • Smarter manim.cfg file analysis and in determining context
  • It should be noted that default rendering will still use -ql for backward compatibility
  • Added manim version re-synchronization command for developer independent compatibility
  • Added version signifier to the mobject gallery

0.0.9

  • Scene scanner now looks for all class definitions with subclasses with name Scene in them
  • Better responsiveness for refocusing selected documents in mobject gallery

0.0.8

  • Using axios now to synchronize assets for better performance

0.0.7

  • Added force re-download when assets are damaged

0.0.6

  • Added video player configurations previewProgressColor, previewShowProgressOnIdle
  • Added Check For Updates button in mobject gallery and a sync lock with the repo

0.0.5

  • Fixed server links
  • Added manim-sideview.showMobjectGallery
  • Added hide progress button
  • Added debrief for the video

0.0.4

  • Minor bug fix for Unix machines with trimmed leading slashes

0.0.3

  • Added manim-sideview.stop for stopping any running processes
  • Paths are now normalized to work with both forward and backward slashes
  • video directories are now static and will not depend on the verdict of manim
  • Setting a valid path no longer replies with "Success" because this can be confusing when there is an exception thrown later down the line that has nothing to do with the scene name
  • manim.cfg files are now derived from the working path - which is the correct case
  • Added support server link

0.0.1 - 0.0.2

The initial release of Manim Sideview.