Simplify pointcache proxy integration

This commit is contained in:
Toke Stuart Jepsen 2023-02-14 15:48:32 +00:00 committed by Milan Kolar
parent eb72d10f93
commit 0e896d981e

View file

@ -1,5 +1,4 @@
import os
import copy
from maya import cmds
@ -10,7 +9,6 @@ from openpype.hosts.maya.api.lib import (
maintained_selection,
iter_visible_nodes_in_range
)
from openpype.lib import StringTemplate
class ExtractAlembic(publish.Extractor):
@ -135,26 +133,14 @@ class ExtractAlembic(publish.Extractor):
**options
)
template_data = copy.deepcopy(instance.data["anatomyData"])
template_data.update({"ext": "abc"})
templates = instance.context.data["anatomy"].templates["publish"]
published_filename_without_extension = StringTemplate(
templates["file"]
).format(template_data).replace(".abc", "_proxy")
transfers = []
destination = os.path.join(
instance.data["resourcesDir"],
filename.replace(
filename.split(".")[0],
published_filename_without_extension
)
)
transfers.append((path, destination))
for source, destination in transfers:
self.log.debug("Transfer: {} > {}".format(source, destination))
instance.data["transfers"] = transfers
representation = {
"name": "proxy",
"ext": "abc",
"files": path,
"stagingDir": dirname,
"outputName": "proxy"
}
instance.data["representations"].append(representation)
def get_members_and_roots(self, instance):
return instance[:], instance.data.get("setMembers")