-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only show ManimCells in actual Manim files #12
Comments
One easy solution (for us) would be to force users to name their files properly e.g. |
Agree, a naming convention for manim scene files would be too restrictive, and indeed we should not do string matching in case users put their manim imports in a separate file. Here's a proposed workflow, ignoring developer effort:
|
Another easy option: require that each "manim file" contains a special line, e.g.: # Manimfile kind of like (not necessarily the first line - to allow to have e.g. license headers) About your proposed option: |
If there was a button next to every single line of my Python method, I would definitely panic. This should rather be a command IMHO.
Love that behavior, which goes along with #2. But I'd rather want that
This sounds reasonable. Maybe then just add appropriate Manim behavior to every function of such classes? I mean, if users don't want to use a Manim Cell in a custom function living inside a We should make sure that there's no other way than creating a class inheriting from
While a |
😂😂 Fair. I was envisioning hijacking the "debug" button to launch manimgl interactive. the debug button only shows if it is cursed over, and maybe we can even hijack the tooltip and icon in manim files (aspirational), but this would be one way of doing this without introducing any visual chaos.
Yes fair. I agree this is the better behavior
I agree with @Splines here. We should use these tricks only as a fallback if we can't come up with anything else. In general, I feel that the rule should be: "Other people have already built awesome manim videos using their own naming conventions and scripts. How can we activate this manim extension seamlessly and automatically for those scripts, while minimizing the number of manim-unrelated scripts we activate on?" I will continue to think on this. Maybe even having a vscode popup that says "Possible Manim file detected, vscode-manim automatically activated. Deactivate? [y/N]"
I'm not familiar enough with how people use Manim to answer this question... Clearly it is easiest to make a Manim video from these classes 🤷 |
This is also a nice feature, but not necessary for v0.1.0 |
If you search for that feature, it's called a gutter icon, see also my comment here. |
Note that just checking if a class inherits from class LightExposingFilm(DiffractionGratingScene): |
Ok, I think a good heuristic would be to find the comments with
With this heuristic, false positives would be:
Do you think that'd be a good approach? |
Adding some additional convoluted mental overhead to what constitutes a "manim file" doesn't look attractive to me,
|
I mean it's mental overhead that can be packed and contained inside a function For what concerns the Manim I agree that we don't need this for now, but I wouldn't close this issue as it's not resolved (and I'd like to fix it later). |
See my comment here:
Question: "Can we implement logic to only show this [Manim Cells with fold ranging] when we are in a manim file?"
Sure I could give this a try, maybe this is a better fit for a subsequent PR [...]. To detect if we're in a manim file, I'd try to find the class we're in right now and see if that one inherits from either Scene or InteractiveScene. Searching for a manim-related import string would be a poor choice in my opinion as even in 3b1b's video repo, he's using something like from manim_imports_ext import * where `manim_imports_ext_ is a custom file at the root of the repo. So imports don't even have to include "manim" as string and yet it could be a Manim-related file.
The text was updated successfully, but these errors were encountered: