How to access UUID with C++ API?

How to access UUID with C++ API?

Anonymous
Not applicable
1,328 Views
1 Reply
Message 1 of 2

How to access UUID with C++ API?

Anonymous
Not applicable

Hi,

 

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.

 

Thanks

0 Likes
1,329 Views
1 Reply
Reply (1)
Message 2 of 2

stuzzz
Collaborator
Collaborator

Hi,

I've tried or tested but reading the doc, this would help:

//create your MObject() containing your node here 
mfn = MFnDependencyNode(obj);
MUuid myuuid = mfn.uuid();
myuuid.asString();    

 

please let me know.

 

0 Likes