MEL system() difficulties..

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  10 October 2012
MEL system() difficulties..

So here's the deal, I can't launch our game using system() in mel. I'm working on a level exporter, and it would be handy to launch the game directly from the Maya GUI, but it always crashes. And yes, it works perfectly fine when you open the game in windows normally.

I get a Game.exe has stopped working ... APPCRASH type error.

I've tried all kinds of different string formatting, used start, load, shell, all to no avail. The error window displays the game's icon, so I assume the directory string is correct.

I can get system() to load all kinds of other things, such as Minecraft, notepad, Dragon Age 2, etc, but not OUR game!

I'm really at a loss here, shouldn't system() be the same as if I opened the file normally in windows?

The game is running on Ogre3d, and I'm using Maya 2012 x86, Windows 7 x64.

Any ideas / leads would be appreciated!
-John L.
  10 October 2012
Have you tried this on different versions of Maya?
Nightshade UV Editor (script for Maya) - Extends Maya's default UV Texture Editor with additional tools.
  10 October 2012
I would consider doing it with a few lines of python. Here's and example launching rv

from PyQt4 import QtCore
cmd = '"D:/Program Files/Tweak/rv-current-version/bin/rv.exe"'
pro = QtCore.QProcess()

  10 October 2012
Have you tried wrapping it with batch ?

- Oh no, it's me -
  10 October 2012
Thanks guys! Going through all your suggestions helped us narrow down the problem. It turns out the game had to be launched from a specific location, and somehow running it via MEL, python, or a batch file made it think it was in the wrong directory.
  10 October 2012
In case anyone wants to see the actual fix, here's what I did:

First you have to change the working directory. Use the chdir mel command.
< chdir $directory; >
Then, you can run the program without any problems.
< system("shell " + $directory + $gameExe); >
  10 October 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:41 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.