splinecraft
12/6/2016 - 12:33 AM

Getting a list of curves - 2 ways

Getting a list of curves - 2 ways

# from selected curves in graph editor
curves = pm.keyframe(q=True, selected=True, name=True)
print(curves)

"""
[u'IKSpine2_M_visibility_idle_mvmt_inputB', u'IKSpine2_M_translateX_idle_mvmt_inputB', 
u'IKSpine2_M_translateY_idle_mvmt_inputB', u'IKSpine2_M_translateZ_idle_mvmt_inputB', 
u'IKSpine2_M_rotate_idle_mvmt_inputBX', u'IKSpine2_M_rotate_idle_mvmt_inputBY', 
u'IKSpine2_M_rotate_idle_mvmt_inputBZ', u'IKSpine2_M_scaleX_idle_mvmt_inputB', 
u'IKSpine2_M_scaleY_idle_mvmt_inputB', u'IKSpine2_M_scaleZ_idle_mvmt_inputB', 
u'IKSpine2_M_stretchy_idle_mvmt_inputB', u'IKSpine2_M_stiff_idle_mvmt_inputB', 
u'IKSpine2_M_Global_idle_mvmt_inputB', u'IKSpine2_M_volume_idle_mvmt_inputB']
"""

# from selected control or obj
curves = pm.findKeyframe(curve=True)
print(curves)

"""
[u'IKSpine2_M_visibility_idle_mvmt_inputB', u'IKSpine2_M_translateX_idle_mvmt_inputB', 
u'IKSpine2_M_translateY_idle_mvmt_inputB', u'IKSpine2_M_translateZ_idle_mvmt_inputB', 
u'IKSpine2_M_rotate_idle_mvmt_inputBX', u'IKSpine2_M_rotate_idle_mvmt_inputBY', 
u'IKSpine2_M_rotate_idle_mvmt_inputBZ', u'IKSpine2_M_scaleX_idle_mvmt_inputB', 
u'IKSpine2_M_scaleY_idle_mvmt_inputB', u'IKSpine2_M_scaleZ_idle_mvmt_inputB', 
u'IKSpine2_M_stretchy_idle_mvmt_inputB', u'IKSpine2_M_stiff_idle_mvmt_inputB', 
u'IKSpine2_M_Global_idle_mvmt_inputB', u'IKSpine2_M_volume_idle_mvmt_inputB']
"""