3b1b / manim

Animation engine for explanatory math videos
MIT License
63.08k stars 5.84k forks source link

Incorporating own code into manimlib #1019

Open stevenschn opened 4 years ago

stevenschn commented 4 years ago

I would like to add functions to the manimlib that are callable in any new scene class.

Therefore, I created some new classes (e.g. class_name) with respective functions, in function.py and added a map to the manimlib folder, say functions. The I added a line to the imports.py file found in the manimlib folder:

from manimlib.functions.function import *

Now when I start a new Scene, I can indeed reach those new functions, when I type

class_name.function_name(parameters) but Visual Code does not seem to recognize those. That is, they run and they work just as they should, but Visual Studio does not auto-complete or suggest the functions or parameters. Is this solvable? Because this now takes a lot of going back and forth and the whole idea to automatize this is lost.

Aathish04 commented 4 years ago

I don't think this is a Manim issue. It seems to be more related to VSCode.

I use VSCode myself, and can't get any Manim objects to show up in IntelliSense, which I find pretty funny.

stevenschn commented 4 years ago

Try enablig Jedi in settings --> python. This somethings helps.

kevkevinpal commented 4 years ago

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

stevenschn commented 4 years ago

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

But can you confirm this does not occur when using other IDE?

Aathish04 commented 4 years ago

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

But can you confirm this does not occur when using other IDE?

I know for a fact that users of Vim have it autocomplete even custom manim stuff for them.

stevenschn commented 4 years ago

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

But can you confirm this does not occur when using other IDE?

I know for a fact that users of Vim have it autocomplete even custom manim stuff for them.

and does the jedi function not help you got auto complete the standard manim functions for you?

Aathish04 commented 4 years ago

Unfortunately, it doesn't seem to pick it up for me. I found that I've had jedi enabled this whole time!

On Sun, 3 May 2020, 21:15 stevenschn, notifications@github.com wrote:

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

But can you confirm this does not occur when using other IDE?

I know for a fact that users of Vim have it autocomplete even custom manim stuff for them.

and does the jedi function not help you got auto complete the standard manim functions for you?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/3b1b/manim/issues/1019#issuecomment-623129665, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH5H6JHUDMIZMJYD25SRLXDRPWGR7ANCNFSM4MW46SXQ .

hadichaudhri commented 4 years ago

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

But can you confirm this does not occur when using other IDE?

I know for a fact that users of Vim have it autocomplete even custom manim stuff for them.

Is this using the jedi-vim library or something else?

hadichaudhri commented 4 years ago

Intellisense does work for me Intellisense does work for me, both with and without jedi, but I get a lot of errors from pylint I get a lot of errors from pylint regardless of the setting.

Aathish04 commented 4 years ago

Yea this seems like a VSCode issue if you could let us know if you find a solution in the future that would be great but as of now we should probably close this issue

But can you confirm this does not occur when using other IDE?

I know for a fact that users of Vim have it autocomplete even custom manim stuff for them.

Is this using the jedi-vim library or something else?

I'm not actually sure. It was mentioned in passing by one of the members of the Manim Discord community.