How to create a custom location structure?
2 2

2 posts in this topic

Hi all,

I'd like to create a custom location structure, and am having a little trouble finding information on how to go about it.

Essentially, I'm creating a list of assets within a project, and I'd like to flip the directory structure around so that the project directory is inside the asset directory on the filesystem.

Ftrack stores the files like this by default:

MyProject1/
	MyAssetBuild1/
	MyAssetBuild2/
	MyAssetBuild3/
MyProject2/
	MyAssetBuild1/
	MyAssetBuild2/
	MyAssetBuild3/

I want to do this:

MyAssetBuild1/
	MyProject1/
	MyProject2/
MyAssetBuild2/
	MyProject1/
	MyProject2
MyAssetBuild3/
	MyProject1/
	MyProject2/

From this post it seems I can inherit from ftrack_api.structure.base.Structure, but I can't sort out from that post how to assemble my own directory structure.  This post also seems to indicate that it's possible, but the location docs it points to doesn't describe exactly how to do it.

Is what I'm asking for possible with the current API?  If so, is there a doc or forum post that describes what to override in ftrack_api.structure.base.Structure?

If I need to crack open the code and sort it out myself, I'm happy to, but I thought there might be some docs somewhere that I've overlooked.

Thanks for any help!

-- Lori

Share this post


Link to post
Share on other sites

Hi, here is an article about how locations work in the ftrack-python-api and how to configure a location: http://ftrack-python-api.rtd.ftrack.com/en/stable/locations/index.html

When writing your own location (+ structure) you can take inspiration from our built in standard structure: https://bitbucket.org/ftrack/ftrack-python-api/src/5b2f697ed5b2fd6941f7b0a256a82440fc090e40/source/ftrack_api/structure/standard.py?at=master&fileviewer=file-view-default. The important function to implement is the get_resource_identifier which generates the path for a specific component

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2