Add "project.tank_name" and "step.short_name" to sgtk.Context

Hi everyone!

I want to propose a small feature request to add the fields “project.tank_name” and “step.short_name” to the sgtk.Context. They are used throughout all SGTK templates and I find myself querying them in quite a few places in my code. It would just be handy to have them at the finger tips when you need them.

To be clear here I would love this to pseudo code to work:

>>> import sgtk
>>> tk = sgtk.sgtk_from_path("/studio.08/demo_project")
>>> ctx = tk.context_from_path("/studio.08/demo_project/sequences/AAA/ABC/Light/work")
>>> ctx.project
{'type': 'Project', 'id': 4, 'name': 'demo_project', 'tank_name': 'dp'}  # extra "tank_name" field
>>> ctx.step
{'type': 'Step', 'id': 12, 'name': 'Light', 'short_name': 'LGT'}  # extra "short_name" field

I know that you probably do not want to start adding “arbitrary” fields to the Context object, but since these fields are used quite a lot, I hope you are willing to consider :smiley: .



fwiw, you can get at the tank name via tk.pipeline_configuration._project_name.
But I agree it would be nice to have this information in the context, and the step short name, too.


Hi @mmoshev! Thanks for the trick shot (did not know about this one) and for the plus one! :smiley:

Can I +9000 (and over) this? :heart_eyes:


Hi @shotgun!
We are currently at +9002 for this feature request :grimacing:, what do you think about this idea?