<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Project Directory with Python? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191636#M15901</link>
    <description>&lt;PRE&gt;import maya.cmds as cmds&lt;BR /&gt;import os.path&lt;BR /&gt;&lt;BR /&gt;projectDirectory = cmds.workspace(q=True, rd=True)&lt;BR /&gt;currentScene = os.path.abspath(cmds.file&amp;amp;#40;q=True, sn=True&amp;amp;#41;)&lt;BR /&gt;if 'scene' in cmds.workspace(q=True, frl=True):&lt;BR /&gt;       sceneDirectory = os.path.join(projectDirectory, cmds.workspace(fre='scene'))&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Mar 2011 09:45:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-03-11T09:45:10Z</dc:date>
    <item>
      <title>Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191632#M15897</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm currently working on a Python based simulation project for my university degree. Part of this project involves saving a proprietary file in the user's current project directory. Now I've searched high and low to find the answer, but as of yet cannot: is there any way to query the Maya API and return the currently selected project directory?&lt;BR /&gt;&lt;BR /&gt;os.getcwd() only ever returns the Maya binary folder (since that's where the OS is running Maya from) and whilst a setProject command exists, there's no getProject alternative.&lt;BR /&gt;&lt;BR /&gt;It seems a bit odd that there's no exisiting commands to bring up the project directory, as I'd imagine thats a fairly obvious step for a lot of custom tools...&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 08 Mar 2011 09:45:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191632#M15897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-08T09:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191633#M15898</link>
      <description>&lt;A href="http://download.autodesk.com/us/maya/2011help/CommandsPython/workspace.html" target="_blank"&gt;workspace&lt;/A&gt;</description>
      <pubDate>Tue, 08 Mar 2011 11:17:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191633#M15898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-08T11:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191634#M15899</link>
      <description>Genius, thanks. &lt;BR /&gt;&lt;BR /&gt;I can't believe it was as simple as that, I feel a little bit dumber for not finding that now!</description>
      <pubDate>Tue, 08 Mar 2011 11:22:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191634#M15899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-08T11:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191635#M15900</link>
      <description>Actually, having tested out this command, &lt;I&gt;cmds.workspace( q=True, dir=True )&lt;/I&gt; only returns the directory at which Maya expects to find projects (i.e /username/documents/maya/projects) rather than the actual set project directory (for example in this case /username/my projects/project_name).&lt;BR /&gt;&lt;BR /&gt;Any other suggestions?</description>
      <pubDate>Wed, 09 Mar 2011 14:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191635#M15900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-09T14:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191636#M15901</link>
      <description>&lt;PRE&gt;import maya.cmds as cmds&lt;BR /&gt;import os.path&lt;BR /&gt;&lt;BR /&gt;projectDirectory = cmds.workspace(q=True, rd=True)&lt;BR /&gt;currentScene = os.path.abspath(cmds.file&amp;amp;#40;q=True, sn=True&amp;amp;#41;)&lt;BR /&gt;if 'scene' in cmds.workspace(q=True, frl=True):&lt;BR /&gt;       sceneDirectory = os.path.join(projectDirectory, cmds.workspace(fre='scene'))&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Mar 2011 09:45:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191636#M15901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-11T09:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191637#M15902</link>
      <description>Is there any other way? cause the workspace command, when it's called in python code without Maya GUI, doesn't give back any other workspace beside the default one?</description>
      <pubDate>Fri, 18 Nov 2011 22:16:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191637#M15902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-18T22:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Project Directory with Python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191638#M15903</link>
      <description>when you say without maya GUI is you're doing stuff with maya batch? you could always setup an optionvar with your working directory and synchronize it whenever the workspace changes</description>
      <pubDate>Wed, 30 Nov 2011 22:01:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/project-directory-with-python/m-p/4191638#M15903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-30T22:01:00Z</dc:date>
    </item>
  </channel>
</rss>

