Graphing Number of Versions per Shot

We’re creating a canvas page to visualize how many iterations we go through per shot. I’d love to be able to build a graph that summarizes the number of versions per shot grouped by version count. In other words something like this:

Number of Shots with only 1 version = 12
Shots with 2 versions = 3
Shots with 3 versions = 2

Any ideas on how to build something like this? I’d be open to using query fields or graphs (really anything that works). It seems like this should be exceedingly simple, but from what I can tell, I’m unable to do this because summaries of multi-entity fields are not allowed. (aka the Version ↔ LINK field)

Hi DavidA,
I am fairly new to Shotgrid so I am unaware as how it can be done using the design page but you can create a (Qt) dekstop application that can extract this information for you from Shotgrid using the Shotgrid’s Python API shotgun_api3. If you require any help with this do let me know.

Hey David,

You should be able to do this in Shotgrid. I made an example widget to show the results.

You can follow these steps and hopefully it would give you the result you are looking for.

  1. Go to design view on any page.
  2. Choose the canvas option
    image
  3. Once in the canvas view. Drag the Graph widget and choose the version Entity and click configure
  4. You can update the Data Set section on the left to look something like this.
  5. Make sure to apply some filters so that it doesn’t try to graph every single version in the project. I have applied the filters so it only shows me versions for shots and in a single episode.
    image

This should get you to the same result as in my initial screenshot.

3 Likes

Alternatively, create a field on your Shot records to be populated with an event plugin (or web hook) that triggers as versions are linked to your shot to calculate and then store the count. Then you can graph those values (to get a count of how many Shots with 2 versions, or how many shots with 3 versions). Query fields don’t store the values, so they can’t be used to filter or sort and (I’m guessing) might not be supported in a graph form. A calculation field would be fine except that you can’t reference related records across a one-to-many relationship (like one shot to multiple versions).

Thanks everyone for the replies!

@PratikTayshete - I’m not familiar with Qt, so thank you for recommending it. I’m definitely going to explore that for this and future projects!

@Rachit_Singh - Thank you for the detailed reply! What I’m looking to do is one level of abstraction away from what you’ve accomplished. Instead of listing every shot, what I’d like to do is summarize all shots based on how many versions are linked to them. So for your data it would look like this:
Shots with 1 version: 6
Shots with 2 versions: 3
Shots with 4 versions: 1
Shots with 5 versions: 1
Shots with 6 versions: 2
etc…

The page I’m working in displays data for the whole episode, so this would need to quickly summarize 400+ shots in an easy to read graph.

@kim I believe this is exactly the issue with my request. I appreciate the reply - we will likely be able to resolve this with an event plugin (then graph the calculation result using the built in SG widgets) These kind of statistics seem fairly fundamental to calculate on demand, but as I learned while writing this post, they are not as obvious or easy to explain as I initially thought. An event plug-in/webhook would be a fairly straight forward alternative.

Thanks again, everyone.

1 Like