Skip to content

api

maintained_selection()

Maintain selection during context.

Source code in client/ayon_silhouette/api/lib.py
85
86
87
88
89
90
91
92
93
@contextlib.contextmanager
def maintained_selection():
    """Maintain selection during context."""

    previous_selection = fx.selection()
    try:
        yield
    finally:
        fx.select(previous_selection)