-
Notifications
You must be signed in to change notification settings - Fork 856
Vfx/fix/1315493 disable paste if not allowed #5597
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
Vfx/fix/1315493 disable paste if not allowed #5597
Conversation
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. VFX Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
Hi @julienamsellem , I found a related issue which is not caused by your PR, but might be addressable here. I wonder if it's feasible to disable pasting a block subgraph within itself when opened, as it leads to a crash: |
I'd prefer to open a new issue for this case so that this PR stays "atomic" and then easier to backport or revert :) |
Sounds good! :) In that case, no outstanding issues, I've logged the above-mentioned one here: https://fogbugz.unity3d.com/f/cases/1364480/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected, no PR-specific issues found.
Thanks for the fix!
var selectedContexts = view.selection.OfType<VFXContextUI>(); | ||
var selectedBlocks = view.selection.OfType<VFXBlockUI>(); | ||
|
||
return selectedBlocks.Any() || selectedContexts.Count() == 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same check that is done when really doing the paste
else | ||
{ | ||
Debug.LogError(m_BlockPasteError.text); | ||
Debug.LogWarning(m_BlockPasteError.text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a error, rather an action that is not allowed. But with my changes it should not happen anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🟢
Purpose of this PR
https://fogbugz.unity3d.com/f/cases/1315493/
The context menu for "Contexts" in the VFX Graph had no
Paste
option.Now the paste option is added and also to avoid confusion the option is disabled when we detect that the paste action is not allowed (previously there was an error message in the console)
Testing status
Comments to reviewers
Notes for the reviewers you have assigned.