Mystery Keeper
25th October 2016, 20:33
Some of you might have faced the problem of editing .py modules while working with VapourSynth Editor. Modules are not reloaded on refresh. Well, one of users has found a cure!
import sys
modules_to_reload = ['havsfunc', 'MCDenoise', 'helpers']
for module in modules_to_reload:
if module in sys.modules:
del sys.modules[module]
List the names of the modules you import - and they'll be properly reloaded when you refresh the preview. You can add it to the new script template. My template looks like this:
from __future__ import print_function
import vapoursynth as vs
core = vs.get_core(threads=8)
core.set_max_cache_size(12000)
import sys
sys.path.append('D:\\vapoursynth-plugins\\py\\')
import platform
architecture = platform.architecture()
if architecture[0] == '64bit':
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\64bit\\'
else:
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\32bit\\'
print('Plugins folder: ', vapoursynth_plugins_path, end='\n', file=sys.stderr)
import os
for filename in os.listdir(vapoursynth_plugins_path):
if filename[-4:] != '.dll':
continue
try:
core.std.LoadPlugin(vapoursynth_plugins_path + filename)
except Exception as e:
print('Error: ', e, end='\n', file=sys.stderr)
modules_to_reload = ['havsfunc', 'MCDenoise', 'helpers']
for module in modules_to_reload:
if module in sys.modules:
del sys.modules[module]
import sys
modules_to_reload = ['havsfunc', 'MCDenoise', 'helpers']
for module in modules_to_reload:
if module in sys.modules:
del sys.modules[module]
List the names of the modules you import - and they'll be properly reloaded when you refresh the preview. You can add it to the new script template. My template looks like this:
from __future__ import print_function
import vapoursynth as vs
core = vs.get_core(threads=8)
core.set_max_cache_size(12000)
import sys
sys.path.append('D:\\vapoursynth-plugins\\py\\')
import platform
architecture = platform.architecture()
if architecture[0] == '64bit':
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\64bit\\'
else:
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\32bit\\'
print('Plugins folder: ', vapoursynth_plugins_path, end='\n', file=sys.stderr)
import os
for filename in os.listdir(vapoursynth_plugins_path):
if filename[-4:] != '.dll':
continue
try:
core.std.LoadPlugin(vapoursynth_plugins_path + filename)
except Exception as e:
print('Error: ', e, end='\n', file=sys.stderr)
modules_to_reload = ['havsfunc', 'MCDenoise', 'helpers']
for module in modules_to_reload:
if module in sys.modules:
del sys.modules[module]