supports to publish groom presets in ornatrix rig extractor

This commit is contained in:
Kayla Man 2024-07-01 11:41:16 +08:00
parent e25137f137
commit d4ca4f8a36

View file

@ -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(
{