Hi Jacob,
I think if I’m getting it right, you are really just looking for the metadata on each version. It is stored in a tracking.info
variable on the FileSource
node.
It is populated asynchronously so beware trying to find it after the source-group-complete
event. You are really looking for the graph-state-change
event that contains the tracking.info
in the event.contents()
.
In practical terms, this means, some time after you load a Shotgun source (through Shotgun Integration or Screening Room, not SG Review), you can start using some of the shotgun_mode
methods.
To do this from Python, you can use rv.runtime.eval
.
Here is a bare minimum (ie, no error handling) way of getting the version name.
import rv
rv.runtime.eval("""
shotgun_mode.theMode().versionNameFromSource("%s");
""" % rv.commands.sourcesAtFrame(rv.commands.frame())[0], ["shotgun_mode"])
The shotgun_mode
mu module has a function called theMode()
which will return the singleton ShotgunMode object. That object has a method called versionNameFromSource
where it looks up tracking info on that fileSource to get the version name.
You can dig into plugins/Mu/shotgun_mode.mu
for other methods you can call.
Alternatively you can get at the tracking.info yourself, but given the shotgun_*
modules likely do everything you want, you can just re-use the shotgun integration/screening room functions.
I hope that helps you build what you are looking to build!
-Kessler