1

Listing all shots without thumbnails

what is the query to get a list of all shots that dont have a thumbnail attached?


having no luck using the 'image' column name to query against - 'image data cannot be used in a filter'

cheers,

Ian

4件のコメント

  • 0
    Avatar
    Hugh Macdonald

    I'm not sure you can do this in a specific query....

     

    you could wrap it with something like:

     

    tempShots = sg.find("Shot", [["project.Project.code", "is", "myProj"]], fields=["image"])

    shots = []

    for shot in tempShots:

        if not shot['image']:

            shots.append(shot)

  • 0
    Avatar
    Hugh Macdonald

    Oops - premature posting there!

     

    I was going to say that the method I suggested will be a lot slower than it could be, because there's code in the API that takes an image ID and gets the URL for the image. This has to be run on every returned item that has an image, which slows things down significantly.

     

    You could tweak the API at your end (or the Shotgun guys could at their end?) to give an option to just return image IDs, which you could then check (I'm guessing None or 0 if there's no image), which wouldn't be too much slower than what you were after in the first place.

  • 0
    Avatar
    KP

    We don't currently have a good way to do this via the API at the moment. It's definitely something we've been looking to improve and it's currently scheduled for an upcoming development sprint based on user feedback so we'll update when it's done (hopefully soon!).

    kp

  • 0
    Avatar
    Dennis Serras

    Any news? I'm trying to write a script that doesn't overwrite existing thumbnails.

ログインしてコメントを残してください。