Created
November 12, 2018 18:56
-
-
Save coxevan/6ca81425df1a2445c5ed3a0a716bbd7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def delete_keys_on_sel(): | |
selected = pm.selected() | |
if not selected: | |
return False | |
nodes_to_delete = [] | |
for obj in selected: | |
attrs = pm.listAttr(obj, k=True) | |
for attr in attrs: | |
input_list = getattr(obj, attr).inputs() | |
valid_anim_curve = [node for node in input_list if isinstance(node, pm.nt.AnimCurve)] | |
if not valid_anim_curve: | |
continue | |
nodes_to_delete.append(valid_anim_curve) | |
pm.delete(nodes_to_delete) | |
return True | |
delete_keys_on_sel() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment