Maya 2022 immediate crash after launching through batch file

660 views
Skip to first unread message

Benjam901

unread,
Jan 11, 2022, 4:59:33 AM1/11/22
to Python Programming for Autodesk Maya
Hello all,

I have just recently gotten to the part in the pipe where I have to launch Maya 2022 from a batch file.

So the process looks like this:

- Start the toolhub
- Click the Maya button
- Launch the maya bat file via subprocess 
- Within the bat file set the env params and then launch Maya

The problem is that Maya 2022 is crashing without warning or crash log anywhere.

Maya 2019 boots fine and Maya 2020 I needed to change a few bits a pieces for it to boot but it boots fine now but 2022 is being very fussy.

If I launch the bat file from a regular commandline window it boots a-ok. I even have the subprocess call running a new console window and still no dice. 

Here is my call & bat env settings:

version==2022
splash=path to splash img

subprocess.Popen([boot_file, exe, version, splash], creationflags=subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP)

batchfile:
set QT_PREFERRED_BINDING=PySide2
set QT_QPA_PLATFORM_PLUGIN_PATH=C:\Program Files\Autodesk\Maya2022\plugins\platforms
set PYTHONPATH=C:\Program Files\Autodesk\Maya%VERSION%\Python37\Lib\site-packages;C:\Program Files\Autodesk\Maya%VERSION%\Python37\DLLs;C:\Program Files\Autodesk\Maya%VERSION%;%PYTHONPATH%
set PYTHONHOME=C:\Program Files\Autodesk\Maya%VERSION%\bin

start "" "C:\Program Files\Autodesk\Maya%VERSION%\bin\maya.exe"



Any help would be much appreciated :)

// Ben

Hannes Delbeke

unread,
Jan 11, 2022, 6:22:27 AM1/11/22
to Python Programming for Autodesk Maya
had the same happen when trying our setup with 2022
2022 by default uses python 3. 
any chance there is something in your pipeline or env variables that is python 2 and causing it to crash?
to check if this is the issue try launching 2022 in python 2 mode. if it doesn't crash you know how to solve the issue.
see https://matiascodesal.com/blog/how-to-launch-maya-2022-with-python-2-if-you-are-not-ready-for-python-3/

Benjam901

unread,
Jan 11, 2022, 7:26:32 AM1/11/22
to Python Programming for Autodesk Maya
Our entire pipe from start to end is python 3. 

I got it working now by removing the set PYTHONHOME path variable

Quick question for you Hannes, do you use the  QT_PREFERRED_BINDING and or  QT_QPA_PLATFORM_PLUGIN_PATH env vars when launching? I am wondering if they are remotely necessary...

Marcus Ottosson

unread,
Jan 11, 2022, 1:32:19 PM1/11/22
to Python Programming for Autodesk Maya
QT_PREFERRED_BINDING is related to Qt.py


If it's set to PyQt4 or Pyside (not 2) that could maybe be problematic.

Hannes Delbeke

unread,
Jan 11, 2022, 3:35:49 PM1/11/22
to python_in...@googlegroups.com
the only env var we use is MAYA_MODULE_PATH
the module then loads a few basic paths

PYTHONPATH+:=
MAYA_SHELF_PATH+:=maya\shelves
icons: maya\icons
presets: maya\presets
scripts: maya\scripts
plug-ins: maya\plug-ins

--
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/0uJKvhSF5Rk/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/7a09614f-a4fb-4d71-805a-a28ee690b7e2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages