View Full Version : how can I query path to set project folder?

11 November 2010, 11:00 PM
Hi everyone,

I have been trying unsuccessfully to query the path to the current set folder.

I eventually found internalVar -userWorkspaceDir, but this gives me the default project folder, not the one set by the user using Set project.

string $fileName = `internalVar -userWorkspaceDir` + etc...

I also found command pwd

This is giving me the path to the last folder used by user, when I tested, the scenes folder.
The problem with this is that, should the user set the project and than for some reason move to another folder, than I can't count on pwd to give me the right path anymore.

I ultimately would like to have a safe path to the mel folder in the current set project.

Thanks a lot for reading, your help is much appreciated.

11 November 2010, 08:18 AM
workspace = cmds.workspace (query=True, rootDirectory=True)

respective by MEL:

string $workspace = `workspace -q -rootDirectory`;

11 November 2010, 11:45 PM
Hi Kecal , many thanks!!!

CGTalk Moderation
11 November 2010, 11:45 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.