rickaym / manim-sideview Goto Github PK
View Code? Open in Web Editor NEWA Manim utility extension for Visual Studio Code.
Home Page: https://marketplace.visualstudio.com/items?itemName=Rickaym.manim-sideview
License: MIT License
A Manim utility extension for Visual Studio Code.
Home Page: https://marketplace.visualstudio.com/items?itemName=Rickaym.manim-sideview
License: MIT License
To load the default configuration at the moment:
// default configurations, these values are set as ./local/manim.cfg.json
// note only values that are pre-set here are loaded
export var DEFAULT_CONFIG: ManimConfig & FallbackConfig = {
media_dir: "",
video_dir: "",
images_dir: "",
quality: "",
image_name: "",
frame_rate: "",
quality_map: {}
};
export function updateFallbackManimCfg(
updated: {
[tp: string]: any;
},
saveUpdated: boolean = true
) {
Object.keys(DEFAULT_CONFIG).forEach((ky) => {
if (updated[ky]) {
DEFAULT_CONFIG[ky as keyof ManimConfig] = updated[ky];
}
});
if (saveUpdated) {
fs.writeFile(PATHS.cfgMap!.fsPath, JSON.stringify(DEFAULT_CONFIG), () => {});
}
}
Issues:
manim.cfg.json
file is dependent on the base values set in the initial instantiationOS: Windows10
Python:v3.9.13
vscode:v1.80.1
manim:v0.17.3, v0.16.0.post0
sideview: v0.2.5
Watch the video introduction on YouTube, it will play automatically after rendering. But this is not the case when I use it. Every time I need to manually click on the video to play it, it seems very troublesome.
How can I configure it so that it can play automatically after rendering. Thanks!
I followed all the steps to install Manim as shown by this video
https://www.youtube.com/watch?v=ib-I3ayqFaw&t=3s
Unfortunately, the button of sideview is missing in vscode.
I can launch Manim programs, but the animation is done on an external media player (media player of windows)
I just updated all plywood galleries to the latest version (kolibril13/plywood-gallery#24), including the mobject gallery, which has now the latest plywood infrastructure:
That means, that the "Check for Updates" button in Manimsideview won't work any more.
The plywood gallery extension and the manim sideview extension are now 100% equivalent, so maybe it would be even possible to deprecate the manim sideview gallery feature and link people to the plywood gallery extension. But I guess it also won't hurt to simply keep it in the sideview repo.
Trying to run any manim code in VSCode using sideview I'm receiving this error. Only way I've been able to fix it is fresh install VSCode and the extension, but on reload it's broken again.
I am rendering a video with pixel_height=1920 and pixel_width=1080 (which is not the default reselution). The output is saved by manim automatically in the directory ../1920p60 and not in ../1080p60.
The extension assumes the output directory is 1080p/60.
I use this configuration settings:
[CLI]
frame_rate = 60
pixel_width = 1080
pixel_height = 1920
Here are some logs:
Is there any solution to this?
MSV />"manim" "/Users/williamisaak/Code/Animations/scene.py" box Error: spawn manim ENOENT[undefined] Execution returned code=-2 in 0.004 seconds
Should probably be https://github.com/ManimCommunity/manim
instead of https://raw.githubusercontent.com/ManimCommunity/manim
.
I keep on getting this popup on every save:
It results in rendering this extension useless because now instead of just saving and looking at the output I have to click the message each time.
Is there any workaround?
Or maybe it can save the decision for the current session?
Or it would be really neat if an open Preview tab would autorefresh if it detects that the file it is previewing has changed.
Thanks, otherwise it really works well!
Might there be the option to use the PIP View without having the preview pane open?
When I added the following content to the file“manim.cfg”:
[CLI]
Video_dir=D: \ code \ manim \ video
Media dir={video dir}
When using Manim Sideview, there will be the following error message:
Manim Sideview: Predicted output file does not exist at'd: \ code, manim \ D: \ code \ manim \ video \ test. mp4 "Make sure that the designed video directories are reflected in the extension log."
But once I cancel the content of manim.cfg, I can preview it now
I've installed manim to a venvironment, and I'm trying to change "the absolute path to the manim executable" in the extension settings to the address where my manim environment lives, though every time I try I get the following error:
Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.
Not sure how to setup the extension to render through the venvironment.
I use all default settings. And the video file rendering is fine. Only the video src path is wrong.
It should be something like https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-webview.net/......
like the final js script src. But instead, it's https://file%2B.vscode-resource.vscode-webview.net/......
.
Why I get the error You need a valid Python file to run the sideview,. I installed the manim already.
mac: 12.5
python: 3.8
There seems to be an issue with the configuration parser of manim-sideview.
During development of an animation, my manim.cfg
file looked like this.
This worked fine.
[CLI]
#quality = production_quality
quality = low_quality
When I afterwards wanted to change the quality settings to production_quality
, the preview kept showing the low quality version of the rendered file. At this point the configuration file looked like this.
[CLI]
quality = production_quality
#quality = low_quality
To fix the issue, I had to ensure that the active line in the config file was at the end of the file.
[CLI]
#quality = low_quality
quality = production_quality
I think that the issue is with the configuration parser (master/src/configParser.ts
), as it does look for comments (lines starting with #) in the config file.
If you go into the Manim Sideview setting in VScode and try to set two command line args, it will error out. This seems to be because the command line args are put in quotes when the command is executed. A dirty workaround is to put quotes in between the arguments. For example:
doesn't work: --disable_caching -ql
does work: --disable_caching" "-ql
I'm not sure if there was a reason for putting the command line args in quotes. If there is not a good reason for it, then I guess this should be a simple issue to fix.
Hello! I'm the creator of Manim Studio and I want to integrate this nice tool to see animations in VSCode with Manim Studio, so that we can achieve a Manim GUI better connected to VSCode.
What do you think about this? Could we work together?
Thanks in advance!
Hi Team,
Manim-sideview tries to run the following command on the command line:
some path\manim some other path\scene.py CreateCircle
It fails in cases where special characters are in the path. Like white space. The correct approach is:
"some path\manim" "some other path\scene.py" CreateCircle
Hi!
Thanks a lot for the development of this lovely addition to manim.
Sadly, in the new version, my config file is not loading properly anymore, and it is not finding the "extension" to display the sideview.
I've not changed anything to the config file, and it looks exactly like the documentation of manim .
just so you know.
I've switched back to v0.2.09.
Thanks again!
when add '-ql' cli args, it still look for the video in 1080p
Is there a way to change the size of a preview window in VScode. I'm working with this on a laptop and it would be nice if I can resize the preview window to be bigger. Sometimt it's really hard to see snall text, object. Thank you for your work.
I came across needing to seek or rewind a video in the playback, but as it was said in #7, this seems to be a limitation on VSCode's part.
I figured that a neat alternative to it could be to give it a setting to run a command against the file itself. This way, upon saving my scenes, the extension can just open my own video player that doesn't need to adhere to Code's limitations.
So for example, I could set it as mpv --loop
, and this would mean that when I save my scene, it would open it with mpv --loop path/to/video.mp4
& I could see it with mpv where I can seek trough it and so on.
Starting to run manim-sideview is painstakingly slow. The codebase it runs on is also in very bad health.
This happens for these reasons:
Potential Solution:
Progress:
[-] Code Refactors
Is there any way to output the log in the terminal instead of the output window?
Originally posted by @GodOfDeathSam in #8 (comment)
When I change the render quality (in the file with config.quality = "..._quality") to other than "high_quality", there's no output and an error saying that no file is in the 1080p60 folder, which is normal.
We have written the needed data into your clipboard because it was too large to send. Please paste.
When the manim-sideview extension is first used, it asks which class to run. However this option to select the class disappears after the first prompt and the extension keeps outputting the same class initially selected. Is it possible to process different classes (ie to bring back the prompt to select the class) without re-opening the file?
Accept ctrl+c or ctrl+d keybinding into the xterm input to stop the process.
Hello
I cleared out the /media folder and now I get "EntryNotFound (FileSystemError): Unable to resolve nonexistent file. ../manim/media/videos/run/480p15/Test.mp4"
I have rerun the sideview config -- is there a way I can force the recreation of the video files?
if there are many formulars,the rendering of manim sideview will eat the picture,means that some pictures will be incomplete.Please ask how this situation is resolved
Why not add a click event to the progress bar?
I think the ability for the preview box to adjust the video progress is a must.😊
Hi
I configured manim to render in 2000x2000 pixel with
config.frame_size = (2000,2000)
The preview window stays in 16:9 and crops the output file.
I'm sure you've probably seen this issue before, but my internet searches aren't helping as much as I'd like. The sideview will render for a the first two scenes I've added, but won't for the third. It is looking for the video in the 1080p60 folder, while the video file ends up in the 480p30 folder. How do I go about fixing this issue. Thanks!
Thank you for making a great extension. I had a very dumb question that I cannot find an answer in the documentation and couldn't figure. How do I temporarily stop Manim SV from starting automatically - which I want it to most of the time - but sometimes I want to turn off that feature (for example if I haven't finished typing up much, or am editing a text file).
Thank you!
Hi,
First of all, I love the extension, it makes using manim so much easier.
I've only had two issues,
Is there any kind of preview for images, because I'm using manim to make diagrams for my class notes and it would be useful. And also I use a square aspect ratio for said images and that has also caused issues, even when making a video.
I'm having some issues importing my own packages because the extension doesn't seem to be activating the virtual env before running.
I need at least a way to tell the extension some paths to append to sys.path
.
My workaround for this was to make a copy of .venv/bin/manim
and manually add the paths there, and configure the extension to use that executable.
When I am trying to run any manim code, it return this massege and the preview screen does not appear. After I have tried to reinstall the extension and even VSCode, it return to being normal for a while but after some minutes, it comes to this siuation again. I don't know whether this situation is really an error or not. If so, how can I solve it?
Occasionally, I want to render a YouTube Short video. For this, a need the following custom manim.cfg
[CLI]
pixel_width = 1080
pixel_height = 1920
Unfortunately, I think there is no profile on the quality_map for this. Maybe consider adding options for portrait videos.
For some reason my output keeps coming in the default media directory, despite me updating the sideview.mediaDirectory to be a subfolder of one of my folders with a different name
First of all, thanks for your plugins. But I had some problems: I had more classes in my code python, how can I change classes runs a Sideview
after I already ran a class?
My code:
from manim import *
class SquareAndCircle(Scene):
def construct(self):...
class SinAndCosFunctionPlot(Scene):
def construct(self):...
I had two choices when I ran the first time, but I can't choices again when I want to change to another class because I can't see any option when I clicked the icon by runs a Sideview
.
Hey, thanks for making this extension, it's a really nice tool for experimenting with manim! I've run into some issues that you might be able to fix, although I'm not sure whether they're caused by the extension or VS code itself. The first issue is that you cannot control the playback of the video manually, i.e. you cannot skip ahead or go back in the video, so you need to rewatch the entire video if you missed a part. The second problem is that the picture-in-picture mode closes as soon as the video player tab is hidden. Picture-in-picture is a nice way to save some screen space, but because of this bug you can't actually save any space. Do you think this can be fixed?
https://open-vsx.org/ is an open version of the proprietary microsoft vscode registry. The opensource version of code
ships with this registry. Could you perhaps publish this extension there too?
The current extension works for manim CE(community version).
Is it possible to tailor it so that it also works for original manim ver.(gl ver. by Grant)?
I would really appreciate it if the author can do it. XD
Hello Dear author, I am a beginner in manim, thank you for making such a good plugin for manim. But I have some problems when I download and use it. When I use it for the first time, ManimSV is on in the red part in the picture below, but when I use it again, ManimSV is not on, it looks like it is stopped, and then the test code is not displayed in the side pane. How can I solve this problem, thank you very much for your reply. This problem has been bothering me for a long time.
The extension does not show the file when I'm not rendering in high quality. In particular, if I render in low quality (with the command line argument -ql in the Manim Sideview settings), then I get the following error:
ERROR: Manim Sideview: Estimated output file does not exist at "s:\Math\Manim\Vector Calculus\media\videos\nice_3d_plot\1080p60\Nice3DPlot.mp4" Make sure that the designated video directories are reflected in the extension log.
The extension seems to only want to play the file in the 1080p60 folder, no matter what quality I render as. If I have previously rendered a high quality version, then whenever I run the extension, it only runs the output from that previous high quality render.
This seems to be a new issue in the most recent version of the extension. I am not using a config file for Manim.
Log file:
[10/9/2022 17:51] INFO: Activating extension.
[10/9/2022 17:51] INFO: Loading globals.
[10/9/2022 17:51] INFO: Loaded all resource paths.
[10/9/2022 17:51] INFO: Successfully loaded all globals.
[10/9/2022 17:51] INFO: Activated extension.
[10/9/2022 17:51] INFO: Asking user for the new scene name.
[10/9/2022 17:51] INFO: Creating a new configuration for file at path s:\Math\Manim\Vector Calculus\nice_3d_plot.py
[10/9/2022 17:51] INFO: Attempting to render via the running configuration {
"srcRootFolder": "s:\Math\Manim\Vector Calculus\",
"srcPath": "s:\Math\Manim\Vector Calculus\nice_3d_plot.py",
"moduleName": "nice_3d_plot",
"isUsingCfgFile": false,
"manimConfig": {
"media_dir": "media",
"video_dir": "{media_dir}/videos/{module_name}/{quality}",
"images_dir": "{media_dir}/images/{module_name}",
"quality": "high_quality",
"image_name": "{scene_name}_{version}{extension}",
"quality_map": {
"fourk_quality": "2160p60",
"production_quality": "1440p60",
"high_quality": "1080p60",
"medium_quality": "720p30",
"low_quality": "480p15",
"example_quality": "480p30"
}
},
"document": {
"uri": {
"$mid": 1,
"fsPath": "s:\Math\Manim\Vector Calculus\nice_3d_plot.py",
"_sep": 1,
"external": "file:///s%3A/Math/Manim/Vector%20Calculus/nice_3d_plot.py",
"path": "/s:/Math/Manim/Vector Calculus/nice_3d_plot.py",
"scheme": "file"
},
"fileName": "s:\Math\Manim\Vector Calculus\nice_3d_plot.py",
"isUntitled": false,
"languageId": "python",
"version": 1,
"isClosed": false,
"isDirty": false,
"eol": 2,
"lineCount": 102
},
"sceneName": "Nice3DPlot"
},
{
"predictedVideoOutputPath": media\videos\nice_3d_plot\1080p60\Nice3DPlot.mp4,
"predictedImageOutputPath": media\images\nice_3d_plot\ManimCE_v0.16.0.post0
}
[10/9/2022 17:51] INFO: [10688] Spawned a new process for command execution.
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "Manim Community "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "v0.16.0.post0\n\n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "[10/09/22 17:52:23] INFO\t Animation "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "0 : Using cached\tcairo_renderer.py:75\n\t\t\t\t\t\t\t data (hash : 4239883951_28100\t\t\t\t\t \n\t\t\t\t\t\t\t 67070_223132457)\t\t\t\t\t\t\t\t \n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "[10/09/22 17:52:24] "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "INFO\t Animation 1 : Using cached\tcairo_renderer.py:75\n\t\t\t\t\t\t\t data (hash : 1131390362_13293\t\t\t\t\t "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\n\t\t\t\t\t\t\t 14881_2271290059)\t\t\t\t\t\t\t\t "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "[10/09/22 17:52:27]"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output " INFO\t Animation 2 : Using cached\tcairo_renderer.py:75\n\t\t\t\t\t\t\t data (hash : 1131390362_15174 "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\t\t\t\t\t\n\t\t\t\t\t\t\t 15262_537239083)\t\t\t "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\t\t\t\t\t\n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "[10/09/22 17:52:31] INFO\t "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "Animation 3 : Using cached\tcairo_renderer.py:"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "75\n\t\t\t\t\t\t\t data (hash : 1512480823_42601\t\t\t\t\t \n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\t\t\t\t\t\t\t 22064_2411084731)\t\t\t\t\t\t\t\t \n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "[10/09/22 17:52:32]"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output " INFO\t Combining to Movie file. scene_file_writer.py:607\n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\t\t\t\t\t"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "INFO\t\t\t\t\t\t\t scene_file_writer.py:728\n\t\t\t\t\t\t\t File ready at\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t 'S:\Math\Manim\Vector Cal\t\t\t\t\t\t \n\t\t\t\t\t\t\t "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "culus\media\videos\nice_3\t\t\t\t\t\t \n\t\t\t\t\t\t\t d_plot\480p15\Nice3DPlot.\t\t\t\t\t\t \n\t\t\t\t\t\t\t mp4'\t\t\t\t\t\t\t\t\t\t\t \n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "\t\t\t\t\t"
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "INFO\t Rendered Nice3DPlot\t\t\t\t scene.py:240\n\t\t\t\t\t\t\t Played "
[10/9/2022 17:52] INFO: [10688] Relaying stdout output "4 animations\t\t\t\t\t\t\t \n"
[10/9/2022 17:52] INFO: [10688] Execution returned code=0 in 36.834 seconds
[10/9/2022 17:52] INFO: [10688] Video output detected.
[10/9/2022 17:52] ERROR: Manim Sideview: Estimated output file does not exist at "s:\Math\Manim\Vector Calculus\media\videos\nice_3d_plot\1080p60\Nice3DPlot.mp4" Make sure that the designated video directories are reflected in the extension log.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.