diff --git a/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py b/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py index 20e1bd37d8..0d2a97bc4b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py +++ b/openpype/hosts/maya/plugins/publish/extract_workfile_xgen.py @@ -57,7 +57,7 @@ class ExtractWorkfileXgen(publish.Extractor): continue render_start_frame = instance.data["frameStart"] - render_end_frame = instance.data["frameStart"] + render_end_frame = instance.data["frameEnd"] if start_frame is None: start_frame = render_start_frame diff --git a/openpype/hosts/maya/plugins/publish/extract_xgen.py b/openpype/hosts/maya/plugins/publish/extract_xgen.py index 9b4e5e403d..3c9d0bd344 100644 --- a/openpype/hosts/maya/plugins/publish/extract_xgen.py +++ b/openpype/hosts/maya/plugins/publish/extract_xgen.py @@ -86,6 +86,18 @@ class ExtractXgen(publish.Extractor): delete_bin.append(palette) + # Copy shading assignments. + nodes = ( + instance.data["xgmDescriptions"] + + instance.data["xgmSubdPatches"] + ) + for node in nodes: + target_node = node.split(":")[-1] + shading_engine = cmds.listConnections( + node, type="shadingEngine" + )[0] + cmds.sets(target_node, edit=True, forceElement=shading_engine) + # Export duplicated palettes. xgenm.exportPalette(palette, xgen_path)