Git Product home page Git Product logo

manim-sideview's People

Contributors

christopher-besch avatar dependabot[bot] avatar kolibril13 avatar lbirkert avatar mikebarkmin avatar pepedd864 avatar rickaym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

manim-sideview's Issues

load default configuration in an easier way

To load the default configuration at the moment:

  1. the default configuration is first instantiated with base values
// 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: {}
};
  1. the updateFallbackManimCfg is run on extension load time
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:

  1. It isn't obvious how the default configuration is loaded at a glance
  2. Values loaded from the manim.cfg.json file is dependent on the base values set in the initial instantiation

Does not autoplay after rendering

OS: 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!

Add helpful documentation and tips

  • add manim path checking and tips for beginners
  • put helpful tip about the extension that it is meant to be run a scene at a time
  • how to switch scenes

Workspace Settings Needed

I'm trying to set the executable path for the side view extension. But I noticed that there are only User settings.
image
Is it possible to set the executable path for the workspace only? Since I'm using a virtual environment for my project, this is important.

"Check for Updates" button in Manimsideview won't work with latest mobject gallery version

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:

https://github.com/kolibril13/mobject-gallery/blob/04a50f43acccdf548c5bbf18304d417bfa0e56a9/gallery_assets/gallery_parameters.json#L1-L12

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.

extension does not recognize pixel_width, pixel_height properties

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:

Output

Is there any solution to this?

command 'manim-sideview.run' not found

屏幕截图 2023-10-08 155323 vscode:1.63.2 python:3.9.13 manim:0.17.3 manim-sideview:0.2.6 I don’t know why the manim-sideview.run command can’t be found suddenly. It was working fine yesterday. Can I ask how to deal with this?

`Manim Sideview: Unable to infer the file-type for "xxx". Please select below.` Always pops up

I keep on getting this popup on every save:
image

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 a video path to the file “manim.cfg”, I couldn't preview it anymore

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

Sideview with virtual environment

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.

Wrong videoSrc when rendering remote code on Windows subsystems for Linux

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/.......

Commented out lines in manim.cfg are not discarded

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.

Multiple command line args

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.

Add an integration for Manim Studio

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!

Command line quotations needed

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

config file is not loading properly anymore

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!

Changing the size of preview window.

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.

Settings for using a custom external video player.

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.

performance issues

Starting to run manim-sideview is painstakingly slow. The codebase it runs on is also in very bad health.

This happens for these reasons:

  • msv spawns a new process every time to run a task
  • msv does not do any pre-process optimization

Potential Solution:

  1. Rather than spawning a non-shell child_processes connected to a Pseudo Terminal for execution, we can use the VSCode integrated terminal. The initial reason why the Pseudo Terminal + child_process was chosen was due to the lack of transparency the integrated terminal has on the commands running on it, that is, it is not straight forward to detect whether the render has completed, failed, or is ongoing. Furthermore, it does not give the extension access to see the logs generated by the command processes, which makes the extension be unable to figure out the output file type from the logs like normally. Perhaps there is a workaround to this.

Progress:

[-] Code Refactors

manim file not running

We have written the needed data into your clipboard because it was too large to send. Please paste.

Change running classes after an active job

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?

Cleared out /media

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?

manim sideview Rendering is unstable

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

Predicted file does not exist at...

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!

question about how to stop manim sv

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!

Image support

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.

Run venv activate before running

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.

[28312] Execution returned code=0 in 7.714 seconds

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?

Support portrait mode

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.

How to remove border line?

The Manim Sideview window in VS Code always has a white dashed-line border, as shown below:

image

It is very annoying. How can I remove it?

How can I change to another class?

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.
截屏2022-08-24 16 22 19

Preview seeking and PIP control

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?

Can original manim be supported?

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

Questions about how to turn on ManimSV Stop

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.

image

Issue when not using high quality

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.