[MEL] Namespace management for referenced objects

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  05 May 2018
[MEL] Namespace management for referenced objects


Hello there !

I would like some help with namespace management. A solution with MEL would be great, but I would also be interested with any Python one

I have one maya scene with two main objects, a box and a sphere. Both are references and therefore in read only state.

My Outliner currently looks like this:

BOX : Object1 : Group
---BOX : Object1 : Mesh
------BOX : Object1 : BoxTopMesh
------BOX : Object1 : BoxBottomMesh
---BOX : Object1 : Rig
------BOX : Object1 : Boxjoint


BOX : Object2 : Group
---BOX : Object2 : Mesh
------BOX : Object2 : SphereMesh

---BOX : Object2 : Rig
------BOX : Object2 : Spherejoint


What I'm trying to do is to remove the BOX namespace for the sphere, but keeping it for the Box. It should looks like this:

BOX : Object1 : Group
---BOX : Object1 : Mesh
------BOX : Object1 : BoxTopMesh
------BOX : Object1 : BoxBottomMesh
---BOX : Object1 : Rig
------BOX : Object1 : Boxjoint


Object2 : Group
---Object2 : Mesh
------Object2 : SphereMesh

---Object2 : Rig
------Object2 : Spherejoint

Whaterver I tried, in MEL ( rename command ) or using the namespace editor, I always end up with " Cannot rename a read only node ".
Removing completely the BOX for both objects works tho ( using MEL:namespace -mv "BOX" ":" -force; )

Any idea ?

Thank you

 
  05 May 2018
(Why are you randomly bolding words? It's really weird and hard to read.)

You can change the namespace on a reference in the reference editor. If a reference was created with a namespace, I don't think changing it to no longer use namespaces is supported (you can only change the namespace, not remove it), but if they're in a nested namespace you can remove the nesting (change it from "box:object1" to "object1").

(ed: If that does what you want, you can script it with the "file -e -namespace" command.)
 
  05 May 2018
Thank you for your answer !

( bolded words are not random ones , I was just trying to make important items clear. Sorry If it was hard to read ).


As you said, the reference was created with a namespace. In the Ref-editor the namespace in the upper text-box shows " Object2", and in the ref list " BOX:Object2".

It's weird that we can completely remove the namespace BOX and re-parent everything to root, but not removing it for just one of the 2 refs.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:17 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.