As someone who has never used mayabatch, what is its advantage over mayapy?
This works for me. *script.py* print "OPENED!"import osimport maya.cmds as cmds import maya.standalone maya.standalone.initialize() output_path = os.path.join(os.getcwd(), "test.ma") cmds.circle(r=10, d=1, n="test_Curve", s=20,) cmds.file( rename=output_path) cmds.file( save=True, type='mayaAscii')print "SAVED!" Runs like this. $ mayapy script.py OPENED! SAVED! On 25 March 2015 at 21:19, Justin Israel <[email protected]> wrote: > > > On Thu, Mar 26, 2015 at 9:21 AM Fabrice Altman <[email protected]> wrote: > >> >> On 25 Mar 2015 20:11, "Justin Israel" <[email protected]> wrote: >> > >> > >> > >> > On Thu, Mar 26, 2015 at 8:23 AM Fabrice Altman <[email protected]> >> wrote: >> >> >> >> Hi, >> >> >> >> we have a simple python script that runs totally fine in Maya GUI but >> breaks and crashes Maya GUI. >> > >> > >> > Do you mean that it breaks in Maya batch? >> > >> >> Yes. The script runs but is not able to move locators it generates so we >> end up erroring down the line. >> But even running this simple create and save snipet proves problematic. >> >> >> >> >> The script simply moves a bunch of locators to points on a curve. >> >> >> >> Being Maya newbies (ex Softies) we must be missing something major so >> apologies in advance. >> >> >> >> To simplify, the snippet bellow drwas a circle an saves the scene. Why >> is this not even working in Mayabatch 2015 Ext1 SP5?? >> >> >> >> print "OPENED!" >> >> import maya.cmds as cmds >> >> cmds.circle(r=10, d=1, n="test_Curve", s=20,) >> >> cmds.file( rename='\\\\AKAAPPS\\Maya_Workgroups\\Tools\\test.ma') >> >> cmds.file( save=True, type='mayaAscii') >> >> print "SAVED!" >> >> >> > >> > Did you first import maya.standalone and initialize it? >> > >> >> No... The script is just started via Mel command : Python executefile >> file.py. >> Please send snipet on how to import Maya.standalone and initialise :) >> > > Sorry, I was thinking of mayapy, not Mayabatch. What kind of errors do you > get? > > >> >> >> >> >> >> >> >> Any ideas much appreciated! >> >> >> >> Cheers, >> >> F. >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> Groups "Python Programming for Autodesk Maya" group. >> >> To unsubscribe from this group and stop receiving emails from it, send >> an email to [email protected]. >> >> >> >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/bb722f49-fab0-45c0-9dd1-f7bac2891d4f%40googlegroups.com >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > >> > -- >> >> > You received this message because you are subscribed to a topic in the >> Google Groups "Python Programming for Autodesk Maya" group. >> > To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/python_inside_maya/aa2cuj2M1Yk/unsubscribe >> . >> > To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Us%3DgGFNso1Gr70W2XZYCkfyk6apEOZdjsfG1esrJGng%40mail.gmail.com >> . >> >> >> > >> > For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAFFG8Y5hQw36EY5S04UFrxbKDbq5gHi8ZwAsxabdt9o6uF0VsA%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAFFG8Y5hQw36EY5S04UFrxbKDbq5gHi8ZwAsxabdt9o6uF0VsA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-%3DFB8NF2J8xUtMPLgLJM9TSmj6%2Bw17T83Bg-OTZeZNQ%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-%3DFB8NF2J8xUtMPLgLJM9TSmj6%2Bw17T83Bg-OTZeZNQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBk-W6jSC5kw12VOCTm3aAVS6Zyo0rjgg9RrWTG8WUCmw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
