Note attachment with frame number - Python API

Hi Jonas, you might want to try the following. WARNING: This gets hacky, fast.

I’m assuming you have a Note already linked to your Version. Then you’ll need:

  • Your image will need to be called annot_version_<version_id>.<frame_number>.png
  • You’ll create a File entity (script name: Attachment) and upload the file to that.
  • You’ll need to link the File to your note above.

This being said, File entities can’t be created directly through the API, they are a result of uploading to a File field on another entity. Here’s where it gets a bit hacky…

When in production I used to create a version per project that would be a placeholder. I’d upload something to that version which would then create a File record. At this point, I wouldn’t care about the version but the File would become a useful tool/placeholder. If I needed to create a File entity, I’d upload to the this_file field of my placeholder. This creates a new File record without triggering the transcoder (like when uploading to sg_uploaded_movie on a version). Once the File record was uploaded I’d change it’s attributes with an update call.

Like I said… hacky.

5 Likes