Skip to content

pre_copy_mel

PreCopyMel

Bases: PreLaunchHook

Copy workspace.mel to workdir.

Hook GlobalHostDataHook must be executed before this hook.

Source code in client/ayon_maya/hooks/pre_copy_mel.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class PreCopyMel(PreLaunchHook):
    """Copy workspace.mel to workdir.

    Hook `GlobalHostDataHook` must be executed before this hook.
    """
    app_groups = {"maya", "mayapy"}
    launch_types = {LaunchTypes.local}

    def execute(self):
        project_entity = self.data["project_entity"]
        workdir = self.launch_context.env.get("AYON_WORKDIR")
        if not workdir:
            self.log.warning("BUG: Workdir is not filled.")
            return

        project_settings = self.data["project_settings"]
        create_workspace_mel(
            workdir, project_entity["name"], project_settings
        )