fixed skeletal root

This commit is contained in:
Ondřej Samohel 2022-04-05 14:36:11 +02:00
parent 85e2601022
commit 557aafdae3
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 6 additions and 12 deletions

View file

@ -55,25 +55,19 @@ class ExtractUnrealSkeletalMesh(openpype.api.Extractor):
# variant we extract we need to rename top node of the rig correctly.
# It is finally done in context manager so it won't affect current
# scene.
parent = "{}{}".format(
instance.data["asset"],
instance.data.get("variant", "")
)
joints_parents = cmds.ls(joints, long=True)
geo_parents = cmds.ls(geo, long=True)
# we rely on hierarchy under one root.
original_parent = to_extract[0].split("|")[1]
parent_node = {
parent.split("|")[1] for parent in (joints_parents + geo_parents)
}.pop()
parent_node = instance.data.get("asset")
renamed_to_extract = []
for node in to_extract:
node_path = node.split("|")
node_path[1] = parent
node_path[1] = parent_node
renamed_to_extract.append("|".join(node_path))
with renamed(parent_node, parent):
with renamed(original_parent, parent_node):
self.log.info("Extracting: {}".format(renamed_to_extract, path))
fbx_exporter.export(renamed_to_extract, path)

View file

@ -107,7 +107,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
"hda",
"usd",
"staticMesh",
"skeletalMesh"
"skeletalMesh",
"usdComposition",
"usdOverride"
]