change plugin system
This commit is contained in:
@@ -597,6 +597,9 @@ class World:
|
||||
def __init__(self, tsmark):
|
||||
self.tsmark = tsmark
|
||||
self.window_name = "tsmark - plugin"
|
||||
print("plugin loaded")
|
||||
def __call__(self):
|
||||
print("plugin called")
|
||||
self.tsmark.paused = True
|
||||
cv2.namedWindow(self.window_name, flags=cv2.WINDOW_AUTOSIZE | cv2.WINDOW_KEEPRATIO | cv2.WINDOW_GUI_NORMAL)
|
||||
frame = cv2.resize(np.zeros((16, 16, 3), dtype=np.uint8), self.tsmark.video_res)
|
||||
@@ -618,12 +621,12 @@ class World:
|
||||
loaded_plugin = importlib.util.module_from_spec(module_spec)
|
||||
module_spec.loader.exec_module(loaded_plugin)
|
||||
plugin_class = getattr(loaded_plugin, plugin_class)
|
||||
self.plugin = plugin_class
|
||||
self.plugin = plugin_class(self)
|
||||
|
||||
def launch_plugin(self):
|
||||
|
||||
if self.plugin:
|
||||
self.plugin(self)
|
||||
self.plugin()
|
||||
|
||||
def interpolate_points(self, point_index=None):
|
||||
"""types:
|
||||
|
||||
Reference in New Issue
Block a user