Maya is not letting me delete a namespace

Maya is not letting me delete a namespace

Anonymous
Not applicable
5,680 Views
5 Replies
Message 1 of 6

Maya is not letting me delete a namespace

Anonymous
Not applicable

Hello, I am having an issue that is preventing me from exporting animations properly.

 

I'm opening the previous artists animation files. We are referencing in a rig file with the namespace 'TestRig', but we need to delete this namespace in order to properly export.

 

However when I attempt to Delete the TestRig namespace I get the following error:

 

  • // Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/namespaceEditCmd.mel line 715: The source namespace ':TestRig' contains referenced nodes.

How do I get past this so I can delete the namespace?

Any help is appreciated, thank you.

0 Likes
Accepted solutions (1)
5,681 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Accepted solution

Hi

if you want to export the animation  in reference file , its not a problem, why u want to delete the Name Space .

otherwise If u want to delete the  namespace, Import the reference file , and remove the Namespace.

We can't able to Delete the  Namespace when the file in Reference.

Thanks

0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi, thanks for the reply. The issue I'm having is I cannot export our animation properly to engine without deleting certain parts of the rig (mainly constraints and control objects). My plan was to delete the namespace and merge the referenced rig into the file root so I can delete the needed parts and export the FBX. However, something is preventing me from deleting the namespace, which is preventing me from deleting anything else.

 

I tried the reverse (importing my animation onto the master rig file) and that allowed me to delete the constraints and export successfully. Ideally though I would be able to export from the animation file (which is referencing in the master rig file). Not being a Maya expert, I'm not sure the best option here.

0 Likes
Message 4 of 6

Anonymous
Not applicable

Thank you, the key for me was selecting File > Import Objects from Reference from the Reference Editor. I didn't know about this option before, that was what was giving me trouble.

Message 5 of 6

Stefmon
Contributor
Contributor

This is great. I was stuck with either references not wanting to delete or wrong referencing options meaning the namespace is added as an actual prefix part of the name and not a namespace. 

I animate on referenced rigs for game characters, then when I need to export the animation for the engine, I need to remove the namespace so that the animation's skeleton matches with the character rig's skeleton in the engine.

 

If you're having trouble removing the namespace using the method (namespace editor in Windows > General editors > Namespace Editor) then try this method:

  1. First go to your reference editor in (File > Reference Editor)
  2. then in that new window click (File) in the top left drop down and select Import (Objects from Reference).
    This will make the referenced objects and all animations real, rather than referenced, meaning you can edit them.
  3. Now that your object are real, select all the objects in your skeleton, open the script editor from (Windows > General Editors > Script Editor) and in the new window select the (Python) tab that's above the bottom text box.
  4. In the Python tab type this code (make sure you indent the last line by pressing [tab]):
    import pymel.core as pm
    for item in pm.selected():
          item.rename(item.name().replace('The Prefix You Want to Remove', 'What you want to replace the prefix with'))

    What this will do is replace a prefix with something else. In my case I wrote:
    import pymel.core as pm
    for item in pm.selected():
          item.rename(item.name().replace('NewRig_Cloths_', ''))

    This will remove the prefix 'NewRig_Cloths_' and replace it with nothing ''.

    And that's it! Now my animation that I couldn't remove the namespace for will will match the character rig in engine.  I won't save the file, because I want to keep the original animation file, but I will export the animation.

 

Hope this helped. I've seen this issue in many places and I've been struggling with it too. Hopefully this is a useful answer for everyone. Appreciate it if OP sets this as the new answer 👍

exampl.png

Message 6 of 6

Stefmon
Contributor
Contributor

ALSO - make sure that when you remove the prefix from the animation file's contents, you do so for everything and not just the skeleton.

0 Likes