How to access UUID with C++ API?



I’m writing a plugin in C++ and need to get the UUID of the selected node. When I create a shape, a NURBS Cube for example, I see the UUID attribute is in the Attribute Editor. I also have found that you can use the MEL command “ls -uuid [node name]” to get it to print to the MEL Result box. However, I need access to this data from within the C++ code I’m writing.

I’m reading about plugs and attributes, so I think I’m on the right path, but I’m still having some trouble. Any guidance or help would be much appreciated.




I think I found it, but I’ll keep this post up for anyone in the future looking for the same information.

I used MFnDependencyNode.

MObject node;
MFnDependencyNode fn(node);
std::cout << fn.uuid().asString() << std::endl;


If you are looking for the C++ plugin page then you need to get some writing instructions which will be helpful for the perfect plugin choosing options which will be helpful for getting the C++ plugin. A lot of students always choose the site option which provides the writing service reviews to get instant writing help.