QUOTE(Joojaa @ 01/16/09, 04:46 PM) [snapback]299030[/snapback]
The MObject is not exactly the camera. Its just a handle to the camera. Deleting the handle does nothing for you the camera if something refeers to it would stay. But yes you can delete the nodes if you wish.
But yes you release the handles just like you would any other c++ objects by calling delete objName or letting the scope of your code run out. (note your not really supposed to keep the mobjects at all, so dynamically allocating them to memory is a bit careless for most cases. You should instead re ask the mobject every time you use it, because you cant really rely on it existing anymore. See MObjectHandle if you do keep them)
http://msdn.microsoft.com/en-us/library/h6227113(VS.80).aspx
Thanks for your reply. I know delete handle actually does nothing but if I want to delete the camera what should I do?
I can select the camera in Maya and the click "delete" to delete it. How can I do the same thing in Maya API? I have written a Plugin, each time I load it, it will create 8 cameras but when I unload it, cameras stay, so you can imagine some time later, I will end in a lot of cameras and I have to delete them by hand..
Can you explain more in details how to do this in my case? Very appreciate your help.
Cheers,
Peng