Given a clip selected in the trax editor, I can easily get the character, and the clip scheduler, but I'm having trouble getting the clipIndex, so that I can then get the track the clip is on, and do things to that track like mute, solo, etc. I feel like I've tried every combination of flags.
These work for me:
# select a clip in trax
animClip = pm.selected()[0]
character = pm.PyNode( pm.clip( animClip, query=True, character=True )[0] )
scheduler = character.getClipScheduler()
# Solos a track
pm.clipSchedule( scheduler, edit=True, track=2, solo=True )
# prints what track the clipindex is on
print pm.clipSchedule( scheduler, query=True, track=True, clipIndex=3 )
but if I try to query the clipIndex with the name arg. I'm getting the first instance of my clip. not the index of the clips name going into the arg. what am I doing wrong here? how do I easily just get the clipIndex of a selected clip in trax?
print pm.clipSchedule( scheduler, query=True, name=animClip, clipIndex=True )
Thanks
Kev
import maya.OpenMaya as om
import maya.OpenMayaAnim as oma
import pymel.core as pm
# select a clip in trax
animClip = pm.selected()[0]
mSel = om.MSelectionList()
mSel.add( animClip.name() )
mAnimClip = om.MObject()
mSel.getDependNode( 0, mAnimClip )
mFnAnimClip = oma.MFnClip( mAnimClip )
print mFnAnimClip.getTrack()