- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The "createNode" command has a flag called "-shared". The documentation says, "This node is shared across multiple files, so only create it if it does not already exist." For example, the default cameras are marked as shared nodes. So when you import another Maya scene into the current scene, it does not create duplicate "persp", "front", etc. cameras.
Is it possible to make a shared node using the API? MFnDependencyNode has a function "isShared" to query whether a node is shared. But there is no function like "setShared". And the "create" function of MFnDependency node doesn't take a "shared" parameter. So far, the only way I have found to do it is:
MGlobal.executePythonCommand("cmds.createNode('network', name='mySharedNode', shared=True, ss=True)");
Am I missing something? Is there a better way?
Solved! Go to Solution.