pymel is super useful for this import pymel.core as pm # GET A LIST OF REFERENCES refs = pm.listReferences() # LOOP THROUGH AND PRINT THE PATH# for ref in refs: # PATH print("path: %s"% ref.path)
# NAMESPACE print("namespace: %s" % ref.namespace) On Tue, Aug 11, 2015 at 1:34 PM, Sivanny Selvakumar < sivanny.selvaku...@gmail.com> wrote: > `file -q -list` will return all the file reference paths and string > attributes marked as usedAsFilename. So it saves you from having to iterate > over the nodes in the scene yourself. This is how Maya gets a list of files > for the File > Archive Scene feature. You can also access this > functionality from outside Maya with the `maya.exe -archive <scene_file>` > flag. > > As long as your plugin nodes mark their file path attributes as > usedAsFilename, or override the MPxNode::getFilesToArchive function, it > should pick up the paths. > > > On Tuesday, August 11, 2015 at 8:59:47 AM UTC-7, Marcus Ottosson wrote: >> >> I’m looking for a way to list all nodes that somehow reference an >> external file; be it references, textures, or some obscure custom node with >> an attribute for paths. >> >> I was looking at the cmds.filePathEditor >> <http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/filePathEditor.html> >> which is close. >> >> >>> cmds.filePathEditor(query=True, listDirectories="") >> [list of paths] >> >> But it doesn’t show me which nodes are responsible for these paths, and >> doesn’t show me the full filenames. >> >> Any ideas? >> >> -- >> *Marcus Ottosson* >> konstr...@gmail.com >> > -- > 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_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/1ebbe8ae-aada-4a31-8e71-2eddd8f02e93%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/1ebbe8ae-aada-4a31-8e71-2eddd8f02e93%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABPXW4i8Ai3%3D3Q4x_bTVQuqxTG1B%2BA0Eo-SaX5CbT9J3mDdTQg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.