lukas g Posted June 15, 2018 Report Share Posted June 15, 2018 Hello, I need to write some checks using the python api to make sure the current ftrack project is configured correctly. There fore i need to query the currents project Project Schema and check its configuration. Specifically: I need to query the assigned Objecty (ObjectTypes) of a Project Schema. I can access the the Types and objects with 'ProjectSchema.get_types()' as well as the statuses an by calling 'ProjectSchema.get_statuses()' but i can't find a way to actually figure out if an object (ObjectType) is assigned to the list of objects of the particular Project Schema. (I can easily find out if a specific object type exists at all using 'session.query("ObjectType where name is my_object_type_name")' but not which schemas it is assigned to.) I know from a different post, that creating new ProjectSchemas and "manage" them (editing them?) is only supported using the GUI. But What about retrieving the assigned Objects (ObjectTypes) ? It should be possible i guess. The Docs from ProjectSchema dont show any more methods:http://ftrack-python-api.rtd.ftrack.com/en/1.4.0/api_reference/entity/project_schema.html Examples for get_types() and get_statuses:http://ftrack-python-api.rtd.ftrack.com/en/1.4.0/example/project.html I Hope someone can help me out. Thank you in advance Lukas Link to comment Share on other sites More sharing options...
lukas g Posted June 15, 2018 Author Report Share Posted June 15, 2018 Maybe there is another way of finding out which object types are assigned to my project so i can prevent a ServerError like this from happening:"ServerError: Server reported error: ValidationError(Object type u'Shot' cannot be created on project u'Lukas Dev'.)" The only solution i found for now i to try to create the desired types on startup to check if i can create them and catch the server error and show it to the TD to properly configure the ftrack project. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted June 19, 2018 Report Share Posted June 19, 2018 Querying out the existing ObjectTypes for project schema is something that we are working and should come out in an upcoming maintenance release Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.