From d4ca4f8a361cc1b2e5d8fdf9ddfef5a53e60bea9 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 1 Jul 2024 11:41:16 +0800 Subject: [PATCH] supports to publish groom presets in ornatrix rig extractor --- .../plugins/publish/extract_ornatrix_rig.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server_addon/maya/client/ayon_maya/plugins/publish/extract_ornatrix_rig.py b/server_addon/maya/client/ayon_maya/plugins/publish/extract_ornatrix_rig.py index 821bd1b982..75eb08a244 100644 --- a/server_addon/maya/client/ayon_maya/plugins/publish/extract_ornatrix_rig.py +++ b/server_addon/maya/client/ayon_maya/plugins/publish/extract_ornatrix_rig.py @@ -6,7 +6,7 @@ import json from ayon_maya.api import lib from ayon_maya.api import plugin -from maya import cmds +from maya import cmds, mel class ExtractOxRig(plugin.MayaExtractorPlugin): @@ -77,6 +77,7 @@ class ExtractOxRig(plugin.MayaExtractorPlugin): # Ornatrix related staging dirs maya_path = os.path.join(dirname, "ornatrix_rig.{}".format(self.scene_type)) + ox_groom_path = os.path.join(dirname, "ornatrix_rig.oxg.yaml") nodes = instance.data["setMembers"] with lib.maintained_selection(): with lib.attribute_values(texture_attributes): @@ -88,6 +89,7 @@ class ExtractOxRig(plugin.MayaExtractorPlugin): preserveReferences=False, constructionHistory=True, shader=False) + mel.eval(f"OxSaveGroom -path {ox_groom_path}") # Ensure files can be stored # build representations @@ -104,6 +106,16 @@ class ExtractOxRig(plugin.MayaExtractorPlugin): } ) + self.log.debug("OxGroom file: {}".format(ox_groom_path)) + instance.data["representations"].append( + { + 'name': "yaml", + 'ext': "yaml", + 'files': os.path.basename(ox_groom_path), + 'stagingDir': dirname + } + ) + self.log.debug("settings file: {}".format(settings_path)) instance.data["representations"].append( {