View Full Version : Can't name my mesh 'source'
08-13-2012, 07:32 AM
Why can't I name my mesh 'source'?
08-13-2012, 10:35 AM
MEL has several keywords that are not commands, but interpreter directives: for, if, else, source, etc...
It seems like these are reserved to such a degree that you can't even name any node in Maya with any of them... weird but true. (and it's not just 2013, but 2012 and 2010 (and presumably all other versions before and in future!))
08-13-2012, 10:51 AM
Not really strange at all considering that many other kind of software also has forbidden names - operating systems as well! In windows 7 for example, the following words are forbidden for folders: con, nul, prn (which I BET some ppl have tried using), aux, com1, com2, lpt1, lpt2
08-13-2012, 11:14 AM
You're right. prn doesn't work. Trust me I've never tried it before :)
08-13-2012, 06:58 PM
But I want to! :cry:
Martin, prn, lpt, and others are names of file handles (at least historically), so these names are taken. Do you have objects in the scene named source, if, etc.? It's like I wouldn't be able to create files named window, task manager, or start (the button name...).
Nathan, yes, I thought along these lines as well, but don't you find it suspiciously lame?
Actually my explanation to this is that since mel, unlike python I must add, is kind of amateurish and accepts in its syntax object names without quotes, naming an object as a keyword would trip one of the inner mel scripts. So instead of giving a proper solution such as automatically adding quotes to such ambiguities, the average patch-loving autodesk programmer decided to solve it by simply forbidding such names.
08-13-2012, 07:22 PM
definitely lame, but it's still nowhere near the lamest thing about MEL/Maya though... :D
08-13-2012, 08:26 PM
Just another reason that a solid naming convention is a good thing to have. You never need to worry about not being able to call something "source" because your would need to add a prefix or suffix anyway. What is source? source_GEO? source_CRV? It always helps to add a little something to help streamline your pipeline.
But, this does open up a can of worms...I am sure people could get into some trouble if they stripped the suffix with a script or something.
I am glad to find this out actually, because I am sure one day I would be tearing my hair out trying to figure out why my script doesn't work on source_PLY or proc_DEF.
And I kept getting source1 or proc1.
I like to think of these things as Easter Eggs!
08-13-2012, 08:26 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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.