Source code for sapien.utils.viewer.plugin
from __future__ import annotations
from sapien import Scene
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from . import viewer
[docs]
def copy_to_clipboard(content):
try:
import pyperclip
pyperclip.copy(content)
except ModuleNotFoundError:
print(
"copy to clipboard is only available when pyperclip is installed with [pip install pyperclip]"
)
[docs]
class Plugin:
[docs]
def init(self, v: viewer.Viewer):
self.viewer = v
[docs]
def notify_scene_change(self):
pass
[docs]
def notify_selected_entity_change(self):
pass
[docs]
def notify_window_focus_change(self, focused):
pass
[docs]
def get_ui_windows(self):
return []
[docs]
def before_render(self):
pass
[docs]
def after_render(self):
pass
[docs]
def clear_scene(self):
pass