View Full Version : folder and file operations

11 November 2012, 09:57 AM
file -q -sn;
return full path with file name, how to get only name of maya file?

2) How to get folder name in wich file is located?
If i have scenes/models/ i need "models" string.

3) How to cut parts of strings?
If i have "models" string and i need to leave only first 3 elements("mod")

11 November 2012, 12:19 PM
mel has "basename" and "dirname", so you could use them. If you want to have more control you can use "tokenize" to split the string into an array using "/' as the split character.

Consider using python though which has Folder and File operations too many to mention, and too useful not to.


12 December 2012, 05:53 PM
Welcome guys.

Also workspace -q -dir or pwd could be useful.

CGTalk Moderation
12 December 2012, 05:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.