Paths are independent for each node, so there isn’t a global method to fetch all of them; particularly not ones specified in non built-in nodes, like from a plug-in developed by your studio. They’re just arbitrary string attributes, some of which happen to be used to point to a directory on disk.
But if you know the node types you are interested in getting paths from - and odds are you do if you operate within a studio with a fixed set of nodes used to reference nodes - then you can simply list all nodes, e.g. cmds.ls(type="AlembicNode"), and read the path attribute of each individually.
Also have a look at the File Path Manager, under Window -> General Editor -> File Path Manager for how Maya does this with some if not all of its built in nodes. It’ll give you a listing of all paths (that it knows of) used in the current session. But again, it won’t list paths in string attributes from nodes it doesn’t know about, so it’s not 100% accurate.
Then there is the Archive feature in Maya, which must do something similar, but again, can never be 100% accurate.
Another approach worth mentioning is to detect filepaths by using Maya ASCII scene file format and parsing that.
You can also iterate over all attributes of all objects in a scene and detect filepaths, although this can be slow on complex scenes.
Regex it's one way to detect a filepath but "if filepath.startswith(y)" and "if x in filepath" are faster approaches.
// F
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWPa%2BdzJQC_3E6XB%3DHPA-Dr%2BxaJQjExjby_UF%3DLf01qUjg%40mail.gmail.com.