♻️ make the validation logic more clear

This commit is contained in:
Ondrej Samohel 2023-06-23 16:31:29 +02:00
parent 1279acc090
commit 97834e32ba
No known key found for this signature in database
GPG key ID: 02376E18990A97C6

View file

@ -27,9 +27,9 @@ class ValidateAssRelativePaths(pyblish.api.InstancePlugin):
errors = []
try:
relative_texture = cmds.getAttr(
absolute_texture = cmds.getAttr(
"defaultArnoldRenderOptions.absolute_texture_paths")
relative_procedural = cmds.getAttr(
absolute_procedural = cmds.getAttr(
"defaultArnoldRenderOptions.absolute_procedural_paths")
texture_search_path = cmds.getAttr(
"defaultArnoldRenderOptions.tspath"
@ -45,9 +45,9 @@ class ValidateAssRelativePaths(pyblish.api.InstancePlugin):
scene_dir, scene_basename = os.path.split(cmds.file(q=True, loc=True))
scene_name, _ = os.path.splitext(scene_basename)
if not self.maya_is_true(relative_texture):
if self.maya_is_true(absolute_texture):
errors.append("Texture path is set to be absolute")
if not self.maya_is_true(relative_procedural):
if self.maya_is_true(absolute_procedural):
errors.append("Procedural path is set to be absolute")
anatomy = instance.context.data["anatomy"]