def _get_gozid_mismatches(objs):
"""Return objects from `objs` whose gozbruhBrushID does not match their name
Checks object history for instances of gozbruhBrushID,
returns a list ofgozbruhBrushID/name conflicts
gozbruhBrushID is created by ZBrush on export and is used to track
name changes that can occur in maya
this function compares object current name against the ID
and returns a list of conflicts
this list is handled by the gui to allow for dialog boxes
"""
goz_list = []
for obj in objs:
has_attr = cmds.attributeQuery(
'gozbruhBrushID', node=obj, exists=True)
if has_attr:
# check for 'rename'
goz_id = cmds.getAttr(obj + '.gozbruhBrushID')
if obj != goz_id:
goz_list.append((obj, goz_id))
else:
# check for old ID in history
for old_obj in cmds.listHistory(obj):
has_attr = cmds.attributeQuery('gozbruhBrushID',
node=old_obj,
exists=True)
if has_attr:
goz_id = cmds.getAttr(old_obj + '.gozbruhBrushID')
if obj != goz_id:
goz_list.append((obj, goz_id))
# resulting mismatches to be handled
return goz_list
#------------------------------------------------------------------------------
# Sending / Exporting
#------------------------------------------------------------------------------
评论列表
文章目录