Has anyone else noticed this? 2 scripts run in batch. 1 in python and 1 in
mel. The 1 in python does not add the needed requires statement at the top
of the ascii file..
#!/usr/bin/env python
import sys
try:
import maya.standalone
maya.standalone.initialize()
import maya.cmds as mc
import maya.mel as mm
except StandardError, err:
print (str(err))
sys.exit(1)
try:
mc.loadPlugin('stereoCamera', qt=True)
except:
print "Failed to load plugin"
def test():
""" test requires"""
mc.polySphere(n="sphere",sx=10, sy=15, r=20)
mc.select("sphere")
mc.group( em=True, name='sphere_group' )
mc.parent("sphere","sphere_group")
mc.select("sphere_group")
l = mc.pluginInfo( query=True, listPlugins=True ,version=True)
print "before: %s" % l
mc.file(new=True,force=True)
newpostname= '<SAVE OUT TO A FILE HERE>'
mc.file(rename=newpostname)
l = mc.pluginInfo( query=True, listPlugins=True ,version=True)
print "after: %s" % l
mc.file(save=True,force=True,type='mayaAscii')
print("Maya save:\n\t %s"%(newpostname))
if __name__ == "__main__":
test()
===================================================================================================
{
polySphere -n "sphere" -sx 10 -sy 15 -r 20;
select("sphere");
group -em -n "sphere_group";
parent("sphere","sphere_group");
select("sphere_group");
catch( `loadPlugin "stereoCamera.so"`);
file -new -force;
string $newpostname= "<SAVE OUT TO A FILE HERE>";
file -rename $newpostname;
file -save -force -type "mayaAscii";
print("Maya save:\n\t" + $newpostname);
}
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe