assemblies were not loading correctly

This commit is contained in:
Milan Kolar 2019-12-03 16:24:10 +01:00
parent 7ff6f468fa
commit 1ddf61a7ce
4 changed files with 28 additions and 9 deletions

View file

@ -24,7 +24,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
label = "Integrate Asset"
order = pyblish.api.IntegratorOrder
families = ["assembly"]
families = []
exclude_families = ["clip"]
def process(self, instance):

View file

@ -70,7 +70,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
"audio",
"yetiRig",
"yeticache",
"source"
"source",
"assembly"
]
exclude_families = ["clip"]

View file

@ -43,14 +43,16 @@ class ReferenceLoader(pype.maya.plugin.ReferenceLoader):
namespace = cmds.referenceQuery(nodes[0], namespace=True)
shapes = cmds.ls(nodes, shapes=True, long=True)
print(shapes)
newNodes = (list(set(nodes) - set(shapes)))
print(newNodes)
current_namespace = pm.namespaceInfo(currentNamespace=True)
if current_namespace != ":":
groupName = current_namespace + ":" + groupName
groupNode = pm.PyNode(groupName)
roots = set()
print(nodes)
for node in newNodes:
try:

View file

@ -22,11 +22,11 @@ class ExtractAssembly(pype.api.Extractor):
def process(self, instance):
parent_dir = self.staging_dir(instance)
staging_dir = self.staging_dir(instance)
hierarchy_filename = "{}.abc".format(instance.name)
hierarchy_path = os.path.join(parent_dir, hierarchy_filename)
hierarchy_path = os.path.join(staging_dir, hierarchy_filename)
json_filename = "{}.json".format(instance.name)
json_path = os.path.join(parent_dir, json_filename)
json_path = os.path.join(staging_dir, json_filename)
self.log.info("Dumping scene data for debugging ..")
with open(json_path, "w") as filepath:
@ -46,8 +46,24 @@ class ExtractAssembly(pype.api.Extractor):
"uvWrite": True,
"selection": True})
instance.data["files"] = [json_filename, hierarchy_filename]
if "representations" not in instance.data:
instance.data["representations"] = []
representation_abc = {
'name': 'abc',
'ext': 'abc',
'files': hierarchy_filename,
"stagingDir": staging_dir
}
instance.data["representations"].append(representation_abc)
representation_json = {
'name': 'json',
'ext': 'json',
'files': json_filename,
"stagingDir": staging_dir
}
instance.data["representations"].append(representation_json)
# Remove data
instance.data.pop("scenedata", None)