Workspace in Python?

Workspace in Python?

Anonymous
Not applicable
467 Views
1 Reply
Message 1 of 2

Workspace in Python?

Anonymous
Not applicable

I want to create a new project through Python by using the workspace command but I can't even get the examples in the docs to work. For instance this generates an error for me:

import maya.cmds as cmds

cmds.workspace( 'newWorkspace', newWorkspace=True )
cmds.workspace( baseWorkspace='default' )

What is the right way to do it?

 

cheers

0 Likes
468 Views
1 Reply
Reply (1)
Message 2 of 2

vijaya.prakash
Alumni
Alumni

For creating new workspace, here is the code

 

import maya.cmds as cmds
cmds.workspace( 'newWorkspace', n=True )
cmds.workspace( q=True, dir=True )

0 Likes