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.
No worries 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?
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.