That definitely should work, independent of references. How can I reproduce what you see?
Here’s what I see:
from maya import cmds
# Make an original scene to reference
cmds.polyCube()
cmds.file(rename="referenceMe.ma")
cmds.file(save=True, type="mayaAscii")
# Make a new scene, and reference the original scene
cmds.file(new=True, force=True)
cmds.file("referenceMe.ma", reference=True)
cmds.file(rename="newScene.ma")
fname = cmds.file(query=True, sceneName=True)
assert fname.endswith("newScene.ma")
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f11a3271-498a-4857-8a8b-a12e171086e4n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/_avaEPrznr4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODh9pD7iuHHbUG3EfX8VV3ukO-k-R97LqkNSqYNDCFOfA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPCRbh-JZ5OABbSg7JMF06MAmCPOC7eubsbKSi4EROjbABMtjQ%40mail.gmail.com.
Aha, you are trying to find the path to the referenced file? In that case, Maya maintains each reference in a node of type “reference”. You can then query various properties of this node, including the full path to the file it references.
for reference in cmds.ls(type="reference"):
fname = cmds.referenceQuery(reference, filename=True)
print(fname)
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CA%2BKy2f2_x4yjKwQ3%2Bs6-e%3DowyuGGQBMAqiUAxjPBf-GQanazfg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCWLTztEodUXwwTL2%3DCrFUNa6p3dZYPNvRPVRiyKFHNSA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPCRbh_6N37%3DH9BmcTh4GwoCbJiq%3DSuaCAjxVCf4SYpuDMM%3DXQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CA%2BKy2f2_x4yjKwQ3%2Bs6-e%3DowyuGGQBMAqiUAxjPBf-GQanazfg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqDwkdScW_bQcQr7jWu6EkPAreopznJdP5fJ_DwdTXtA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPCRbh8cQmk6%2BVEE9ijK0Jxux0bJYtRyTRGADFThu-AHmoysWA%40mail.gmail.com.