So if you want the texture file nodes in the scene, you can get them from 
pymel with:

import pymel.core as pm
file_nodes = pm.ls(type=pm.nt.File)
file_paths = [fyle.fileTextureName.get() for fyle in file_nodes]

with cmds:
import maya.cmds as cmds
file_nodes = cmds.ls(type='file')
file_paths = [cmds.getAttr(fyle + '.fileTextureName') for fyle in 
file_nodes]

Unresolved reference paths can be gotten pretty easy in pymel :
unresolved_paths = [ref.unresolvedPath() for ref in pm.listReferences()]

with cmds:
[cmds.referenceQuery(pth, unresolvedName=True, filename=True) for pth in  
cmds.file(q=True, reference=True)]



On Tuesday, August 11, 2015 at 10:59:47 AM UTC-5, 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 <javascript:>
>

-- 
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/a0cfa12a-90cb-4890-8e3f-6b46cfc34ffd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to