Jump to content

objectTypes of getParents


colt

Recommended Posts

Posted

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 correct

Am I missing something here? I was expecting Shots,Sequences,Asset etc.

 

Thanks,

Nico

 

 

Posted

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

Archived

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

×
×
  • Create New...