tomas Posted December 22, 2016 Report Posted December 22, 2016 Hi all, I'm new in ftrack and I changed a location structure and I have a question: Is any way to get application from which is published? e.g. I store rendered images from maya in: prefix\test_project\shots\sequence\test_050\render\maya\ But when I render from nuke I need this: prefix\test_project\shots\sequence\test_050\render\final\ Is it any way to solve it? I use Legacy API. Thanks for every ideas! Tomas
Mattias Lagergren Posted December 23, 2016 Report Posted December 23, 2016 Hi Tomas, if you've built your own location structure plugin that should be possible. You will however need to detect somehow what application the location is used in - this can be done in a number of ways but it is not something that we provide from our side.
tomas Posted December 25, 2016 Author Report Posted December 25, 2016 thanks Mattias, and what is the best way to solve it? Can you please give me some hints?
Mattias Lagergren Posted December 27, 2016 Report Posted December 27, 2016 Hi Tomas, I'm not sure what the best way is and may depend on how you launch your applications. If they are launched through ftrack Connect you will have the FTRACK_CONNECT_EVENT that can be decoded and used to detect the host application. import json import base64 application = 'other' try: identifier = json.loads( base64.b64decode(os.environ['FTRACK_CONNECT_EVENT']) ) except: # Could not decode event. pass else: if 'nuke' in identifier: application = 'nuke' elif: ... Another possibility is to try and get the ftrack connector name: import ftrack_connect.connector connector = ftrack_connect.connector.Connector.__subclasses__()[0] # Should be nuke, maya or max. connector.getConnectorName() Or, if launched outside of Connect or if you want to be agnostic to launch method I guess there are other best practices for detecting the application host; importing modules, looking at environment variables, etc.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.