OTish - Maya namespaces - clearing that up

252 views
Skip to first unread message

Morten Bartholdy

unread,
Jun 14, 2018, 3:56:08 AM6/14/18
to Userlist, Softimage

I am sure I am not the only one finding Mayas namespaces extremely annoying.

If I do a search on Maya namespaces, numerous hits explain how namespaces are annoying and how to handle them and/or get rid of them via built-in tools, scripts, or other methods – one of these even come from an Autodesk Technical Specialist: https://area.autodesk.com/blogs/the-maya-blog/maya_2012_namespace_and_prefix_tips_and_tricks/ so even Autodesk knows how annoying this is… these guys are inane.

I get why there has to be a nameclash handling mechanism but find the straightforward method of incremental numbering in XSI as hassle free as possible, so I was wondering if anyone knows if there are any benefits at all with the Maya namespace method or if it has to do with Maya data handling why they haven't used the more straightforward incremental numbering which seems to be working in Maya anyway!?

Thanks Morten ------ Softimage Mailing List. To unsubscribe, send a mail to softimag...@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.

Stefan Kubicek

unread,
Jun 14, 2018, 4:47:09 AM6/14/18
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list, Morten Bartholdy

Everybody hates Namespaces, but you don't necessarily need to use them. First of all: Maya is more permissive with regards to duplicate names since it only demands an objects “Full Name” (i.e. the name of the object prepended by all it's parent's names) to be unique in a scene. In Softimage, an objects name needs to be unique within it's Model, irrespective of it's location in the hierarchy under that model, which is of course a more deterministic way of identifying objects with regards to file referencing, the animation mixer, etc, but that's not the point here.

In Maya, just like in 3dsMax or Softimage (or any other 3d package I think), you get automatic numbering of objects in case of a name clash (i.e. when the full name of the new object is similar). That usually occurs when creating or duplicating an object or node, importing or referencing a file, or rearranging objects in a hierarchy. The closest thing to the Softimage Model paradigm in Maya you can get is to use groups. For example, instead of maintaining your character rig and meshes under a model in Soft, you do the same under a group in Maya. There is even an option to automatically group objects on import, which is what I usually do, and/or to rename (i.e. number) clashing names on import, which is less tidy but also helpful sometimes. That's it.

Stefan

PS: I still hope to find out the address of that moron at Alias one fine day who decided that namespaces are a clever way to handle scene complexity.

On 14.06.2018 09:56, Morten Bartholdy wrote:

I am sure I am not the only one finding Mayas namespaces extremely annoying.

If I do a search on Maya namespaces, numerous hits explain how namespaces are annoying and how to handle them and/or get rid of them via built-in tools, scripts, or other methods – one of these even come from an Autodesk Technical Specialist: https://area.autodesk.com/blogs/the-maya-blog/maya_2012_namespace_and_prefix_tips_and_tricks/ <https://urldefense.proofpoint.com/v2/url?u=https-3A__u7507473.ct.sendgrid.net_wf_click-3Fupn-3D5SmYwFIJXHmC5X9wAP0G6ui9ndn-2D2BrPckKmQuMExySxDcB-2D2B2Cv43FA1Cl3CAceI0DUKvGEyTFpaxxyHOzrsJPBkmw8ivBqIosXKC6PGdBtnsN407Paq9UtwShjpFRRsmi19O8ieW0TuwT44wrPXhckQ-2D3D-2D3D-5FAiuOPJnPrj4wc3JxtM6Fu4BFTLWfPgU-2D2BZSdmfLFS5-2D2BsJ3JlitusvKzDTX4sOR42u811Ikqqfqfz0-2D2By5Zky5FBVUhYfwlpaPUet56yhLRNqJg0q6QTQbdSO7qrrCMOKXxSE1yb3TdYiDzOKvjdoJduMmBWoBd0WChSDf937-2D2BmIr8AUoCU6uPZWm-2D2BxVNd3UY-2D2FuojXXXLsKdvmrK2LdN3dsxn1fi8UEBHT67xx-2D2FnaIMuxo-2D3D&d=DwID-g&c=76Q6Tcqc-t2x0ciWn7KFdCiqt6IQ7a_IF9uzNzd_2pA&r=GmX_32eCLYPFLJ529RohsPjjNVwo9P0jVMsrMw7PFsA&m=gn63cFqY03X5pH_T9Jywolnnakap-EmMtS1ghG4BOPU&s=VjTd150UYGNqOJ3gFomixGgTDcjP2fBGYO8fhHuEw80&e=> so even Autodesk knows how annoying this is… these guys are inane.

I get why there has to be a nameclash handling mechanism but find the straightforward method of incremental numbering in XSI as hassle free as possible, so I was wondering if anyone knows if there are any benefits at all with the Maya namespace method or if it has to do with Maya data handling why they haven't used the more straightforward incremental numbering which seems to be working in Maya anyway!?

Thanks Morten ------ Softimage Mailing List. To unsubscribe, send a mail to softimag...@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.

Enrique Caballero

unread,
Jun 14, 2018, 6:12:34 AM6/14/18
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Namespaces are annoying.

When building assets, what I do to deal with them is I bind a hotkey to collapse all namespaces, as sometimes when you are building an asset, you are drag and dropping several other assets into the scene and frankensteining them together.  You then end up with a huge nested tree of namespaces that just takes forever to delete one at a time in the namespace editor.  I will share my script for collapsing namespaces at the end of this email.

As annoying as they are, you can disable viewing namespaces in most editors,  and I recommend that you use them for your referenced assets, otherwise you will end up with name clashing on the scene Root.

For example, the root object of all of our rigs is named "ROOT_NUL"

If we didnt use namespaces, each one of those would get a number appended to them once imported.  Not the end of the world, but I don't want my referenced assets to go around changing their naming randomly.

yes we could use more unique names for our ROOT_NULS, like putting the asset name in there, but I rather just let the namespace handle that, and keep all of our assets and rigs standardised.




script for collapsing namespaces follows:


"""

Collapses all namespaces (including nested) to root.

"""


# Recursively collect all namespaces.

def get_all_namespaces(iter_nsp=[":"]):

for nsp in iter_nsp:

yield nsp

all_nested_nsp = cmds.namespaceInfo(nsp, listOnlyNamespaces=True) or []

for nested_nsp in get_all_namespaces(iter_nsp=all_nested_nsp):

yield nested_nsp

default_namespaces = [":", "UI", "shared"]


scene_namespaces = list(get_all_namespaces())


for nsp in reversed(scene_namespaces):


if nsp in default_namespaces:

continue

print "Removing namespace {}".format(nsp)

cmds.namespace(removeNamespace=nsp, mergeNamespaceWithRoot=True)










Thanks Morten ------ Softimage Mailing List. To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.

------ Softimage Mailing List. To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.


Morten Bartholdy

unread,
Jun 14, 2018, 9:32:55 AM6/14/18
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list

Interesting – so there is a good use for it.

Personally I hate it when imported or referenced models don't have unique names, but I guess it depends on your pipeline and type of work :)

Thanks for the script – it will come in handy!

MB

If I do a search on Maya namespaces, numerous hits explain how namespaces are annoying and how to handle them and/or get rid of them via built-in tools, scripts, or other methods – one of these even come from an Autodesk Technical Specialist: https://area.autodesk.com/ blogs/the-maya-blog/maya_2012_namespace_and_prefix_tips_and_tricks/ <https://urldefense.proofpoint.com/v2/url?u=https-3A__u7507473.ct.sendgrid.net_wf_click-3Fupn-3D5SmYwFIJXHmC5X9wAP0G6ui9ndn-2D2BrPckKmQuMExySxDcB-2D2B2Cv43FA1Cl3CAceI0DUKvGEyTFpaxxyHOzrsJPBkmw8ivBqIosXKC6PGdBtnsN407Paq9UtwShjpFRRsmi19O8ieW0TuwT44wrPXhckQ-2D3D-2D3D-5FwAli21vZ0ansRLHjQSxwcqGxGljxven5UMtKBZQLjG1cP147Ga0NOI7h2r3bC2vhuop3z71fLvApJFmq8DxFwEwz5mMOqTSP8eUXz6yQBIQtd6ty8gLU-2D2B5GieJV4QL9ukyXKnl4LEEGMxl5MrNJ6-2D2B1GINtAbYHn7mz1KWq45S2seADFramXvdOlSSVVJEvM5IkGMzyxlKhDdmn02jHh3rP4XSbW0Ai2nOdXPKMpvfXU-2D3D&d=DwIFaQ&c=76Q6Tcqc-t2x0ciWn7KFdCiqt6IQ7a_IF9uzNzd_2pA&r=GmX_32eCLYPFLJ529RohsPjjNVwo9P0jVMsrMw7PFsA&m=1ApGyj5jns7HMMoSpjgW-cJR1vhNDHyqtuOfIdKAEA4&s=o1SD1TCT7nknpS1QrkUJxuv4VB6g-4Ge_vlCnf0vLqI&e=> <https://urldefense.proofpoint.com/v2/url?u=https- 3A__u7507473.ct.sendgrid.net_wf_click-3Fupn-3D5SmYwFIJXHmC5X9wAP0G6ui9ndn- 2D2BrPckKmQuMExySxDcB-2D2B2Cv43FA1Cl3CAceI0DUKvGEyTF paxxyHOzrsJPBkmw8ivBqIosXKC6PGdBtnsN407Paq9UtwShjpFRRsmi19O8 ieW0TuwT44wrPXhckQ-2D3D-2D3D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qUftSf4BHr1fHSlatLWPeP-2FwmC6SxMc66tg5VTtmsAQy3QXvrWJVEv-2FZyZYLs1EfsaFuJzxqFqlmXthE9Sxr77a4-2F0gYbCOEDzpEJQwnjKJmDaAI2OdyFQYmhBcRyGuAUfyfQsogwlYGajRF6uULudkj0H7iu-2BKH-2B-2FeEhQ45pvT7B1KBCtev8Sm5hgVulZGEC9pJjr37Mbn43MhLR66u7Hu7F7-2FkUsvAkMSP7lFJxJ-2BYulHNO5d8kjTcvcIZawWFWoRTd3nAlA-2BjCt84s1vJOOGKxB1libvo5BOHWTyQTtdA6DOEyUiapYhznp580SXJEQ4cwJSqR-2FzlJQCT4Sel4h9wypm5Bul6D232wW51g4mxI910agrMJlCn0DP6ws7BOoBFkIcDrvCn5b8LKXDzbUCpURmSKZBgKp0RXFug3y1-2BKr6lIXJmn-2FzRiZigaeoWj4eYgFAz1HL7n5Y0qzspubPWVsSgfVpKqbjIs-3D_wAli21vZ0ansRLHjQSxwcqGxGljxven5UMtKBZQLjG1cP147Ga0NOI7h2r3bC2vhuop3z71fLvApJFmq8DxFwAh-2FVUlsWGRymCDMJhurLhtyMIYSdfZvfAOnrVBqWv8wokNT3HDn1A0NJSX6q-2FVY2KcoNj6Dwvad2um4EeVOiggpELyRVCIavTw0qa-2FkIukhfY1UZXVVjnZ-2FFhQ734o-2FvLUcFyFXX5osfrKeQ1H-2Bhys-3D>> so even Autodesk knows how annoying this is… these guys are inane.

I get why there has to be a nameclash handling mechanism but find the straightforward method of incremental numbering in XSI as hassle free as possible, so I was wondering if anyone knows if there are any benefits at all with the Maya namespace method or if it has to do with Maya data handling why they haven't used the more straightforward incremental numbering which seems to be working in Maya anyway!?

Thanks Morten ------ Softimage Mailing List. To unsubscribe, send a mail to softimag...@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.

------ Softimage Mailing List. To unsubscribe, send a mail to softimag...@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.

------ Softimage Mailing List. To unsubscribe, send a mail to softimag...@listproc.autodesk.com with “unsubscribe” in the subject, and reply to confirm.

Enrique Caballero

unread,
Jun 18, 2018, 1:36:56 AM6/18/18
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Hope it helps.
  We track our assets using a line of JSON that is stored under the ROOT_NUL of the asset, this stores the asset name, type, path, what project it goes to etc.

All of our tools read this JSON line and interpret it for us, and we have coded some nice front-end tools so that the animator doesn't really need to use the outliner much.

Coming from Softimage, I was shocked at how name dependent Maya was, and how hopelessly crazy the outliner can become with all of the SETS and the super long name spaces.

So we basically worked around it, but yah... every one of our assets has identical naming for the ROOT_NUL and for the basic structure.  Its that JSON line that has the real asset info.
Reply all
Reply to author
Forward
0 new messages