Adverti horiz upsell
Remove namespace of imported objects using simple mel commands
Remove namespace of imported objects using simple mel commands
Stephen Kershaw 24,060 views  Rating:
(2 ratings)
Page 1 of 1

Ever find it annoying when you're using Maya, you import some objects and it adds the name of the file you're importing to the name of every object? The names of the objects in your scene can very quickly get a bit unwieldy if you're working with lots of files. Use the following to clean things up a bit -

After your objects are imported paste the following line into the script editor -

namespace -mv "insert_namespace_here" ":" -force;

Replace insert_namespace_here with the namespace of your imported objects. ie for an object that is named part1:Cylinder02 use the following -

namespace -mv "part1″ ":" -force;

Next you need to execute the MEL code and all objects with that namespace will have it removed. So part1:Cylinder02 will become Cylinder02.

[Hint - In order to keep the MEL in your script editor for another time, instead of it disappearing once the code is executed. Highlight the code and hit enter on the enter key beside the number keys on you keyboard.]