Path Generator

Hi, new here, maybe wrong section of forum, not sure how it goes here …

I have one (well many more, but one step at a time amirite :smiley: ), quick question

Can someone please provide simplest shortest possible working script that would achieve path/file-path creation using correct pipeline configuration (python), without running under some application that has toolkit already configured by SG-DESKTOP ?

I have tk-core/python is sys paths and can access it. Same with shotgun_api3
But all my attempts to get or create context failed.

mainly on this error:
tank.errors.TankInitError: The pipeline configuration with id 34, associated with Project 122, cannot be instantiated because it is a distributed config. To launch this kind of configuration, use the Bootstrap API instead…

(BUT HOW would one use Bootstrap API ??) Also it seams a bit overkill to create several thousands lines of boilerplate bootstrapping code just to get back one file-path.

current progress

import custom shotgun_api database manager
list projects
pick one

entity = ( ‘Project’, 122 )
_tk = sgtk.sgtk_from_entity( *entity )

… # ERROR

needs to be resolved

ctx = _tk.context_from_entity( *entity )
tmpl = _tk.templates[ ‘ocio’ ]
fields = ctx.as_template_fields(tmpl)
out = template.apply_fields(fields)

Please. Help me create simplest way to create or resolve path using correct config

First you need to get project sgtk then you can get template and generate path, look at this:

nice, thank you.

it takes just 24 seconds to get a simple path , very nice, such performance.
:dog2:

Now… is there a way to somehow trick env/project.yaml not to load all tool-kits if I just need “shell” for example ?
Or I have to create separate pipeline_config just to get some speed improvement ?


tried separate config with just shell and shotgun tool-kits. And it is still 10+ seconds to get path resolved.

biggest slowdowns are in :
configuration_writer.py
–>> core_descriptor.copy(core_target_path)

Bit excessive I think