diff --git a/src/deadline/maya_adaptor/MayaClient/render_handlers/default_maya_handler.py b/src/deadline/maya_adaptor/MayaClient/render_handlers/default_maya_handler.py index 5798fc8..f9d07a8 100644 --- a/src/deadline/maya_adaptor/MayaClient/render_handlers/default_maya_handler.py +++ b/src/deadline/maya_adaptor/MayaClient/render_handlers/default_maya_handler.py @@ -6,6 +6,7 @@ from typing import Any, Dict, List, Optional import maya.cmds +import maya.mel from ..dir_map import DirectoryMapping @@ -218,3 +219,10 @@ def set_scene_file(self, data: dict): if not os.path.isfile(file_path): raise FileNotFoundError(f"The scene file '{file_path}' does not exist") maya.cmds.file(file_path, open=True, force=True) + + pre_render_mel = maya.cmds.getAttr("defaultRenderGlobals.preMel") + if pre_render_mel: + try: + maya.mel.eval(pre_render_mel) + except Exception as e: + print("Warning: preMel Failed: %s" % e) diff --git a/src/deadline/maya_submitter/assets.py b/src/deadline/maya_submitter/assets.py index b9cfa1d..e78f73f 100644 --- a/src/deadline/maya_submitter/assets.py +++ b/src/deadline/maya_submitter/assets.py @@ -27,6 +27,9 @@ def parse_scene_assets(self) -> set[Path]: # Grab tx files (if we need to) assets: set[Path] = set() + # Grab any yeti files + assets.update(self._get_yeti_files()) + if Scene.renderer() == RendererNames.arnold.value: assets.update(self._get_tx_files()) elif Scene.renderer() == RendererNames.renderman.value: @@ -47,6 +50,20 @@ def parse_scene_assets(self) -> set[Path]: return assets + def _get_yeti_files(self) -> set[Path]: + """ + If Yeti plugin nodes are in the scene, searches for fur cache files + Returns: + set[Path]: A set of yeti files + """ + yeti_files: set[Path] = set() + cache_files = Scene.yeti_cache_files() + for cache_path in cache_files: + for expanded_path in self._expand_path(cache_path): + yeti_files.add(expanded_path) + + return yeti_files + def _get_tex_files(self) -> set[Path]: """ Searches for Renderman .tex files diff --git a/src/deadline/maya_submitter/scene.py b/src/deadline/maya_submitter/scene.py index 325f5c4..ad9b6a1 100644 --- a/src/deadline/maya_submitter/scene.py +++ b/src/deadline/maya_submitter/scene.py @@ -178,6 +178,16 @@ def error_on_arnold_license_fail() -> bool: else: return True + @staticmethod + def yeti_cache_files() -> list[str]: + files = [] + nodes = maya.cmds.ls(type="pgYetiMaya") + for node in nodes: + cache_file = maya.cmds.getAttr("%s.cacheFileName" % node) + if cache_file: + files.append(cache_file) + return files + @dataclass class FrameRange: