Re: [Maya-Python] List referenced files

2015-08-12 Thread Marcus Ottosson
Thanks everyone for your replies! It certainly looks more challenging than I would have thought, the cmds.file(query=True, list=True) is close, and the listFiles of filePathEditor almost got it, and though it looks to work with file nodes, it doesn’t seem to work with reference nodes, and I wonder

Re: [Maya-Python] List referenced files

2015-08-12 Thread Roy Nieterau
For completeness sake. This is how to list unresolved filenames with the file command: files = cmds.file(query=True, list=True, unresolvedName=True) On Wednesday, August 12, 2015 at 9:12:17 AM UTC+2, Marcus Ottosson wrote: > > Thanks everyone for your replies! > > It certainly looks more challe

Re: [Maya-Python] List referenced files

2015-08-12 Thread Marcus Ottosson
cmds.file(query=True, list=True, unresolvedName=True) I think that’s it! ​ On 12 August 2015 at 09:07, Roy Nieterau wrote: > For completeness sake. This is how to list unresolved filenames with the > file command: > > files = cmds.file(query=True, list=True, unresolvedName=True) > > > On Wednes

Re: [Maya-Python] List referenced files

2015-08-12 Thread Roy Nieterau
And sorry for the spamming, but it seems that V-Ray 3.0 actually does register the types for its file attributes. In Maya 2015 it doesn't list the Alembic attributes, but I assume it will with coming version (maybe even Maya 2016)? Autodesk will likely push developers to register it for their cus

Re: [Maya-Python] List referenced files

2015-08-12 Thread Fredrik Averpil
Hehe, it seems to me that you are trying to achieve something we do here; validate all filepaths before publishing. Am I right? ;) We want all our filepaths to be relative to the Maya project at all times and there's no silver bullet for this, I'm afraid. You're going to have to combine several met

Re: [Maya-Python] List referenced files

2015-08-12 Thread Fredrik Averpil
Typing on the iPad really sucks... And with the line breaks bug in Google Inbox it's just... bad. ons 12 aug 2015 kl. 12:23 skrev Fredrik Averpil : > Hehe, it seems to me that you are trying to achieve something we do here; > validate all filepaths before publishing. > Am I right? ;) > We want all

Re: [Maya-Python] List referenced files

2015-08-12 Thread Marcus Ottosson
validate all filepaths before publishing. You’re absolutely right. As I’m not alone in solving it, here’s some more research. I’ve found that if I temporarily export an .ma of nodes, excluding those that I know won’t have one and may be heavy to export (such as mesh), I can parse the resulting A

Re: [Maya-Python] List referenced files

2015-08-12 Thread Fredrik Averpil
Yes, I used to parse .ma too. So that could be one way of dealing with it. I don't believe there is such a thing called a relative path inside of the .ma though. If I remember correctly, all paths are always absolute when you peak inside an .ma file. Some old notes which may or may not be complete

Re: [Maya-Python] List referenced files

2015-08-12 Thread Roy Nieterau
You could end up 'reading' custom attributes made by the user which you might not want to change/validate (eg. metadata/pipeline data or even unrelated data). Setting up a dictionary/set of attributes for those missing is a better and more lightweight solution. Also note that you could still re

Re: [Maya-Python] List referenced files

2015-08-12 Thread Sivanny Selvakumar
Hi Marcus, Just a quick note about the fileNames attribute. It's actually obsolete and hasn't been used since Maya 6.0. It was only kept around for backwards compatibility. After Maya 6.5, reference paths are only accessible via the referenceQuery and the file command. Other attributes that are

Re: [Maya-Python] List referenced files

2015-08-12 Thread Marcus Ottosson
Oh, that's an interesting note, thanks for sharing Sivanny. So, how would one access the path from a reference node? Is the information not stored in the node at all? Where is it stored? On 12 August 2015 at 17:27, Sivanny Selvakumar wrote: > Hi Marcus, > > Just a quick note about the fileNames

Re: [Maya-Python] List referenced files

2015-08-12 Thread Sivanny Selvakumar
It's stored in internal data structures. So the only way to access/change it is via the referenceQuery command, the file command or MFnReference. On Wednesday, August 12, 2015 at 9:45:22 AM UTC-7, Marcus Ottosson wrote: > > Oh, that's an interesting note, thanks for sharing Sivanny. > > So, how w