TestOpenClose.py 909 B

12345678910111213141516171819202122232425262728293031
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. import sys
  7. import os
  8. import azlmbr.bus
  9. import azlmbr.paths
  10. import collections
  11. import random
  12. def main():
  13. paths = azlmbr.atomtools.util.GetPathsInSourceFoldersMatchingExtension('materialgraph')
  14. for path in paths.copy():
  15. if 'cache' in path.lower():
  16. paths.remove(path)
  17. for i in range(0, 100):
  18. for path in paths:
  19. if azlmbr.atomtools.util.IsDocumentPathEditable(path):
  20. azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(azlmbr.bus.Broadcast, 'OpenDocument', path)
  21. azlmbr.atomtools.AtomToolsDocumentSystemRequestBus(azlmbr.bus.Broadcast, 'CloseAllDocuments')
  22. random.shuffle(paths)
  23. if __name__ == "__main__":
  24. main()