I built a little Blender launcher action for Connect so I can integrate ftrack with my current studio setup. I have a basic launcher working well, and can open Blender both from Connect and the ftrack interface.
How do I go a step further and tell it to open the component file associated with an asset? I've found some documentation pointing me in the right direction, but can't seem to make it to the finish line. Any pointers would be appreciated!
I assume I should be grabbing the file location from the asset and pushing it through either the event data's "command" or "options" variables (http://ftrack-connect.rtd.ftrack.com/en/stable/developing/hooks/application_launch.html#developing-hooks-application-launch). Because opening a blend file from the command line isn't a keyword argument (ie, "blender my_blend_file.blend") it should be under the command variable, but I can't figure out how to get it to work. Here is my launch function:
def launch(self, event):
'''Callback method for Blender action.'''
applicationIdentifier = (
context = event['data'].copy()
# Tried opening a test file, but this crashes the action. Removing it opens default Blender file.
I've spent some time in the Maya action source code, but found little helpful for this particular problem. https://bitbucket.org/ftrack/ftrack-connect-maya/src/394b8d7a065bb67469386391caa9d883165e926a/resource/hook/ftrack_connect_maya_hook.py?at=master#ftrack_connect_maya_hook.py-74,89,117,126,131,134,137:138
If you want to go directly through the project, you can look at its "assignments" key. You can tweak the code above to query Assignment instead of Task.
Although to be fair I'm not sure the "assignments" key in a project will give you assignments for every children. I don't believe the project has assignee so it might work. I haven't tried doing so this way.
I have standalone tool that used list of projects that's loaded from Ftrack. I need to show only projects that user is involved in.
Ah, get from user side. Ok I'll try but I will need to get list of all tasks that artist is assigned to so it could be slower