Skip to content

Avalon SFTP Client, for uploading Avalon workfile or representation to remote site via SFTP

License

Notifications You must be signed in to change notification settings

davidlatwe/avalon-sftpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

avalon-sftpc

Avalon SFTP Client, for uploading Avalon workfile or representation to remote site via SFTP

Requires

  • avalon-core
  • pysftp

Demo

$ python -m avalon_sftpc --demo

avalon-sftpc

Environment vars

AVALON_SFTPC_SITES: Optional, dir path which contains SFTP sites' config files (.cfg). If not set, will look into ./avalon_sftpc/sites

Usage

NOTE: Uploading with 10 processes, not tweakable

  1. Write SFTP server connection config file

See here

  1. Generating job package file
# Inside Maya (or other DCC App that has Avalon implementation)
from avalon_sftpc import util

exporter = util.JobExporter(remote_root="",
                            remote_user="user",
                            site="site-name")


def collect_rogue_files():
    """Pseudo code, collect files that hasn't been published"""
    jobs = list()
    for file in unpublished_files():
        remote_path = mapping(file)
        jobs.append((file, remote_path))

    if jobs:
        exporter.add_job(files=jobs,
                         type="Rogue Files",
                         description="Rogues of %s" % session["AVALON_ASSET"])


def save_file():
    cmds.file(save=True, force=True)


# This is optional
additional_jobs = [
    collect_rogue_files,
    save_file,
]
exporter.from_workfile(additional_jobs)
out = exporter.export()
print(out)
# /../scenes/workfile_v0002.ma.sftp.job
  1. Launch Avalon Uploader
$ python -m avalon_sftpc

Input package file path, and good to upload :)

About

Avalon SFTP Client, for uploading Avalon workfile or representation to remote site via SFTP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages