-
Notifications
You must be signed in to change notification settings - Fork 129
Maya: Refactor moved usage of CreateRender settings #3643
Conversation
aov_separator = self._aov_chars[( | ||
self._project_settings["maya"] | ||
["create"] | ||
["CreateRender"] | ||
["RenderSettings"] | ||
["aov_separator"] | ||
)] |
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.
Both before and after the code change I feel the except KeyError
code isn't the most "explicit" we have now. We are currently unable to identify whether the key error is due to the self._aov_chars
dictionary not having the right key or whether the Project Settings didn't have the stored setting key.
I feel like both are different errors and potentially should be handled differently. No?
Works for us now. Only thing still missing to be able to submit renders from Maya again is the actual populating of Wasn't sure whether it made sense to include it in this PR. |
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.
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.
still not passing through
// Error: pyblish.plugin : Traceback (most recent call last):
File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
runner(*args)
File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\validate_render_image_rule.py", line 30, in process
AssertionError: Workspace's `images` file rule must be set to: renders/
Traceback (most recent call last):
File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
runner(*args)
File "<string>", line 30, in process
AssertionError: Workspace's `images` file rule must be set to: renders/ //
I believe you should set it to just
I'd just put whatever the default |
Yes, it is the slash so we should change the wording in the validator message |
Technically this would also work Might just be best to strip any starting/trailing slashes when checking against it to avoid user error anyway? Also I'm not sure whether the |
@m-u-r-p-h-y How about like this? (Just configured it to |
Changed default value and changed the validator's wording.
Would you still like me to update the validator for this? |
Another question. Is there any reason why this: def get_file_rule(rule):
"""Workaround for a bug in python with cmds.workspace"""
return mel.eval('workspace -query -fileRuleEntry "{}"'.format(rule))
value = get_file_rule("images") Isn't just this: value = cmds.workspace(fileRuleEntry="images") And is there a reason why we're setting the workspace rule with Pymel using: pm.workspace.fileRules["images"] = default
pm.system.Workspace.save() Instead of doing this: cmds.workspace(fileRule=("images", default))
cmds.workspace(saveWorkspace=True) Especially since we might want to use as little Pymel as possible also with things like #2353 and #3233 Implemented these changes with 8fe2048 - please test. |
I'd just treat it the standard way we do it in other places where we deal with paths. No special treatment. |
This avoids saving it many times on repair in scenes with many renderlayers and thus many renderlayer instances since repair runs per instance.
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.
render images file rule works as expected now
I have some troubles with aov separator:
(trying to break it on purpose)
set the aov separator to - (dash)
created couple of aovs
this is the default Redshift aov settings:
<BeautyPath>/<BeautyFile>.<RenderPass>
but the error I got from Render Settings validator
// Error: pyblish.ValidateRenderSettings : AOV (BeautyAux) image prefix is not set correctly <BeautyPath>/<BeautyFile>.<RenderPass> != <BeautyPath>/<BeautyFile>_<RenderPass> //
// Error: pyblish.ValidateRenderSettings : AOV (Cryptomatte) image prefix is not set correctly <BeautyPath>/<BeautyFile>.<RenderPass> != <BeautyPath>/<BeautyFile>_<RenderPass> //
// Error: pyblish.ValidateRenderSettings : AOV file format is not the same as the one set globally 1 != 6 //
// Error: pyblish.ValidateRenderSettings : AOV (Z) image prefix is not set correctly <BeautyPath>/<BeautyFile>.<RenderPass> != <BeautyPath>/<BeautyFile>_<RenderPass> //
// Error: pyblish.plugin : Traceback (most recent call last):
File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
runner(*args)
File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\validate_rendersettings.py", line 91, in process
AssertionError: Invalid render settings found for 'Main'!
Traceback (most recent call last):
File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
runner(*args)
File "<string>", line 91, in process
AssertionError: Invalid render settings found for 'Main'! //
is using underscore
also, the file format error is not very clear, as the user is not aware of 1 and 6 and what format it actually represents.
Nice! :)
This is a known bug for Redshift Cryptomattes: #3410
The others show that it's not being validated against the correct AOV separator. That bug comes from the fact that it validates against As such, instead the validator should just be doing As such this identifies an issue that might not be a simple fix - should we separate into an issue of its own? Or if not, if someone could take over this PR from here that'd be great :) |
Yeah, it is not only redshift that allows separator to be defined per AOV (or rather the whole prefix, but that is question if we even want to support). So I vote for another issue as that one will be harder to solve. I thought we have one already for this but I cannot find it. |
should this be merged than to get |
I'd say so. This is a decent hotfix now for the issue at hand except for maybe this missing commit: |
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.
approved for images file rule
Brief description
This is a draft untested PR to fix #3642
Description
Please test publishing from Maya with up-to-date saved settings.
Testing