Jump to content

Default asset


Jamie Kenyon

Recommended Posts

Posted

I was wondering if its feasible to create a default asset that will be loaded by the Launch Maya Action?

 

So we choose the Maya Action from ftrack-connect and it launches Maya. But its at this point that I'd like to ensure that there is a default ".mb" file for Maya to load.

  • 2 weeks later...
Posted

Hi,

You could use something like this to find out whether a Maya file had ever been published for a given task. If not, this will raise a NoResultFoundError, so maybe you want to use all() and check the length instead.

components = session.query('Component where version.task_id is "{0}" and file_type in'

'(".ma", ".mb")'.format(

task_id)).one()

If you already have a Maya file on disk, you could publish with just the Python API:
http://ftrack.rtd.ftrack.com/en/3.3.7/developing/reviewing/publish_components_for_review.html

And maybe you want to modify ftrack_connect_maya_hook.py so that the publish happens before Maya even starts.
Otherwise you could modify userSetup.py to load your default file and optionally publish it to the current Task.

/Johan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...