Is it possible to create a new shape from an existing maya object in MEL?
Example: Say I create a polyCube and add a bunch of attributes to it. What I want to do is create an object with the same exact name and all the same attributes but instead with a polySphere. Ideally I'd want to use the same object but merely replace the shape node / input (whatever it is) with the polySphere.
What would the code look like to perform this operation?
Do it by hand and look at what maya echoes.... that generates the code for you (and yes that is how i know what the mel, for whatever happens to be. So writing code you can as easily echo yourself is a bit obsolete). So yes thet is a mel description.
Tough post maya 8.0 theres a new mel command that can swap 2 nodes in the network called nodeCast thet does this but it can also fail miserably. Can make thsi a little less painfull to do. But basically it just kills 4 lines of code form a total of 6 so no biggie.
Cool, thanks. So I looked at the echoed commands and the code looks like this: (given that you create a cube and a sphere pCube1 and pSphere1 and want to replace the cube shape with the sphere shape)