fix the bug in connect ornatrix rig

This commit is contained in:
Kayla Man 2024-07-02 22:36:50 +08:00
parent 7bfda3584c
commit 0f29f1b478
2 changed files with 5 additions and 8 deletions

View file

@ -83,17 +83,15 @@ class ConnectOrnatrixRig(InventoryAction):
ext, ".rigsettings")
if not os.path.exists(settings_file):
continue
with open(settings_file, "w") as fp:
source_nodes.extend(
item.get("node") for item in json.load(fp))
self.display_warning(
source_nodes
)
with open(settings_file, "r") as fp:
source_nodes = json.load(fp)
grooms_file = maya_file.replace(ext, ".oxg.zip")
grooms_file = grooms_file.replace("\\", "/")
# Compare loaded connections to scene.
for node in source_nodes:
target_node = cmds.ls(f"{source_namespace}:{node}")[0]
node_name = node.get("node").replace("|", "")
target_node = cmds.ls(f"{source_namespace}:{node_name}")
if not target_node:
self.display_warning(
"No target node found "

View file

@ -30,7 +30,6 @@ class OxCacheLoader(plugin.Loader):
# Ensure Ornatrix is loaded
cmds.loadPlugin("Ornatrix", quiet=True)
product_type = context["product"]["productType"]
# Build namespace
folder_name = context["folder"]["name"]
if namespace is None: