Hi,we have a simple python script that runs totally fine in Maya GUI but breaks and crashes Maya GUI.
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 cmdscmds.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!"
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 python_inside_m...@googlegroups.com.
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.
On 25 Mar 2015 20:11, "Justin Israel" <justin...@gmail.com> wrote:
>
>
>
> On Thu, Mar 26, 2015 at 8:23 AM Fabrice Altman <afab...@gmail.com> 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 :)
>>
>> 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 python_inside_m...@googlegroups.com.
>>
>> 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 python_inside_m...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Us%3DgGFNso1Gr70W2XZYCkfyk6apEOZdjsfG1esrJGng%40mail.gmail.com.
On 25 Mar 2015 20:11, "Justin Israel" <justin...@gmail.com> wrote:
>
>
>
> On Thu, Mar 26, 2015 at 8:23 AM Fabrice Altman <afab...@gmail.com> 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 :)
>>
>> 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 python_inside_m...@googlegroups.com.
>>
>> 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 python_inside_m...@googlegroups.com.
> 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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFFG8Y5hQw36EY5S04UFrxbKDbq5gHi8ZwAsxabdt9o6uF0VsA%40mail.gmail.com.
As someone who has never used mayabatch, what is its advantage over mayapy?
This works for me.
script.py
print "OPENED!"
import os
import 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!
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-%3DFB8NF2J8xUtMPLgLJM9TSmj6%2Bw17T83Bg-OTZeZNQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBk-W6jSC5kw12VOCTm3aAVS6Zyo0rjgg9RrWTG8WUCmw%40mail.gmail.com.
Glad you got it working. :)
By the looks of it, batch is for running scene files without a GUI.
http://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/Interface-overview-Start-Maya-from-the-command-line--htm.html
Assuming it’s mainly related to launching renders via the command-line.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFFG8Y6FAPmCBdVmrMPDLjmsHLJwyuk1%3DXRSR%2BACgHoRa%3DjmhA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAjuAw98q2TiQkybfS1ycS-H8-2q-EjU5zBR10y9eS8RQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABwp0vO8hANSd8TqqTUN3fRCmAfQORNv_3THbD8QJu_a2x%3DcCA%40mail.gmail.com.