Jump to content

How to keep both apis running at the same time


Eder Agreda

Recommended Posts

Hello. as you  suggested, I am trying the new api.I read that its possible to keep both

apis running at the same time and I tried a little exercise:

I queried a sequence  using both apis and I got this result:

1.PNG.a91636a4f661be2ba8906e86385e5fdd.P

the first line its the result using the old api and the last one ,using the last one.

Then,I tried to create a folder:

both.PNG.779fbe93a0045e95adf3ecd72b25ac2

 

if  in "session.create" in "parent " I use "sequence01" it works fine but If I use  "sequence" I got an error ,so I would appreciate If  anyone could tell me what do I need  to  make it work.

 

Greetings and sorry If I am asking too many questions.

 

 

 

Link to comment
Share on other sites

"sequence" is the old apis object, and "sequence01" is the new apis object. You can't mix objects between the apis.

If you are using the new api for creating you will need "sequence01". As for your example you are better off getting the id of an object in the old api, and then get the new apis object by querying the id (I haven't tested the below code):

old_sequence = ftrack.getSequence(["createcondorito", "test"])

new_sequence = session.query('Sequence where id is "%s"' % old_sequence.getId())

session.create("Folder", {"name": "testFolder", "parent": new_sequence})

session.commit()

Hope that helps :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...