recently at work i was asked on doing a “singleton” maya node. The plan was to have a sceneData node that contains data about the scene (a serialized xml sheet),
and should only be once in every scene. I managed to do this with the c++ API. Basically what im doing is utilizing the post constructor to search for types of that
node and copy the data of the pre-existing node over to the newly created one. Then i delete the pre-existing one.
There are two things about this:
I couldnt get this to work with the python API. It doesnt let me access the MObject of itself within the postConstructor.
It exists and is of type kPluginDependNode, but MPlugs that try to access its attributes remain empty (as do MFnDependencyNode function sets).
What are your thoughts on singleton nodes in Maya? Is there an easier way, common practice to do this?
There are nodes in Maya that cannot be duplicated (time for example), but they are pre-existing in a new scene.