Merge pull request #5560 from ynput/enhancement/remove-ass-export-script

Chore: Removed Ass export script
This commit is contained in:
Jakub Trllo 2023-09-05 11:30:58 +02:00 committed by GitHub
commit c08190ccf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 225 deletions

View file

@ -334,12 +334,6 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
payload = self._get_vray_render_payload(payload_data)
elif "assscene" in instance.data["families"]:
self.log.debug("Submitting Arnold .ass standalone render..")
ass_export_payload = self._get_arnold_export_payload(payload_data)
export_job = self.submit(ass_export_payload)
payload = self._get_arnold_render_payload(payload_data)
else:
self.log.debug("Submitting MayaBatch render..")
payload = self._get_maya_payload(payload_data)
@ -635,53 +629,6 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
return job_info, attr.asdict(plugin_info)
def _get_arnold_export_payload(self, data):
try:
from openpype.scripts import export_maya_ass_job
except Exception:
raise AssertionError(
"Expected module 'export_maya_ass_job' to be available")
module_path = export_maya_ass_job.__file__
if module_path.endswith(".pyc"):
module_path = module_path[: -len(".pyc")] + ".py"
script = os.path.normpath(module_path)
job_info = copy.deepcopy(self.job_info)
job_info.Name = self._job_info_label("Export")
# Force a single frame Python job
job_info.Plugin = "Python"
job_info.Frames = 1
renderlayer = self._instance.data["setMembers"]
# add required env vars for the export script
envs = {
"AVALON_APP_NAME": os.environ.get("AVALON_APP_NAME"),
"OPENPYPE_ASS_EXPORT_RENDER_LAYER": renderlayer,
"OPENPYPE_ASS_EXPORT_SCENE_FILE": self.scene_path,
"OPENPYPE_ASS_EXPORT_OUTPUT": job_info.OutputFilename[0],
"OPENPYPE_ASS_EXPORT_START": int(self._instance.data["frameStartHandle"]), # noqa
"OPENPYPE_ASS_EXPORT_END": int(self._instance.data["frameEndHandle"]), # noqa
"OPENPYPE_ASS_EXPORT_STEP": 1
}
for key, value in envs.items():
if not value:
continue
job_info.EnvironmentKeyValue[key] = value
plugin_info = PythonPluginInfo(
ScriptFile=script,
Version="3.6",
Arguments="",
SingleFrameOnly="True"
)
return job_info, attr.asdict(plugin_info)
def _get_vray_render_payload(self, data):
# Job Info

View file

@ -1,105 +0,0 @@
"""This module is used for command line exporting of ASS files.
WARNING:
This need to be rewriten to be able use it in Pype 3!
"""
import os
import argparse
import logging
import subprocess
import platform
try:
from shutil import which
except ImportError:
# we are in python < 3.3
def which(command):
path = os.getenv('PATH')
for p in path.split(os.path.pathsep):
p = os.path.join(p, command)
if os.path.exists(p) and os.access(p, os.X_OK):
return p
handler = logging.basicConfig()
log = logging.getLogger("Publish Image Sequences")
log.setLevel(logging.DEBUG)
error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}"
def __main__():
parser = argparse.ArgumentParser()
parser.add_argument("--paths",
nargs="*",
default=[],
help="The filepaths to publish. This can be a "
"directory or a path to a .json publish "
"configuration.")
parser.add_argument("--gui",
default=False,
action="store_true",
help="Whether to run Pyblish in GUI mode.")
parser.add_argument("--pype", help="Pype root")
kwargs, args = parser.parse_known_args()
print("Running pype ...")
auto_pype_root = os.path.dirname(os.path.abspath(__file__))
auto_pype_root = os.path.abspath(auto_pype_root + "../../../../..")
auto_pype_root = os.environ.get('OPENPYPE_SETUP_PATH') or auto_pype_root
if os.environ.get('OPENPYPE_SETUP_PATH'):
print("Got Pype location from environment: {}".format(
os.environ.get('OPENPYPE_SETUP_PATH')))
pype_command = "openpype.ps1"
if platform.system().lower() == "linux":
pype_command = "pype"
elif platform.system().lower() == "windows":
pype_command = "openpype.bat"
if kwargs.pype:
pype_root = kwargs.pype
else:
# test if pype.bat / pype is in the PATH
# if it is, which() will return its path and we use that.
# if not, we use auto_pype_root path. Caveat of that one is
# that it can be UNC path and that will not work on windows.
pype_path = which(pype_command)
if pype_path:
pype_root = os.path.dirname(pype_path)
else:
pype_root = auto_pype_root
print("Set pype root to: {}".format(pype_root))
print("Paths: {}".format(kwargs.paths or [os.getcwd()]))
# paths = kwargs.paths or [os.environ.get("OPENPYPE_METADATA_FILE")] or [os.getcwd()] # noqa
mayabatch = os.environ.get("AVALON_APP_NAME").replace("maya", "mayabatch")
args = [
os.path.join(pype_root, pype_command),
"launch",
"--app",
mayabatch,
"-script",
os.path.join(pype_root, "repos", "pype",
"pype", "scripts", "export_maya_ass_sequence.mel")
]
print("Pype command: {}".format(" ".join(args)))
# Forcing forwaring the environment because environment inheritance does
# not always work.
# Cast all values in environment to str to be safe
env = {k: str(v) for k, v in os.environ.items()}
exit_code = subprocess.call(args, env=env)
if exit_code != 0:
raise RuntimeError("Publishing failed.")
if __name__ == '__main__':
__main__()

View file

@ -1,67 +0,0 @@
/*
Script to export specified layer as ass files.
Attributes:
scene_file (str): Name of the scene to load.
start (int): Start frame.
end (int): End frame.
step (int): Step size.
output_path (str): File output path.
render_layer (str): Name of render layer.
*/
$scene_file=`getenv "OPENPYPE_ASS_EXPORT_SCENE_FILE"`;
$step=`getenv "OPENPYPE_ASS_EXPORT_STEP"`;
$start=`getenv "OPENPYPE_ASS_EXPORT_START"`;
$end=`getenv "OPENPYPE_ASS_EXPORT_END"`;
$file_path=`getenv "OPENPYPE_ASS_EXPORT_OUTPUT"`;
$render_layer = `getenv "OPENPYPE_ASS_EXPORT_RENDER_LAYER"`;
print("*** ASS Export Plugin\n");
if ($scene_file == "") {
print("!!! cannot determine scene file\n");
quit -a -ex -1;
}
if ($step == "") {
print("!!! cannot determine step size\n");
quit -a -ex -1;
}
if ($start == "") {
print("!!! cannot determine start frame\n");
quit -a -ex -1;
}
if ($end == "") {
print("!!! cannot determine end frame\n");
quit -a -ex -1;
}
if ($file_path == "") {
print("!!! cannot determine output file\n");
quit -a -ex -1;
}
if ($render_layer == "") {
print("!!! cannot determine render layer\n");
quit -a -ex -1;
}
print(">>> Opening Scene [ " + $scene_file + " ]\n");
// open scene
file -o -f $scene_file;
// switch to render layer
print(">>> Switching layer [ "+ $render_layer + " ]\n");
editRenderLayerGlobals -currentRenderLayer $render_layer;
// export
print(">>> Exporting to [ " + $file_path + " ]\n");
arnoldExportAss -mask 255 -sl 1 -ll 1 -bb 1 -sf $start -se $end -b -fs $step;
print("--- Done\n");