Rez and Shotgun Toolkit/Tank

834 views
Skip to first unread message

je...@rodeofx.com

unread,
Aug 25, 2015, 11:17:15 AM8/25/15
to rez-config
I was wondering if there have been any developments on getting software configurations in the Shotgun Toolkit to work nicely with Rez since the thread started by Tony Barbieri a while ago....

Is anyone else using both?

Cheers,

Jesse

Tony Barbieri

unread,
Aug 25, 2015, 11:31:54 AM8/25/15
to rez-c...@googlegroups.com
Hello Jesse,

We haven't moved over to Rez yet. I'm still following along on the list but haven't had a chance to move us over from our current in-house solution. 

I'd still like to look into doing this in the future.

Best,

--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To post to this group, send email to rez-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/rez-config.
For more options, visit https://groups.google.com/d/optout.



--
Tony

Allan Johns

unread,
Aug 25, 2015, 12:18:58 PM8/25/15
to rez-c...@googlegroups.com
Hey Tony,

I think I must have missed this thread? Please do get in touch if there's anything specific you'd like to find out, I'd be interested in Toolkit support also.

Thx
A

Seth Lippman

unread,
Feb 19, 2016, 6:44:59 PM2/19/16
to rez-config
This is something I am starting to look into as well - I was wondering if there have been any developments since Jesse's post a while ago.. :) ?

Alexandra Lefève-Gourmelon

unread,
Feb 22, 2016, 5:07:05 AM2/22/16
to rez-c...@googlegroups.com
Hi Seth,

I believe Shotgun people are looking into rez to see how both systems can fit together. Maybe you can contact them.

Cheers,
Alex

--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To post to this group, send email to rez-c...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--



Alexandra Lefève-Gourmelon
Pipeline TD



Mikros Image
Digital Post-Production for Video and Film /
Animation Studio
Mikros Image sur Facebook Mikros Image sur Twitter Mikros Image sur Vimeo http://www.linkedin.com/company/mikros-image



Fredrik Brännbacka

unread,
Mar 14, 2016, 11:21:12 AM3/14/16
to rez-config
This is a proof of concept i did a while back with a app_launch hook.
The hook is in the file rez_app_launch.py

And in the app_launchers.yml we set up the required packages like this:

launch_maya:
  defer_keyword: ''
  engine: tk-maya
  extra:
    rez_packages:
      - maya-2016
      - mtoa
      - mcp_render_scripts
      - mcp_multi_submit
  hook_app_launch: rez_app_launch
  hook_before_app_launch: default
  icon: '{target_engine}/icon_256.png'
  linux_args: ''
  linux_path: '@maya_linux'
  location:
    version: v0.6.7
    type: app_store
    name: tk-multi-launchapp
  mac_args: ''
  mac_path: '@maya_mac'
  menu_name: Launch Maya
  versions: []
  windows_args: ''
  windows_path: '@maya_windows'

It's not beautiful but it solves some issues i had width pyside package collisions and python version issues.

Cheers
/Fredrik
rez_app_launch.py

Nick von Tagen

unread,
Mar 17, 2016, 12:49:11 PM3/17/16
to rez-config
Thanks for much for posting that Fredrik, couldn't have been better timing. I am in the initial stages of setting up Toolkit so this is a great find. I was just about to start looking into this, figured it was possible.

I've made a few changes to make the hook Windows-compatible, for those of us who are less fortunate :)

I haven't put it through extensive testing at all (fair warning), but I also used this method to add our PySide Rez package to Photoshop, allowing those Toolkit apps to run. This is in addition to adding basic tools to Maya. 

I'm in regular contact with some of the Toolkit guys, so I will likely run this by them. I'll update if they have anything worth sharing.

This being my first post on the forum, definitely want to quickly give many thanks to Allan and all the contributors for the hard work! 
rez_app_launch.py

Allan Johns

unread,
Mar 17, 2016, 1:16:24 PM3/17/16
to rez-c...@googlegroups.com
Cheers Nick!

Also for yourself and others, please do feel free to add any Toolkit integration code/configs to Rez itself, if you're able to contribute to the OS project. Spread the love :). I would keep it in a clearly separate 'shotgun'/'shotgun_toolkit' directory though.

A

Nick von Tagen

unread,
Apr 13, 2016, 1:16:36 PM4/13/16
to rez-config
Yeah if I ever get a chance, I'll try to clean it up further and PR it back. 

The main downside that I see to this method is that I only get a single Maya context for the entire project. We're a small studio and can accept that limitation, but might not fly for others with a more complex pipeline. Of course, I suppose the logic in rez_app_launch.py could be extended to look for a different context based on some set of variables.

Thought I'd also pass along comments from one of their devs...


That approach seems solid. We don't have hands on experience with Rez, but do want to help figure out a good standard way for Toolkit and Rez to play nice with each other.

The other approach we've seen is to have the launcher just run "Maya.exe" and have Rez setup the environment so that PATH is appropriately configured, but what you are doing seems much more explicit and will give you more control.

The extra info param is definitely open for you to add info to. No worries there either.

I don't know enough about Rez's Python API to know how you pick a package, but if there ends up being a nice generic key in info that Rez would standardize on (I saw in the thread the invite to contribute the integration back into Rez, which would be awesome) we can definitely add that to our docs and link to whatever in Rez that would describe how to use it.

The launching part of Rez integration feels like it can be done very solidly and I like what I see here. The other issue we've seen is trying to manage Toolkit versions themselves via Rez, which is a different problem and one we hope to make progress on. If you're looking at that and have ideas, we'd love to hear them.

Allan Johns

unread,
Apr 13, 2016, 2:00:23 PM4/13/16
to rez-c...@googlegroups.com
Hey Nick and others,

I can't speak much to Toolkit as I don't have experience with it. But to briefly describe use of the rez API as it applies here:

The most common action in the API is to create a "context" - a resolved env containing the packages you asked for. Once you have this, you can launch a command within that configured env, open an interactive shell, and so on.

So here I create an environment dynamically, and run maya in it:

>>> from rez.resolved_context import ResolvedContext
>>> r = ResolvedContext(["maya-2016.sp1", "explodey-1.2+<2"])
>>> r.execute_shell(command=["maya"])

Alternatively, you can create a context and save it to file, to be used again later:

>>> r = ResolvedContext.load("explodey_maya.rxt")
>>> r.execute_shell(command=["maya"])

I don't know what kind of functionality one might want in terms of package config control in Toolkit. But I can say that the needs of a mid- to large- studio become complex, and a lot of recent Rez functionality (and a significant feature being released shortly) have been driven by this need. For example, we are able to resolve an environment dynamically when we start a tool such as maya, but at the same time put certain time constraints on that ("give me packages released only up to 8am this morning, except if a package version that I specifically require was released after that time" kind of thing).

Thx
A



Rob Blau

unread,
Apr 13, 2016, 2:59:41 PM4/13/16
to rez-c...@googlegroups.com
Hi Allan/Nick,

I can fill in a few more of the puzzle pieces from the Shotgun/Toolkit side.

One thing that Toolkit does is provide ways to launch an command in a Shotgun/Pipeline aware way.  This overlaps with Rez a little, but we don’t do any of our own environment management.  What we do is try to provide enough settings and hooks so that studios can setup their own environments and just use our buttons to get things going (although we do add in things like knowledge about the specific Task in Shotgun you are launching for to give any Toolkit tool that runs access to all the Shotgun info about it).

The bit of python code that actually does the launching of an app is a hook that can be easily taken over by a studio using Toolkit.  The default one looks like this:

And the settings that are available to that hook come from something that looks like this:

It wouldn’t be a lot of work to replace os.system with a ResolvedContext execute_shell command, using information in that “extra” setting to pass in either the path to a context or the params to use to resolve the proper context.

If it is useful to the Rez community and somebody works out a good example of this in action, we can definitely post that on our support site as best practices on how to put Rez in control of what is actually launched and the environment it is launched in.

Thanks,

-r
You received this message because you are subscribed to a topic in the Google Groups "rez-config" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rez-config/U1wFOH_DHiM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rez-config+...@googlegroups.com.

Nick von Tagen

unread,
Jun 8, 2016, 12:55:49 PM6/8/16
to rez-config
Hi,

Apologies for the hiatus, but finally got a chance to clean this up, add a brief explanation in the code, and get it into a PR. From what I can tell, this is basically doing what Rob has suggested above. 

Seems solid in testing, but we still haven't used it in a production context.
 
Reply all
Reply to author
Forward
0 new messages