![]() Whats strange is that its lost the offset in X of 150, as though its transforms have been reset. Run script by 'import copyPivot\n pyPivot() ''' import maya.cmds as cmds import l as mel def copyPivot (): sourceObj = cmds.ls(sl = True ) targetObj = cmds.ls(sl = True ) parentList = for obj in targetObj: if cmds.listRelatives( obj, parent = True ): parentList.append(cmds.listRelatives( obj, parent = True )) else : parentList.append( '' ) if len (cmds.ls(sl = True ))< 2 : cmds.error( 'select 2 or more objects.' ) pivotTranslate = cmds.xform (sourceObj, q = True, ws = True, rotatePivot = True ) cmds.parent(targetObj, sourceObj) cmds.makeIdentity(targetObj, a = True, t = True, r = True, s = True ) cmds.xform (targetObj, ws = True, pivots = pivotTranslate) for ind in range ( len (targetObj)): if parentList != '' : cmds.parent(targetObj, parentList) else : cmds. If i unparent the null via the GUI, the Interest stays put, however if i do this in script, the Null returns to 0,0,0. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |