Skip to content

collect_current_document

CollectSilhouetteActiveDocument

Bases: ContextPlugin

Inject the active project and session

Source code in client/ayon_silhouette/plugins/publish/collect_current_document.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class CollectSilhouetteActiveDocument(pyblish.api.ContextPlugin):
    """Inject the active project and session"""

    order = pyblish.api.CollectorOrder - 0.5
    label = "Silhouette Active Project"
    hosts = ['silhouette']

    def process(self, context):

        project = fx.activeProject()
        session = fx.activeSession()
        if not project:
            self.log.warning("No active project found.")
        if not session:
            self.log.warning("No active session found.")

        context.data["silhouetteProject"] = project
        context.data["silhouetteSession"] = session