Guest User

Untitled

a guest
Jan 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import bpy
  2.  
  3. context = bpy.context
  4. ob = context.object
  5. ad = ob.animation_data
  6.  
  7. if ad:
  8. action = ad.action
  9. if action:
  10. remove_types = ["location", "scale", "rotation"]
  11. # select all that have datapath above
  12. fcurves = [fc for fc in action.fcurves
  13. for type in remove_types
  14. if fc.data_path.startswith(type)
  15. ]
  16. # remove fcurves
  17. while(fcurves):
  18. fc = fcurves.pop()
  19. action.fcurves.remove(fc)
  20.  
  21. fcurves = [fc for fc in action.fcurves
  22. for type in remove_types
  23. if fc.data_path.startswith(type)
  24. and fc.array_index == 1
  25. ]
Add Comment
Please, Sign In to add comment