Perforce sync selected asset / folder from Ayon Launcher #5

Closed
opened 2024-07-29 10:00:22 +02:00 by sebasti1a · 1 comment
sebasti1a commented 2024-07-29 10:00:22 +02:00 (Migrated from github.com)

On ayon_server :

  • Boolean to use or not the sync with selected. If False sync all

Add settings rules for sync :

  • Always sync : mutilples path
On ayon_server : - Boolean to use or not the sync with selected. If False sync all Add settings rules for sync : - Always sync : mutilples path
kaamaurice commented 2024-10-03 10:45:00 +02:00 (Migrated from github.com)

Hard code dans ayon-perforce-loops

# flush usd folders to exclude from sync
shots_dir = "//depot/Jobs/Content/Jobs/shots"
subprocess.run(
    ['p4', 'flush', '-q', f'{shots_dir}/.../usd/...'], check=False,
)
# reconcile sync folders with current task folder
task_type = self.data["workdir_data"]["task"]["type"].lower()
workdir_path = self.data["workdir_data"]["folder"]["path"]

shot_match = re.match(
    r"\/shots\/episodes\/(?P<ep>[a-z0-9]+)"
    r"(?P<sq>\/[a-z0-9]+)?"
    r"(?P<sh>\/[a-z0-9]+)?.*",
    workdir_path,
)
if shot_match and task_type in ("lighting","render"):
    shot_data = shot_match.groupdict()
    ep_name = shot_data.get("ep").upper()
    sq_name = (shot_data.get("sq") or "").upper()
    sh_name = (shot_data.get("sh") or "").upper()
    wildcard = "/usd/..." if sh_name else "/.../usd/..."
    usd_files = f'{shots_dir}/{ep_name}{sq_name}{sh_name}{wildcard}'
    self.log.info(usd_files)
    subprocess.run(['p4', '-I', 'clean', usd_files], check=False)
Hard code dans [ayon-perforce-loops](https://github.com/LoopsCreativeStudio/ayon-perforce-loops) ```python # flush usd folders to exclude from sync shots_dir = "//depot/Jobs/Content/Jobs/shots" subprocess.run( ['p4', 'flush', '-q', f'{shots_dir}/.../usd/...'], check=False, ) # reconcile sync folders with current task folder task_type = self.data["workdir_data"]["task"]["type"].lower() workdir_path = self.data["workdir_data"]["folder"]["path"] shot_match = re.match( r"\/shots\/episodes\/(?P<ep>[a-z0-9]+)" r"(?P<sq>\/[a-z0-9]+)?" r"(?P<sh>\/[a-z0-9]+)?.*", workdir_path, ) if shot_match and task_type in ("lighting","render"): shot_data = shot_match.groupdict() ep_name = shot_data.get("ep").upper() sq_name = (shot_data.get("sq") or "").upper() sh_name = (shot_data.get("sh") or "").upper() wildcard = "/usd/..." if sh_name else "/.../usd/..." usd_files = f'{shots_dir}/{ep_name}{sq_name}{sh_name}{wildcard}' self.log.info(usd_files) subprocess.run(['p4', '-I', 'clean', usd_files], check=False) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: external/ayon-perforce#5