diff --git a/hooks/tk-maya_actions.py b/hooks/tk-maya_actions.py index 033c6ddc..dcdc4769 100644 --- a/hooks/tk-maya_actions.py +++ b/hooks/tk-maya_actions.py @@ -192,8 +192,11 @@ def _create_reference(self, path, sg_publish_data): namespace = "%s %s" % (sg_publish_data.get("entity").get("name"), sg_publish_data.get("name")) namespace = namespace.replace(" ", "_") - pm.system.createReference(path, - loadReferenceDepth= "all", + # create reference using relative path instead of absolute path + current_path = cmds.file(q=True, sn=True) + relative_path = os.path.relpath(path, os.path.dirname(current_path)) + pm.system.createReference(relative_path, + loadReferenceDepth="all", mergeNamespacesOnClash=False, namespace=namespace)