Top level nodes are known as assemblies <http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/ls.html> in Maya. Although I don’t know of any way of getting a reference directly from an import, listing assemblies directly may help distil new nodes.
Assuming your file only had a single top-level node: from maya import cmds before = cmds.ls(assemblies=True) cmds.polyCube(name="MyCube") # Perform your import here after = cmds.ls(assemblies=True) top_level_node = set(after).difference(before).pop() print top_level_node # Returns MyCube -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBh-zic%2BRD0vU%3DEFH_aa-CDaz-eKaSktQu0N2wARACseQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
