Hello, I am trying to find the correct way to import a clip to a character.
If I use Import Animation Clip to Characters in the Trax Editor, the clip gets imported as expected with the source and the scheduled clip:
import maya.cmds as cmds
print cmds.ls(type='animClip')
# Output is [u'walk_0_00', u'walk_0_00Source']
However, when I try to import the clip to the character via code, I end up with two source clips:
# Unload any existing clips
clips = cmds.ls(type='animClip')
if clips:
cmds.delete(clips)
# Import clip
cmds.file('D:/Testing/Maya/walk_0_00.ma', i=True, type='mayaAscii', removeDuplicateNetworks=True, options='v=0', loadReferenceDepth='none')
cmds.clip('walk_0_00Source', copy=True)
cmds.clip('player', paste=True, scheduleClip=True, startTime=0, mapMethod='byNodeName')
print cmds.ls(type='animClip')
# Output is [u'walk_0_00', u'walk_0_00Source', u'walk_0_00Source1']
The scheduled clip ends up being an instance of walk_0_00Source1 instead of walk_0_00Source.
I could clean this up by deleting walk_0_00Source and then renaming walk_0_00Source1 to walk_0_00Source. But would rather find a solution where I can tell the clip command not to create an extra source clip in the first place.