Jump to content

Duplicate Componets


tokejepsen

Recommended Posts

Capture.PNG

This code does complain when the files exists on disk, but if you manually delete the file on disk, you can run this several times.

# Retrieve location by name.
location = session.query(
    'Location where name is "toke.laptop"'
).one()

# Assign a disk accessor with *temporary* storage
location.accessor = ftrack_api.accessor.disk.DiskAccessor(
    prefix=r"C:\Users\admin\Documents\test"
)

# Assign using ID structure.
location.structure = ftrack_api.structure.standard.StandardStructure()

version.create_component(path=r"C:\Users\admin\Documents\test\test.txt",
                         location=location)
session.commit()

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...