Context task - None

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

Thanks.

3 Likes

Hey Lukas

Welcome to the forums, thanks for posting here.

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.

Best
Phil

2 Likes

Hi Phil,

that option didn’t work. :frowning:

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. :confused:

Any other idea where could be a problem?

Thanks

Lukas

1 Like

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?

3 Likes

And don’t forget to do a tank synchronize_folders --full

1 Like

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?

Thanks.

2 Likes

The context task is derived from the path-cache, so if that’s broken, then you’ll have context issues.

1 Like

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)

3 Likes