Open mottosso opened 5 years ago
There's another method that I've normally used that is similar to your "bundle" method
I would break out additional configuration options into their own packages. For example
maya
maya_enable_legacy_render_layers
maya_enable_legacy_viewport
You could achieve the same thing that way without the added complexity of adding a new type of package.
When a specific extension is needed, it would just get added to the launch command
rez-env maya-2018 maya_enable_legacy_render_layers
I've always used a separate system for managing those launch commands -- either a config file for a launcher tool, or more recently, as fields in Shotgun.
Thanks @bpabel, that works, but is it not the same as the "bundle" option? At least the cons apply here as well.
I've always used a separate system for managing those launch commands
Indeed, this feature could potentially remove the need for this kind of additional system.
A fully backwards-compatible addition of one package augmenting another, as though each package was a CSS document added over another.
User Stories
The Problem
You are 6 months into production, with 3 months remaining and everything is running along smoothly, when suddenly one of the shots require a change or addition to the pipeline that would adversely affect the rest of production; what do you do? Do you ignore the requirement and force the artist to conform to the existing pipeline, even though it would take him 4 weeks instead of 1? Do you give in, and sacrifice the stability and iteration time for the surrounding 50 artists?
If only there was a way to isolate the change to this one shot, thus saving 3 weeks at virtually no cost.
The Problem, Really
So what's stopping anyone from solving this problem today?
Normally, if a package exists on two or more paths, the search lasts until a first match is found. In order to change or add anything to a specific shot you have at least four options.
Option 1: Separate System
The most commonly used approach (it seems) is to develop a separate system that generates requirements for a task environment.
The
setproject
command would then establish theREZ_PACKAGES_PATH
with relevant entries, like one for Alita-specific packages. The problem here being thatsetproject
duplicates what Rez is already doing, such as version control, requirements and establishing an environment in a subshell, resulting in two similar systems to develop and maintain.Option 2: Duplicate and Extend
You could copy the existing
maya
package into a shot, and use that in-place of the studio-widemaya
.However the problem with this approach is that the shot would also need to duplicate an either large package (containing multiple gigabytes) or logic to handle an external reference on the local disk, e.g.
c:\program files\autodesk\...
Once duplicated, you can start making changes.
Option 3: Bundle
One straightforward method of increasing specificity for a project or asset is to "bundle" two or more packages together, and append additional requirements and variables.
Where each bundle contains what you might call "overrides" to the package it itself requires.
alita_maya/package.py
This has a few problems.
alita_vector_maya
for another asset is difficult, e.g.alita_vector_and_chiren_maya
oralita_common_assets_maya
Option 4: Conditional Requirements
Another option is to (1) make packages for your assets too and (2) add conditions to a project package.
Like with Bundles, the problem here is that the if you wanted to add an override to a previously non-overridden environment, the user must not forget to include
vector
to the list of requirements.A Solution
An Override Package is a special type of package that accumulates properties during a resolve or build.
~/packages/maya/package.py
alita/rez/maya/package.py
Now if the first match - e.g.
alita/rez/maya/package.py
- carriesoverride = True
, then that package is added onto the next match found -~/packages/maya/package.py
.Example
For a more elaborate example, the package
maya
exists at each of these 3 locations.Before this feature
rez env maya
is calledmaya
is found onLEVEL3
LEVEL3:maya
is resolvedAfter this feature
rez env maya
is calledmaya
is found onLEVEL3
, carryingoverride = True
, search continues..maya
is found onLEVEL2
, carryingoverride = True
, search continues..maya
is found onLEVEL1
, no override, search stopsLEVEL1:maya
is resolvedLEVEL2:maya
is resolved and addedLEVEL3:maya
is resolved and added