core icon indicating copy to clipboard operation
core copied to clipboard

Supporting Rez/Allzpark

Open davidlatwe opened this issue 4 years ago • 1 comments

Based on #409, this PR adds the support of Rez/Allzpark styled environment setup and application launching workflow.

Preface

Let's compare the current and up-coming launcher first.

Current Launcher:

  1. User selects which project/asset/task to work on, click application
  2. Launcher creates an instance of avalon.pipeline.Application and loads {app}.toml
  3. And compose environment
  4. Initialize working directory, auxiliary file copying may occur
  5. Finally, launch application

In Allzpark:

  1. User selects which project to work on, click application
  2. Rez resolves environment
  3. Launch application

The difference between these two workflows are, other than Asset/Task selecting is not in Allzpark, working directory's initialization is not there as well.

Although selecting Asset/Task after application startup can be easily accepted with the help of Avalon's Workfile app, but the bottom line of doing any task is, there must be a working directory.

So with or without asset/task, we must define a working directory path in Allzpark. But do we need to initialize it in Allzpark as well ?

By saying "in Allzpark", it means "in Rez package", which mainly used to build up environment so it's not a good fit for file system I/O related operations (it could, but not trivial).

Hence, the application that is being launched should be able to handle working directory's initialization itself.

TL;DR

So here's the goals for supporting new application launching process :

  • AVALON_ASSET, AVALON_TASK can be undefined
  • Avalon should respect and use predefined AVALON_WORKDIR
  • Working directory can be initialized by the application (e.g. Maya) itself

What's changed

  • pipeline.install will initialize working directory if flag _AVALON_APP_INITIALIZED is not set.
  • AVALON_WORKDIR will be respected if it's presented in Session during install.
  • Avalon menu's context label will become --, -- if asset/task is undefined.
  • New session schema 3.0 is added, for opt-out AVALON_ASSET.
  • ~New config schema 2.0 is added, for opt-out apps.~ (reverted in b6429f5)
  • New environment var AVALON_SESSION_SCHEMA is added, for adopting new workflow.
  • Explicitly defined environment var AVALON_APP_NAME in session. This isn't new, just making it clearer.

This PR does/should NOT change current workflow, just supporting new one.

Reference

Here's my current Avalon Rez package setup on adopting Allzpark :

https://github.com/davidlatwe/rez-park/blob/master/_pln/avalon/package.py

Noted that I am still using {app}.toml files for working directory initialization, but just the part of file copying and creating default dirs.

https://github.com/davidlatwe/rez-park/tree/master/_pln/merlin/apps

Here's what it looks like :

image

davidlatwe avatar Sep 03 '20 13:09 davidlatwe

Looks great! What's missing is a getting-started step-by-step.

E.g.

$ pip install allzpark
$ allzpark
...

Along with how to..

  1. Create your project/package, maybe reference the https://allzpark.com docs for in-depth details
  2. Link a few dependencies to your project
  3. How to use that project with Allzpark, to launch e.g. Maya
  4. Once in Maya, how to set your shot and task, along with creating the workdirs
  5. Profit

mottosso avatar Sep 03 '20 18:09 mottosso