thanks for your interest!
Hopefully I've managed to get it working - I used MObjectHandle to this - the doc says that It will hold MObject till all references exists. So this is what I wanted. And it's working
.
Ok. I'll answer, on what I'm currently working, that I need such drastic decisions.
I'm making a tiny Maya core (which I called pico). I wanted to have a realtime preview inside of Maya of scenes that I was working with. The most importand thing was to get a 100% preview in Maya. So in order to do that I had to do some backwards engineering to rewrite most important parts of DAG, DG and attributes. Also there was a need to rewrite some of the most important internal nodes like "mesh", "transform", "shadingEngine", "surfaceShader" etc.
There were several problems when implementing the project. Ie when maya removes a node from DG it just moves that node to other "temporary deleted" node container. When the node comes back to DG it triggers the typical addNode callback. The problem is that this returning node has mixed up dagPath name, so I couldn't retrieve it properly from my "temporary deleted" container. Adding unique ID to each of the nodes helped me a lot, because I can comunicate between my nodes and maya nodes quite easly. Not saying that simple ID is a great hash improvement when searching the nodes in my DG.
I will answer for "What for?" question which may occure after my post
.
It's for realtime demos development. You can find more info about the engine here:
http://www.devmaster.net/forums/showthread.php?t=4052
and the productions can be found here:
http://www.plastic-demo.org
Cheers!