"context_from_path" not working for new assets and shots on Windows only

I have a show that’s been running for sometime and until this week have had no issue getting context from path for an asset/sequence/shot using :

import sgtk
p = 'w:/jobname/sequences/sequence/shot'
tk = sgtk.sgtk_from_path( p )
ctx = tk.context_from_path( p )

Now, for any new assets/sequences/shots that are created on the show, I can only get a show level context for this path, rather than shot level when using Windows. I have ran tk.synchronize_filesystem_structure() but it makes no difference, old assets and shots still work and all assets, sequences and shots work when the same principal is run using a Linux box.

Has anyone seen this before as I urgently need to get to the bottom of it as my team can no longer render or submit new versions for review using the pipeline.

Any help most appreciated!

Thanks

Craig

1 Like

Hey Craig,

having the same issue currently on windows.

Did you find a solution in the meantime?

Cheers

Hey Paul

I ended up working it out myself a few days ago, apologies I should’ve posted it up here.

Check your Windows path in the config/core/roots.yaml and make sure it has quotes around it:

eg: windows_path: ‘w:\’

Hope that helps!

Thanks

Craig

2 Likes

Hey Craig!

No worries :slight_smile: Thanks for the quick response just now.

Putting the quotes didn’t help. In my case I was wondering why I don’t get a Task entity in my context when I give tk.context_from_path( p ) a full path to a working file. And I think the reason is explained here:

Aha - so seems like this might be a different case to mine as I was able to get full context on any entity using Linux and tk.synchronize_filesystem_structure() was not working at all on Windows until I put the quotes in place, which suggests my schema and templates are all good.

Do you have an example of file path and the corresponding template entry?
Do you get any context for the entity your are trying to identify?

1 Like

Thats interesting, I have noticed issues with unregistering folders on Windows lately (as I try and avoid having to do that).

Had to remove the local Desktop cache for this to just work again.
But I’m going to try your suggestion!

I just wanted to post here again on this as it seems my problem is back - I cannot synchronize_filesystem_structure() on Windows and therefore cannot get context_from_path on any new SG entities.

Putting the root in quotes does not solve anything - not sure how/why this temporarily started to work. I’m completely baffled and am dreading going back to support for help as basically got nothing in over 2 months of back and forth.

: (