Returning an export path

Hello,

I was wondering if there is a way to return the file path from engine = sgtk.platform.current_engine()

I can return the template but I need the actual file path engine.sgtk.templates["substancepainter_asset_textures_path_export"]

Thank you,

1 Like

Hi @Dfulton1!
I’m not sure I fully understand. Are you saying you would like to resolve that template into an absolute path?
Or are you saying you want to get the path to the current engine bundle on disk?

1 Like

Sorry I’m not so clear just getting back into this just trying to return the project path of where the textures are being exported to I figured that using the the template would be the easiest way.

Yes to resolve the template into an absolute path.

2 Likes

OK great no problem.
I think this guide should probably help you here. It walks though how to use the API and generate a path.

If you’re looking to gather all your texture files matching that template, then the getting the next version section should help you here.

2 Likes

I’ll take a look through this but It looks like this will be good

Thank you,

2 Likes

Hello,

running into a bit of an issue, with in substance painter through the python console I have all the stuff working that I need working but when I run my script outside substance painter it cant seem to find the sgtk module I was wondering if there is something that I have to do in order to get this to import the sgtk?

2 Likes

Hey @Dfulton1, did you follow the importing sgtk step and append the path to the sgtk module you are wanting to import?

If you are using a distributed config setup, and want to run your code outside of a pre-existing Toolkit environment then you will need to bootstrap:

1 Like