mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
Account for multiple descriptions on single geometry.
This commit is contained in:
parent
a4c63c12cf
commit
83a37eaa76
3 changed files with 9 additions and 12 deletions
|
|
@ -30,12 +30,13 @@ class CollectXgen(pyblish.api.InstancePlugin):
|
|||
if data["xgmPalettes"]:
|
||||
data["xgmPalette"] = data["xgmPalettes"][0]
|
||||
|
||||
data["xgenConnections"] = {}
|
||||
data["xgenConnections"] = []
|
||||
for node in data["xgmSubdPatches"]:
|
||||
data["xgenConnections"][node] = {}
|
||||
for attr in ["transform", "geometry"]:
|
||||
input = get_attribute_input("{}.{}".format(node, attr))
|
||||
data["xgenConnections"][node][attr] = input
|
||||
connected_transform = get_attribute_input(
|
||||
node + ".transform"
|
||||
).split(".")[0]
|
||||
if connected_transform not in data["xgenConnections"]:
|
||||
data["xgenConnections"].append(connected_transform)
|
||||
|
||||
# Collect all files under palette root as resources.
|
||||
import xgenm
|
||||
|
|
|
|||
|
|
@ -51,11 +51,9 @@ class ExtractXgen(publish.Extractor):
|
|||
with delete_after() as delete_bin:
|
||||
duplicate_nodes = []
|
||||
# Collect nodes to export.
|
||||
for _, connections in instance.data["xgenConnections"].items():
|
||||
transform_name = connections["transform"].split(".")[0]
|
||||
|
||||
for node in instance.data["xgenConnections"]:
|
||||
# Duplicate_transform subd patch geometry.
|
||||
duplicate_transform = cmds.duplicate(transform_name)[0]
|
||||
duplicate_transform = cmds.duplicate(node)[0]
|
||||
delete_bin.append(duplicate_transform)
|
||||
|
||||
# Discard the children.
|
||||
|
|
|
|||
|
|
@ -61,9 +61,7 @@ class ValidateXgen(pyblish.api.InstancePlugin):
|
|||
# We need a namespace else there will be a naming conflict when
|
||||
# extracting because of stripping namespaces and parenting to world.
|
||||
node_names = [instance.data["xgmPalette"]]
|
||||
for _, connections in instance.data["xgenConnections"].items():
|
||||
node_names.append(connections["transform"].split(".")[0])
|
||||
|
||||
node_names.extend(instance.data["xgenConnections"])
|
||||
non_namespaced_nodes = [n for n in node_names if ":" not in n]
|
||||
if non_namespaced_nodes:
|
||||
raise PublishValidationError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue