I’m working on a script that prepares a Maya (2019) scene file for export to glTF, and then invokes the Babylon Maya Exporter (20200701.2) to do the actual export using the MEL command “ScriptToBabylon” as documented here Exporters/exportScriptExemple.mel at master · BabylonJS/Exporters · GitHub.
The problem I’m running into is that when the “ScriptToBabylon” command is invoked, the exporter outputs “// Export Started //” to the console and doesn’t proceed. Likely related, the Maya UI and Viewport don’t get blocked the same way they are when you run the export manually through the Babylon Exporter window. And curiously, if I scrub the timeline in Maya by hand, the export process proceeds bit by bit, but slowly, and I have to keep scrubbing the timeline or else it stops again. Also, if I run the export command on its own, without any of the preceding commands that prepare the scene, it doesn’t hang. But I want to make exporting a single automated process, rather than one in which someone has to run a script that prepares the scene, wait for it to finish, then run the export command separately.
Anyone have any idea what’s going on? If it makes a difference, the main script I’m running is in Python, which then calls the export command using the mel.eval() command.