View Full Version : image loaction inside a string variable - syntax error - oldsyle?

12 December 2011, 11:21 AM
Hi there

Okey so i just started learning MEL. I am now following some of the tutorials from 3d buzz maya fundamental series, where they make a UI for theyre robot. What they do is that they put a location of an image on you're harddrive inside a String Variable. But no matter which way i try to follow i get a syntax error. The Error if ONLY on this code. I was wondering if this isn't possible anymore? The tutorials are from Maya 6.5 so maybe there is a new way to do this. Please let me know

I appreciate all answers, thanks

12 December 2011, 12:02 PM
check your slashes:
C:\Foo\ is invalid. You should either escape every backslash like this: C:\\Foo\\, or way better use the unix/maya(normal?) style slashes:

C:/Foo/ - this is valid;

12 December 2011, 12:09 PM
it would help if you gave us the bit of MEL that caused the syntax error, as the problem could be literally absolutely anything. how are we supposed to guess? :)

12 December 2011, 12:29 PM
I have tried every time of slashes and dobbles of them.

Here is the code that gives me a syntax:

string $myLSC "C:\LogoScatterCube.bmp";

I moved it to C:/ drive so the path would be shorter

12 December 2011, 02:25 PM
string $myLSC = "C:/LogoScatterCube.bmp";:nathaN

12 December 2011, 04:36 PM
haha thanks. bad quality on the tutorial..looked like - :p but i should have understood that it must be =. i was so certain that it had something to do with the path hehe. thanks anyways

CGTalk Moderation
12 December 2011, 04:36 PM
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.