Files
Jonny Galloway b779f358d0 Refactor DCCsi to work better with O3DE changes (#4226)
* moving files in refactor/re-org

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* dev env refactor/re-org

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* moving/re-org so we can deprate the SDK nomiclature

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* moving/re-org so we can deprate the SDK nomiclature

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Refactoring env so I can replace SDK with Tools folder

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* re-org and prune, from SKD to Tools

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Removing old .bat files from SDK

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* updated how to retreive PYTHONHOME

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Can't use/set PYTHONHOME with DCC Tools

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* small refactor

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* repaired a missed typo (causes error)

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Added missing EntityId.h include to FocusModeInterface.h

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* refactor additional LY to O3DE tags

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Some design scaffold file stubs

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* stubbing in scaffold file pattern

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Removal of corrupted prefabs

Signed-off-by: Benjamin Black <benblac@amazon.com>

* refactored config_utils to maintain py2.7 support for maya 2020

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* refactored config_utils to maintain py2.7 support for maya 2020

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* pruning and cleanup

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* .env is for local dev overrides

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* .env is for local dev overrides

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* clean up init and logging patterns

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* Core refactoring, config.py functional standalone

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* cleaned up some bad logging, fixed up boostrap

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* fixed validation errors

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* fix logging issue, tiddy up

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* tiddy up maya for .bat bootstraping and launch

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

* name stub, fix validation

Signed-off-by: Jonny Gallowy <gallowj@amazon.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
Co-authored-by: Benjamin Black <benblac@amazon.com>
2021-10-21 17:03:49 -07:00

81 lines
3.0 KiB
Python

# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""This is a module to test script extensions for WingIDE
reference: https://wingware.com/doc/scripting/example
note: there are important instructions in that doc for
setting up your project files with wingapi auto-complete, etc.
We added C:\Program Files (x86)\Wing Pro 7.1\src to the
PYTHONPATH via env.bat and dynaconf config instead so it is
part of the inhereted environment."""
import sys
import logging as _logging
import wingapi
# -------------------------------------------------------------------------
_MODULENAME = 'azpy.dev.ide.wing.test'
_LOGGER = _logging.getLogger(_MODULENAME)
_handler = _logging.StreamHandler(sys.stdout)
_handler.setLevel(_logging.DEBUG)
FRMT_LOG_LONG = "[%(name)s][%(levelname)s] >> %(message)s (%(asctime)s; %(filename)s:%(lineno)d)"
_formatter = _logging.Formatter(FRMT_LOG_LONG)
_handler.setFormatter(_formatter)
_LOGGER.addHandler(_handler)
_LOGGER.debug('Loading: {0}.'.format({_MODULENAME}))
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def dccsi_test_script(test_str):
"""Simple test command for WingIDE
to run in wing: Edit > Command by Name
^ opens a commanline at bottom of IDE
type: test-script (then return)
^ commandline now takes entering a Test Str
Test Str: Booyah
^ a Pop-up dialog will display in wing
"""
app = wingapi.gApplication
v = "Product info is: " + str(app.GetProductInfo())
v += "\nAnd you typed: %s" % test_str
wingapi.gApplication.ShowMessageDialog("Test Message", v)
#dccsi_test_script.contexts = [wingapi.kContextNewMenu("Scripts")]
# this will add to a menu in WingIDE
dccsi_test_script.contexts = [
wingapi.kContextNewMenu("DCCsi Scripts"),
wingapi.kContextEditor(),
]
# -------------------------------------------------------------------------
# bind a hotkey inside Wing that will execute our newly installed Module
# Inside Wing, choose Edit -> Preferences, and on the left, under User Interface, choose Keyboard
# In the center right of the Keyboard section is where you can add "Ccustom Key Bindings" combinations to execute code
# For this test example, I have bound Ctrl+Alt+Shift+T as my key combination for executing dccsi_test_script
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
# there are not really tests to run here due to this being a list of
# constants for shared use.
_DCCSI_GDEBUG = True
_DCCSI_DEV_MODE = True
_LOGGER.setLevel(_logging.DEBUG) # force debugging
foo = dccsi_test_script("This is a test")