I wrote a custom app and want it to use the snapshot save functionality in it and was wondering if I could just call the snapshot app from my custom app.
Donna
I wrote a custom app and want it to use the snapshot save functionality in it and was wondering if I could just call the snapshot app from my custom app.
Donna
Hi Donna,
Assuming that your custom app is running within an environment/engine where the snapshot app is also present, you can do the following:
import sgtk
current_engine = sgtk.platform.current_engine()
tk_app = "tk-multi-snapshot"
app = current_engine.apps.get(tk_app)
app.snapshot(comment="test")
This will call the public snapshots
method on the app. This method can be optionally passed a comment and a thumbnail, so you would need to handle the creation of these two things if they are required.
Also in the code above you may not need to run the current_engine = sgtk.platform.current_engine()
bit if you’re in your app, as you can get the engine, via app.engine.
Cheers
Phil
That’s exactly what I needed! Thanks!
Donna