From f8f9c4f085ccd5463095d548a3f7ee85eafb997c Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Mon, 29 Jul 2019 15:51:43 +0100 Subject: [PATCH] Fix get_prefix and workspace root. --- pype/plugins/maya/publish/validate_rendersettings.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pype/plugins/maya/publish/validate_rendersettings.py b/pype/plugins/maya/publish/validate_rendersettings.py index f4798e6dbe..0d983b9cf1 100644 --- a/pype/plugins/maya/publish/validate_rendersettings.py +++ b/pype/plugins/maya/publish/validate_rendersettings.py @@ -1,6 +1,6 @@ import os -import maya.cmds as cmds +from maya import cmds, mel import pymel.core as pm import pyblish.api @@ -69,7 +69,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): cls.log.error("Animation needs to be enabled. Use the same " "frame for start and end to render single frame") - fname_prefix = cls.get_prefix(cls, renderer) + fname_prefix = cls.get_prefix(renderer) if prefix != fname_prefix: invalid = True @@ -86,8 +86,10 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): @classmethod def get_prefix(cls, renderer): prefix = cls.RENDERER_PREFIX.get(renderer, cls.DEFAULT_PREFIX) + # maya.cmds and pymel.core return only default project directory and + # not the current one but only default. output_path = os.path.join( - pm.workspace.getcwd(), pm.workspace.fileRules["images"] + mel.eval("workspace -q -rd;"), pm.workspace.fileRules["images"] ) # Workfile paths can be configured to have host name in file path. # In this case we want to avoid duplicate folder names. @@ -110,7 +112,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): node = render_attrs["node"] prefix_attr = render_attrs["prefix"] - fname_prefix = cls.get_prefix(cls, renderer) + fname_prefix = cls.get_prefix(renderer) cmds.setAttr("{}.{}".format(node, prefix_attr), fname_prefix, type="string")