vapoursynth/vapoursynth

How to return the abs dir of `vapoursynth/plugins/` or current loaded plugin ?

hooke007 opened this issue · 11 comments

How to return the abs dir of `vapoursynth/plugins/` or current loaded plugin ?

One way could be:

import vapoursynth as vs
print (vs.sys.path)

It's python's PATH not vsplugins'

Oh sorry, you're correct.

I think it's not possible with current python API, but you can make a plugin that finds a folder where it was loaded (C API has desired method) and then call that plugin under python to get plugin path. For example, look at https://github.com/AmusementClub/vs-mlrt/blob/master/scripts/vsmlrt.py#L32 and https://github.com/AmusementClub/vs-mlrt/blob/master/vstrt/vs_tensorrt.cpp#L544

Yeah, I noticed it and that's why i am curious that is there any undocumented api.

i swear i saw a python script which for looped through all loaded vs plugins and their available functions, that can probably be repurposed for your use case

try to look up something like "display all available vs plugin functions"

That issue was posted by me too. I have checked and it does no help for my usecase.

If you have a good reason why it'd be useful I could easily expose getPluginPath from the API in python.

For example when you ship your own script + plugins. In case of a namespace conflict, you could inform the user about it, incl. the path of the dll.

btw is it possible to unload a plugin?

I am trying to do sth similar to #1015 (comment)

Check and Load the folder in this path.