View Full Version : Invalid Strings In MEL
06-10-2009, 02:28 PM
I'm working in a pipeline in which I'm looking to "keep" unique characters in my 3d objects which Maya automatically purges or automatically assigns a number whenever I have characters such as # or have objects with the same instance name (i.e Cube, Cube1, Cube2)
I know Max doesn't have a problem with having unique characters/duplicate instance name for objects in the scene.
Does anyone know of a script which it may be able to allow me to name 3d objects to say
"#2GearSector" and be able to keep the unique characters?
06-10-2009, 03:53 PM
what do you mean by unique character? do you mean two objects with the same name, or are you referring to non-alpha-numeric characters? two objects can have the same name in maya as long as they are not in the same group or both at the root:
>>> p = cmds.sphere(name='this')
>>> g = cmds.group(p)
>>> p1 = cmds.sphere(name='this')
you now have two objects named 'this':
maybe this is because i don't know max, but i don't quite follow what you mean by renaming to "#2GearSector" . is the # a wild card for renaming or is that a character you want in the name?
06-10-2009, 04:40 PM
Yes, I'm trying to put non-alpha-numeric characters in front of the name as a part of the name and Maya doesn't seem to tolerate it as it removes it when I try to rename an object. (#Cube - _Cube)
I'll give it a try with the instance objects.
06-10-2009, 05:05 PM
Yeah if you're talking about MAX style naming where you can have all manner of crazy characters in a name, it's a no fly in Maya. That's a practice I would try to avoid anyway, we had a ton of problems going between Max and Maya back when we used to use weird max names to dictate in game attributes for objects.
06-10-2009, 05:13 PM
yup, these characters only
(the colon is a special case for referenced objects so you should never manually rename an object to have a colon)
and you cannot start a name with a number.
06-10-2009, 07:06 PM
Right...in that case, anyone heard of a script or a method in which I can tinker with in MEL?
Not a very experienced script person myself.
06-10-2009, 07:06 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-2013, Jelsoft Enterprises Ltd.