Guest User

Untitled

a guest
Jun 20th, 2020
19
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import bpy
  2.  
  3.  
  4. class SimpleOperator(bpy.types.Operator):
  5. """Tooltip"""
  6. bl_idname = "object.simple_operator"
  7. bl_label = "Simple Object Operator"
  8. '''
  9. @classmethod
  10. def poll(cls, context):
  11. return context.active_object is not None
  12. '''
  13.  
  14. def execute(self, context):
  15. #print (context.area.spaces.active.clip)
  16.  
  17. for i in range(1,5+1):
  18. bpy.ops.clip.change_frame(frame=i)
  19. context.scene.frame_set(i)
  20. bpy.ops.clip.select_all('INVOKE_DEFAULT', action='DESELECT')
  21. bpy.ops.clip.detect_features('INVOKE_DEFAULT',)
  22.  
  23. bpy.ops.clip.select_all('INVOKE_DEFAULT', action='SELECT')
  24. bpy.ops.clip.track_markers('INVOKE_DEFAULT', backwards=False, sequence=False)
  25.  
  26. return {'FINISHED'}
  27.  
  28.  
  29. def register():
  30. bpy.utils.register_class(SimpleOperator)
  31.  
  32.  
  33. def unregister():
  34. bpy.utils.unregister_class(SimpleOperator)
  35.  
  36.  
  37. if __name__ == "__main__":
  38. register()
  39.  
  40. # test call
  41. #bpy.ops.object.simple_operator()
RAW Paste Data