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
Fusion: provide better logging for validate saver crash due type error #6082
Fusion: provide better logging for validate saver crash due type error #6082
Conversation
Doesn't make much sense to have it outside of class. Debugging of it is impossible there (because of missing logger). Imho.
Limits uncaught error when resolution info is None, which could happen when saver is not connected.
Task linked: OP-7467 Fusion: validate saver crash due type error |
Handle exception to select broken saver in the Publisher UI.
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.
Tested in Fusion 18 and was working as expected.
openpype/hosts/fusion/plugins/publish/validate_saver_resolution.py
Outdated
Show resolved
Hide resolved
openpype/hosts/fusion/plugins/publish/validate_saver_resolution.py
Outdated
Show resolved
Hide resolved
Pretty sure this is not working as expected - it just ends up doing NO validation whatsoever. Right? |
Also, it makes much more sense to make this validator EXPLICITLY check if the saver has inputs, and it not to then spew out a warning that there is no input connection as opposed to relying on the comment resolution check for that. It'll be way more explicit in the code, and if there are other cases where the resolution check will fail we'll then still be notified of those issues themselves instead of being completely unaware that no validation is occurring - as is the current case with this PR. |
I thought that this validator will fail only if inputs are not connected. There is already explicit validator for connected inputs before, but its failure is masked by failure in this validator. But it seems that this validator fails even if inputs are connected, but I couldnt replicate it and logic of this validator is a bit weird and not completely clear what it is actually checking. |
That'd be a bug then. @EmberLightVFX might have more knowledge about why it might fail. (We have this check disabled on our end so haven't hit anything that might be buggy with it since we're not using it.) Anyway, the current PR basically 'disables' the validation because it'll never pass - so current PR is invalid. Do you have a comp file that reproduces the issue? I'm fairly certain I tested the initial PR of this feature just fine.
It checks:
|
Here it makes more sense. We try to run some expression, but it might still result in None.
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.
It does Validate
correctly if no input connected to the render saver
node.
However could be nice to have better and human readible error message tho...
@kalisp @jakubjezek001 as Im now into Fusion
too, you can tag me when Review
needed too on ongoing Fusion related PRs
Thanks @LiborBatek - I'll take a look if I can make a proposal within a day or so. |
@kalisp it seems that in |
So I guess its working...fine! |
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.
tested in Fusion 18 and works fine, again ;)
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.
In the current state it'll still break whatever comment might have been there on the saver that a user might have been using if for whatever reason it was disconnected because it doesn't revert to the original value or expression. So marking this as 'request changes' to resolve that. Still want to provide better code, but keep getting 'busy' :D
I am bit confused about not resetting original expression, it should. It is probably not resetting non expression comment, but it seems that it never had and it is irrelevant to this PR. |
Lets merge and close it for now. It is better than it was before, could be make better if there will be reproducible example where it is causing issues. |
if tool["Comments"][frame] not in ["", None]: | ||
if tool["Comments"].GetExpression() is not None: | ||
has_expression = True | ||
old_comment = tool["Comments"].GetExpression() | ||
tool["Comments"].SetExpression(None) | ||
else: | ||
old_comment = tool["Comments"][frame] | ||
tool["Comments"][frame] = "" |
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.
Here the comment field is being overwritten - IF for whatever reason the user had a value there it would now be lost if the error would get raised below, because the value would not get reverted.
Which could throw meaningful info from the scene away if the user used that comment field.
What ACTUALLY happens even is that the "expression" that is being set:
tool["Comments"].SetExpression("self.Input.OriginalWidth")
Will now persist after the validation and suddenly the user has an expression on the comment field that they don't know about or shouldn't have.
Basically we're altering the user's scene in a way without taking care that it's reverted, which we shouldn't be doing.
We should be doing this through a context manager so that whatever happens, the original state gets reverted - even on the error.
BUT, even better - I'd argue that if the ACTUAL issue is that it errors on having no input connections that we explicitly capture that case - so that if for whatever other reason the resolution can't be computed we still get an error (if e.g. the node network evaluates with errors, or there's a memory overflow issue, etc.
Changelog Description
Handles reported issue for
NoneType
error thrown in conversionint(tool["Comments"][frame])
. It is most likely happening when saver node has no input connections.There is a validator for that, but it might be not obvious, that this error is caused by missing input connections and it has been already reported by
"Validate Saver Has Input"
.Additional info
Applicable for:
openpype\hosts\fusion\plugins\publish\validate_saver_resolution.py", line 44, in get_tool_resolution width = int(tool["Comments"][frame]) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Testing notes:
render
product type - unselect all nodes before!