olson
10-13-2009, 06:36 PM
Does this Python look right to you? Trying to export an OBJ from the selected objects. I know it can be done through the menu but I want to use this in another script but can't even get it to work by itself.
import maya.cmds as cmds
cmds.file("C:/test.obj",es=True,typ="OBJ")
This is the output from the script editor. Created a cube, selected it, ran the Python script, got a generic error that doesn't say why it failed.
CreatePolygonCube;
setToolTo CreatePolyCubeCtx;
polyCube -ch on -o on -w 5.975262 -h 7.111771 -d 8.669797 -cuv 4 ;
// Result: pCube1 polyCube1 //
select -r pCube1 ;
import maya.cmds as cmds
cmds.file("C:/test.obj",es=True,typ="OBJ")
# Error: Could not save file.
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# RuntimeError: Could not save file.
# #
The save location has all the correct permissions and I can save files there through the menu. Any help would be greatly appreciated!
import maya.cmds as cmds
cmds.file("C:/test.obj",es=True,typ="OBJ")
This is the output from the script editor. Created a cube, selected it, ran the Python script, got a generic error that doesn't say why it failed.
CreatePolygonCube;
setToolTo CreatePolyCubeCtx;
polyCube -ch on -o on -w 5.975262 -h 7.111771 -d 8.669797 -cuv 4 ;
// Result: pCube1 polyCube1 //
select -r pCube1 ;
import maya.cmds as cmds
cmds.file("C:/test.obj",es=True,typ="OBJ")
# Error: Could not save file.
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# RuntimeError: Could not save file.
# #
The save location has all the correct permissions and I can save files there through the menu. Any help would be greatly appreciated!
