Get local path from path with references

Get local path from path with references

Anonymous
Not applicable
682 Views
2 Replies
Message 1 of 3

Get local path from path with references

Anonymous
Not applicable

Hello.

I have a maya file that references another maya file.

DAG path strings look like this: 

|root_skeleton|rig:Geometry|rig:skeleton_effects|rig:skeleton_effectsShapeOrig

I can obtain the namespace which is ":rig".

Now I need to get the local path for a node within referenced file, e.g. 

|Geometry|skeleton_effects|skeleton_effectsShapeOrig

The easy but dirty approach is to transform ":rig" => "rig:", then delete everything before first namespace occurance and finally delete the remaining namespace substrings.

But I wonder is there a Maya API to get the local path without namespace in a cleaner way?

 

0 Likes
Accepted solutions (1)
683 Views
2 Replies
Replies (2)
Message 2 of 3

olarn
Advocate
Advocate
Accepted solution

http://help.autodesk.com/cloudhelp/2018/ENU/Maya-SDK/cpp_ref/class_m_namespace.html#a3d06313c5ef9f98... 🤔

 

edit:

Ah, long name is not supported. Python regex is still the simplest solution.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Yeah it seems to be stripping all path component except for the last one. Thanks for clarifying that replacing is OK-ish solution.

0 Likes