Created
January 31, 2022 01:44
-
-
Save yamadaaaaaaa/3a47a8eef6eb86ad04ef8a2fede0fc46 to your computer and use it in GitHub Desktop.
maya_nameConflict.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.cmds as cmds | |
| list_obj = [] | |
| dic_obj = {} | |
| list_objects = cmds.ls(dag=True, ni=True, sn=True) | |
| for _object in list_objects: | |
| if not '|' in _object:continue | |
| _name = _object.split('|').pop() | |
| if _name in dic_obj.keys(): | |
| list_obj.extend([dic_obj[_name],_object]) | |
| dic_obj.setdefault(_name,_object) | |
| if list_obj: | |
| cmds.select(list_obj,r=True) | |
| print(list_obj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment