colt Posted April 30, 2015 Report Posted April 30, 2015 Hi, I was using .getParents() to walk up a hierarchy. But somehow most of the ancestors are instances of "ftrack.Task" instead of Shots, Sequences, Assets ... everything is a ftrack.Task.task = ftrack.Task("6294c5d0-ef42-11e4-b6a6-7ee140bd5662") //a Task on an Assetfor parent in task.getParents(): print type(parent)Result:<class 'FTrackCore.api.client.Task'> //should be Asset<class 'FTrackCore.api.client.Task'> //AssetGroup - I don't know what that should return<class 'FTrackCore.api.client.Project'> //this is correctAm I missing something here? I was expecting Shots,Sequences,Asset etc. Thanks,Nico
Lucas Correia Posted April 30, 2015 Report Posted April 30, 2015 Hi Nico, Thank you for reaching out to us. All objects in the project hierarchy are represented as Tasks in the python api. The Shot and Sequence types are only present for legacy reasons. If you wish to know which type of object the instance represents, you can use the method ftrack.Task.getObjectType As a side note, this is a common cause for confusion and something we are improving in the new api (currently in closed beta). In the new api the objects will be re represented using different types. Regards,Lucas
colt Posted May 4, 2015 Author Report Posted May 4, 2015 Ok, good to know. I hope the new api comes out soon. Cheers,Nico
Recommended Posts
Archived
This topic is now archived and is closed to further replies.