manim
manim copied to clipboard
No detailed and accurate explanation or tutorial for InteractiveScene
I could not use interactive scene. It has the explanation:
"""
To select mobjects on screen, hold ctrl and move the mouse to highlight a region,
or just tap ctrl to select the mobject under the cursor.
Pressing command + t will toggle between modes where you either select top level
mobjects part of the scene, or low level pieces.
Hold 'g' to grab the selection and move it around
Hold 'h' to drag it constrained in the horizontal direction
Hold 'v' to drag it constrained in the vertical direction
Hold 't' to resize selection, adding 'shift' to resize with respect to a corner
Command + 'c' copies the ids of selections to clipboard
Command + 'v' will paste either:
- The copied mobject
- A Tex mobject based on copied LaTeX
- A Text mobject based on copied Text
Command + 'z' restores selection back to its original state
Command + 's' saves the selected mobjects to file
"""
That is not enough to let me know how to see the window and use my mouse and keyboard.
When i use this code:
class ABC(InteractiveScene):
def construct(self):
text = Text('ABC')
self.play(Write(text))
It says:
Media will be written to c:\beibi\a\media\. You can change this behavior with the --media_dir flag.
There are no scenes inside that module
But if i add "Scene", it will be strange.
class ABC(InteractiveScene, Scene):
def construct(self):
text = Text('ABC')
self.play(Write(text))
Media will be written to c:\beibi\a\media\. You can change this behavior with the --media_dir flag.
And then a window is displayed, but it disappears in an instant. Nothing is displayed.
Please tell me how to use interactive scene correctly. Thanks!
If you want to preview the effect, see: https://www.bilibili.com/video/BV1R34y1W7Xn/?spm_id_from=333.337.search-card.all.click&vd_source=56f860f8bb81d49bdbd9b13dc4731f94
At 05:04, 05:32, etc.
It looks like it's trying to write the scene to file, which would be the case if you passed in the -w or -o flag. In those case, it would not be interactive. If you call it with something like manimgl file.py ABC
, the default should be the preview the scene in a window, where you can then interact with the window.