How to compare version field with linked shot field?

Hi all,

I am trying colour code my version pages so that versions go red if their sg_frame_count field does not match the linked shot’s sg_working_duration. I thought I could achieve this by creating a calculated Version field (checkbox) that does the comparison and sets it’s value to true/false accordingly. Then I could set up a simple page rule based on the field’s value.

Turns out calculated fields don’t seem to allow accessing a linked entity’s field? At least it’s not apparent.
I could use the event listener but would rather not.
Any ideas?

Cheers,
frank

4 Likes

Hey Frank,
Using the event daemon is your best option, right now. We will revisit calculated fields at some stage in the future, and hope to include linked fields as part of that v02, but we have no plans in the short term.
Cheers,

Mason.

2 Likes

Ok, thanks for confirming Mason.
I do hope calculated fields will get a review sooner than later. In their current state they are of little more use to us than calculating frame ranges based on handles, and that is something that gets published via python anyway and could thus be calculated at the ingest stage stage.
I wonder what other people use those for with their current limitations of not being able to reference linked entities?!

3 Likes

We use a calculated field (converting frames to minutes) to calculate how many minutes of animation (or whatever stage - layout, etc.) we have completed to see if we’re on target for our project. The formula is a bit clunky and we never figured out how to get it to say “min” and not “hrs” but by golly, we know what it’s referring to and we love our little red-headed calculated field stepchild! :slight_smile:
26

4 Likes

This is a really fundamental mechanism that Shotgun must be able to do better.

I’m just working on making Alembic caches’ frame ranges validating in much the same way.

Thorny subtopics (relating to the need for more robust ‘calculated’ metadata-fields) will present themselves… eg.: the need to be smart about not flagging pre-roll frame ranges (added for for simulations) throwing off any “this asset isn’t set to the right frame range”-red flags.

QC’ing assets can be done elsewhere but the notifications need to go right into Shotgun in the right dependency location, but, it’s a question of just how much of the surrounding metadata needs to be visible in Shotgun to help paint a contextual picture. It’s a “easything to add” metastasizing into a complete nightmare decision point when you get into the implementation – esp. when you have to decide if you need to add more fields – my pet peeve.

In my quest to avoid extra fields (specifically for “correct frame range” tracking) I prototyped using one field (link to a “Cut Item”) rather than adding two fields to Published File entities (start frame, end frame). Only some files have a timeline, after all.

The jury is still out – because there are costs and risks in polluting what ostensibly is an editorial entity into a general-purpose timeline entity.

I-love-databases-I-hate-databases.

2 Likes

Thanks Jessica,

that sounds cool for an animation project.
Though for us it’s more important to ensure that versions in Shotgun
are actually of the correct length as per the recorded timecodes for
the respective shot.
It has happened too many times that editorial ended up with
incorrect frame ranges when a delivery had to happen under pressure.
The calculate field seemed a perfect solution as versions could go
be drawn red (or whatever) immediately upon viewing and any mistakes
would be caught straight away - if it could reference linked
entities.

Cheers,
frank

2 Likes

I didn’t mean to suggest you should use it similarly - I was just being sort of silly in response to your “what do people use this for?” I agree it’d would be great to have it calculate on linked entities.

3 Likes

Sure, sorry, I didn’t mean to sound dismissive. I was/am genuinely interested how people use this field, so thanks for sharing!

3 Likes

looks like calculated fields don’t trigger a shotgun event in the daemon?!
I will start a new thread about this as this it going off on a tangent now…

2 Likes

So just to conclude this thread for posterity, my solution was this:

  • added a version checkbox field called “sg_matching_duration”
  • added a plugin to the event daemon to react to a Shot’s sg_head_in and sg_tail_out fields as well as a version’s frame count field.
  • if the event comes from a version field I compare it’s frame count to the shot’s working duration and assign a new value to the sg_matching_duration accordingly
  • if the event came from a shot I cycle through all the linked versions and run the check for each one
  • set up a global page filter that colour codes versions red if their sg_matching_duration is not checked (make sure it’s the top page rule so it won’t get overwritten by others)

This took a fair amount of time and has to wait for the event daemon to do it’s thing, but it seems to work.

It would be much preferable though if we could use a calculated field to do the above.

Cheers,
frank

4 Likes

Hey @frank—I went ahead and marked your reply as a solution. Thanks for taking the time to come back to share your approach!

can you mark it as a workaround until there is a solution? :smiley:

1 Like

I’ll go request that feature from the Discourse folks. :+1:

1 Like

haha, touché

1 Like

Meet in the middle? Added a #workaround tag. :smiley:

2 Likes