EditorCommandLine_test_case.py 949 B

1234567891011121314151617181920212223242526272829
  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 azlmbr.bus as bus
  8. import azlmbr.editor as editor
  9. print ('editor command line works')
  10. for x in range(len(sys.argv)):
  11. print ('editor command line arg {}'.format(sys.argv[x]))
  12. # make sure the @engroot@ exists as a azlmbr.paths property
  13. engroot = azlmbr.paths.engroot
  14. if (engroot is not None and len(engroot) is not 0):
  15. print ('engroot is {}'.format(engroot))
  16. print ('editor engroot set')
  17. # resolving a basic path
  18. path = azlmbr.paths.resolve_path('@engroot@/engineassets/texturemsg/defaultsolids.mtl')
  19. if (len(path) != 0 and path.find('@engroot@') == -1):
  20. print ('path resolved to {}'.format(path))
  21. print ('path resolved worked')
  22. editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'ExitNoPrompt')