Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workfiles tool: Fix update of context change #374

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Apr 4, 2024

Changelog Description

Context change is propagated correctly, because controller of workfiles tool does capture it correctly.

Additional info

Change the context also in controller, and unify the context change into single method. Removed reset of controller on save as ( I'm not sure why the reset was there, probably only to update current context?).

How to replicate (maybe)

  1. Launch DCC -> Task 1.
  2. Open workfiles tool.
  3. Keep folder, and change task and open workfile. Must be Open not Save as. -> Task 2
  4. Check current context in AYON menu
  5. Open workfiles tool again.
  6. Again keep folder, change task back to the first one. -> Task 1
  7. Context in AYON menu should show context of Task 2

Testing notes:

  1. Workfile opened in same folder, but different task will change the context.

Resolves #180

@ynbot ynbot added the type: bug Something isn't working label Apr 4, 2024
@ynbot ynbot added the size/XS label Apr 4, 2024
@BigRoy
Copy link
Collaborator

BigRoy commented Apr 4, 2024

Followed the testing notes and seemed to work fine in Maya, Houdini and Fusion.
However, I'm not entirely sure how to reproduce the actual bug this is trying to fix that would exist without this PR.

Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine in Maya, Houdini and Fusion. However see my comment - not sure what this fixes.

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Houdini.. works fine.

I wonder if it fixes this issue #180
I tried replicating the issue but it seems it's fixed.

@iLLiCiTiT
Copy link
Member Author

iLLiCiTiT commented Apr 4, 2024

Modified the steps a little. With them I was able to replicate the issue consistently.

Opened maya on animation task > open workfile on generic > open workfile on animation. Global context is still on generic.
Animation

@iLLiCiTiT iLLiCiTiT merged commit 68ab872 into develop Apr 4, 2024
10 of 11 checks passed
@iLLiCiTiT iLLiCiTiT deleted the bugfix/workfiles-tool-context-update-fix branch April 4, 2024 15:57
@BigRoy
Copy link
Collaborator

BigRoy commented Apr 4, 2024

I could not reproduce this in develop initially. I had a feeling that somehow the issue was actually related to the scene file you're opening and that it's maybe reading the "context" from the OpenPypeContext metadata that might be saved in the scene.

So what I did was save the modeling scene into lighting WITHOUT updating the context data (e.g. do not update create context, just save the file there without publisher reset, etc.). Then in develop indeed I get the issue that changing task would somehow not be at the right context.

However note that I could also reproduce that when that file was saved to another folder - not just the task change.

@BigRoy
Copy link
Collaborator

BigRoy commented Apr 4, 2024

As such I think the ACTUAL issue isn't the resetting to match with the current context - but the fact that we're somehow allowing to rely on the 'workfile' metadata to be the ground truth for that particular context and allowing it to override the actual session's context.

So even though this workaround PR works - there apparently still is some logic somewhere where "resetting" means resetting it to the invalid context.

Anyway, with this PR I was unable to intentionally try and break it - so I guess it's safe for now :D

@MustafaJafar
Copy link
Contributor

Anyway, with this PR I was unable to intentionally try and break it - so I guess it's safe for now :D

same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Houdini: workfile tool doesn't switch context properly
5 participants