Hi all,
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.
hi @Drigax,
taking Python out of the equation doesn’t seem to help. What I’ve found so far is if the script (whether it’s MEL or Python) opens a file as part of the process, the export will hang, but if it’s just changing something in the scene without opening anything, the export seems to run fine. The simplest way to reproduce this is to run a MEL script that opens any Maya file using the “file” command and then calls the “ScriptToBabylon” command. Do you want to give it a try? Below is the MEL code (you’ll have to update the maya file path and the output path to run it):
To be honest I’m not sure why we even invoke this call every message…
EDIT: looks like we do this in the Export form code behind in order to update the exporter window application to redraw as we generate new messages, but this doesn’t seem necessary in the MEL entry point. I’ll remove this call and see what happens.