Hi guys,
I have one small issue.
(In Maya) when I print context.task then it is empty “None”, but when I try other layout file - from a different step/task, then it shows up the context.task details. Do you know where could be a problem?
Also what I found is that I can print context.task details when I do Open > Layout > new file, but when I save the file > File Save then the context.task is None
If you open a pre-saved file via the Shotgun open app, is the Task present in the context then?
And then once you save it do you lose the context?
It sounds to me like your probably losing context due to the automatic context switching. You can switch that off, but it will mean that the context won’t change automatically if the user opens a file via method other than the open app.
Could you try switching it off as a test just to confirm that the context does not lose the task?
To disable it you would add automatic_context_switch: False to all the settings blocks in this file.
If you open a pre-saved file via the Shotgun open app, is the Task present in the context then?
No
And then once you save it do you lose the context? Yes.
But when I print context.step or context.user, then I get details from them, but still not from context.task
One more thing. I have realized, that if I try to create an another shot in shotgun, then the new shot from SG is fine. So I guess, if something is wrong with SG shot in the web - the original one. - maybe setting? But I checked out everything and it seems to be same.
Interesting. Can you try unregistering the folders for one of the Shots that doesn’t work, and then running the folder creation for it again, and seeing if that helps?
Hi Philip and Patrick,
yes unregistering the folders and creating folder again worked and fixed the issue. Many thanks.
Do you know how this issue happened?
oh you mean how did your path-cache get broken? Likely that someone renamed a shot/sequence/task after the folders had been created . (Deleting the entity and creating a new one with the same name also causes issuses)
Hi guys,
I have the issue again. But now unregistering and creating folders of a shot does not work. (does not help).
We have an audio path with audio task.
I am trying to get a task from:
get_ctx = tk.context_from_path(audio_path)
get_ctx.task
it prints None
I did check the file path, sg web and it seems that it is ok.
any ideas, what could be wrong?
Hi Lukas – Sorry to hear this is happening again! I’ve replied to the ticket you sent, as I may need to get some of your configuration data from you. I’ll post an update here once it’s resolved.
We were you able to identify what was causing the issue?
We randomly started having this issue on some assets where context.task returns None.
It appears that the unregister and re-registering the folders fix the issue, but I’m wondering what caused the issue and if there is a better way to fix the issue.
One of the pipeline step’s name was change and that was causing the paths not to resolve correctly. We reverted the pipeline step’s name back and everything is back to normal.
It was not easy to find, so I hope it worn’t happen to anyone else.