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>
This commit is contained in:
Jonny Galloway
2021-10-21 19:03:49 -05:00
committed by GitHub
parent 50068bcae7
commit b779f358d0
197 changed files with 3779 additions and 3636 deletions
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,21 @@
# 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
"""
# -------------------------------------------------------------------------
# DCCsi\\Tools\\Blender\\AddOns\\MaterialExporter\\main.py
""" A in Blender tool for exporting BRDF materials as O3DE Atom StandardPBR
"""
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
print('MaterialExporter.main() not implemented')
@@ -0,0 +1,11 @@
# 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
"""
# -------------------------------------------------------------------------
print('Not Implemented')
@@ -0,0 +1,11 @@
# 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
"""
# -------------------------------------------------------------------------
print('Not Implemented')
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:083ab199e273431963fc5f80bb80b7d1b1d428f7b12a5180d7199a7431291982
size 311865
@@ -0,0 +1,36 @@
//Maya 2016 Project Definition
workspace -fr "fluidCache" "cache/nCache/fluid";
workspace -fr "images" "images";
workspace -fr "offlineEdit" "scenes/edits";
workspace -fr "furShadowMap" "renderData/fur/furShadowMap";
workspace -fr "iprImages" "renderData/iprImages";
workspace -fr "renderData" "renderData";
workspace -fr "scripts" "scripts";
workspace -fr "fileCache" "cache/nCache";
workspace -fr "eps" "data";
workspace -fr "shaders" "renderData/shaders";
workspace -fr "3dPaintTextures" "sourceimages/3dPaintTextures";
workspace -fr "translatorData" "data";
workspace -fr "mel" "scripts";
workspace -fr "furFiles" "renderData/fur/furFiles";
workspace -fr "OBJ" "data";
workspace -fr "particles" "cache/particles";
workspace -fr "scene" "scenes";
workspace -fr "furEqualMap" "renderData/fur/furEqualMap";
workspace -fr "sourceImages" "sourceimages";
workspace -fr "furImages" "renderData/fur/furImages";
workspace -fr "clips" "clips";
workspace -fr "depth" "renderData/depth";
workspace -fr "movie" "movies";
workspace -fr "audio" "sound";
workspace -fr "bifrostCache" "cache/bifrost";
workspace -fr "autoSave" "autosave";
workspace -fr "mayaAscii" "scenes";
workspace -fr "move" "data";
workspace -fr "sound" "sound";
workspace -fr "diskCache" "data";
workspace -fr "illustrator" "data";
workspace -fr "mayaBinary" "scenes";
workspace -fr "templates" "assets";
workspace -fr "furAttrMap" "renderData/fur/furAttrMap";
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:646b6d93b2c672bbbbcb46af1bfcaf26ca37c8a0c2b218989b145417bb6b7c93
size 262272
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:86209db0389b152c709d529e9d5705219b44bfbf712a26788a5c2ab0adc0c373
size 98452
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd95898a04b81b80b095dbef34523f3b70a8c14bc9f82116f732ab648f25658b
size 2096788
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a85a15d5c60102f414b4ad03604dbd1c78e3d1c1fe445f60db158b2c069f792d
size 25165972
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1318f73ca32ec56dfeb0233679504f6fc723081f0cafa8e7e2d0517b878defd1
size 2000893
@@ -0,0 +1,69 @@
//Maya 2016 Project Definition
workspace -fr "fluidCache" "mayaData/cache/nCache/fluid";
workspace -fr "JT_DC" "mayaData/Trans/JT";
workspace -fr "CATIAV4_DC" "mayaData/Trans/CATIAV4";
workspace -fr "images" "mayaData/Images";
workspace -fr "offlineEdit" "ArtSource/Maya";
workspace -fr "STEP_DC" "mayaData/Trans/STEP";
workspace -fr "furShadowMap" "mayaData/renderData/fur/furShadowMap";
workspace -fr "SPF_DCE" "mayaData/Trans/SPF";
workspace -fr "scripts" "mayaData/Scripts";
workspace -fr "CATIAV5_DC" "mayaData/Trans/CATIAV5";
workspace -fr "DAE_FBX" "mayaData/Trans/DAE_FBX";
workspace -fr "shaders" "mayaData/renderData/shaders";
workspace -fr "furFiles" "mayaData/renderData/fur/furFiles";
workspace -fr "OBJ" "mayaData/OBJ";
workspace -fr "FBX export" "mayaData/Trans/FBX_export";
workspace -fr "furEqualMap" "mayaData/renderData/fur/furEqualMap";
workspace -fr "Autodesk Packet File" "mayaData/Trans";
workspace -fr "DAE_FBX export" "mayaData/Trans/DAE_FBX_export";
workspace -fr "SPF_DC" "mayaData/Trans/SPF";
workspace -fr "movie" "mayaData/movies";
workspace -fr "DXF_DCE" "mayaData/Trans/DXF";
workspace -fr "move" "mayaData/move";
workspace -fr "mayaAscii" "ArtSource";
workspace -fr "autoSave" "mayaData";
workspace -fr "sound" "mayaData/Sounds";
workspace -fr "mayaBinary" "ArtSource";
workspace -fr "ZPR_DCE" "mayaData/Trans/ZPR";
workspace -fr "STL_DCE" "mayaData/Trans/STL";
workspace -fr "iprImages" "mayaData/renderData/iprImages";
workspace -fr "PhysX" "mayaData/Trans/Physx";
workspace -fr "DXF_DC" "mayaData/Trans/DXF";
workspace -fr "FBX" "mayaData/Trans/FBX";
workspace -fr "studioImport" "mayaData/Trans";
workspace -fr "UG_DCE" "mayaData/Trans/UG";
workspace -fr "renderData" "mayaData/renderData";
workspace -fr "fileCache" "mayaData/cache/nCache";
workspace -fr "eps" "mayaData/EPS";
workspace -fr "Fbx" "Objects";
workspace -fr "3dPaintTextures" "mayaData/images/3dPaintTextures";
workspace -fr "translatorData" "mayaData";
workspace -fr "mel" "mayaData/Scripts/Mel";
workspace -fr "particles" "mayaData/cache/particles";
workspace -fr "IV_DC" "mayaData/Trans/IV";
workspace -fr "scene" "ArtSource";
workspace -fr "DWG_DCE" "mayaData/Trans/DWG";
workspace -fr "MayaCryExport" "Objects";
workspace -fr "sourceImages" "ArtSource/Textures";
workspace -fr "furImages" "mayaData/renderData/fur/furImages";
workspace -fr "clips" "mayaData/clips";
workspace -fr "PTC_DC" "mayaData/Trans/PTC";
workspace -fr "STL_DC" "mayaData/Trans/STL";
workspace -fr "IPT_DC" "mayaData/Trans/IPT";
workspace -fr "CSB_DC" "mayaData/Trans/CSB";
workspace -fr "SW_DC" "mayaData/Trans/SW";
workspace -fr "depth" "mayaData/renderData/depth";
workspace -fr "audio" "mayaData/Sounds";
workspace -fr "DWG_DC" "mayaData/Trans/DWG";
workspace -fr "bifrostCache" "mayaData/cache/bifrost";
workspace -fr "IGES_DCE" "mayaData/Trans/IGES";
workspace -fr "Alembic" "mayaData/Trans/Alembic";
workspace -fr "illustrator" "mayaData/AI";
workspace -fr "diskCache" "mayaData";
workspace -fr "UG_DC" "mayaData/Trans/UG";
workspace -fr "templates" "mayaData/assets";
workspace -fr "OBJexport" "mayaData/Trans/Obj";
workspace -fr "furAttrMap" "mayaData/renderData/fur/furAttrMap";
workspace -fr "IGES_DC" "mayaData/Trans/IGES";
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,12 @@
# 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
#
#
# -------------------------------------------------------------------------
print('Not Implemented')
@@ -0,0 +1,32 @@
# 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 line is 75 characters -------------------------------------------
"""
Module Documentation:
DccScriptingInterface:: Tools//maya//scripts//constants.py
This module is mainly a bunch of commony used constants, and default strings
So we can make an update here once that is used elsewhere
"""
# -------------------------------------------------------------------------
# built-ins
# none
# -- External Python modules
# -- DCCsi Extension Modules
#import azpy
# -- maya imports
# none
# -------------------------------------------------------------------------
OBJ_DCCSI_MAINMENU = 'O3deDCCsiMainMenu'
TAG_DCCSI_MAINMENU = 'DCCsi (O3DE:Atom)'
@@ -0,0 +1,201 @@
# 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 line is 75 characters -------------------------------------------
"""
Module Documentation:
DccScriptingInterface:: SDK//maya//scripts//set_callbacks.py
This module manages a set of predefined callbacks for maya
"""
# -------------------------------------------------------------------------
# -- Standard Python modules
import os
import sys
import logging as _logging
# -- External Python modules
from box import Box
# maya imports
import maya.cmds as mc
import maya.api.OpenMaya as om
# -- DCCsi Extension Modules
from azpy.constants import *
import azpy.dcc.maya
azpy.dcc.maya.init() # <-- should have already run?
import azpy.dcc.maya.callbacks.event_callback_handler as azEvCbH
import azpy.dcc.maya.callbacks.node_message_callback_handler as azNdMsH
# Node Message Callback Setup
import azpy.dcc.maya.callbacks.on_shader_rename as oSR
from set_defaults import set_defaults
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
from azpy.env_bool import env_bool
from azpy.constants import ENVAR_DCCSI_GDEBUG
from azpy.constants import ENVAR_DCCSI_DEV_MODE
# global space
_DCCSI_GDEBUG = env_bool(ENVAR_DCCSI_GDEBUG, True)
_DCCSI_DEV_MODE = env_bool(ENVAR_DCCSI_DEV_MODE, True)
_MODULENAME = r'DCCsi.SDK.Maya.Scripts.set_callbacks'
_LOGGER = azpy.initialize_logger(_MODULENAME, default_log_level=int(20))
_LOGGER.debug('Invoking:: {0}.'.format({_MODULENAME}))
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# global scope callbacks, set up set and initialize all to None
# To Do: should callback initialization use data-driven settings?
# To Do: should we move callback initialization to a sub-module?
# To Do: move the callback key like 'NewSceneOpened' here (instead of None)
# ^ this would provide ability to loop through and replace key with CB object
_G_CALLBACKS = Box(box_dots=True) # global scope container
_G_PRIMEKEY = 'DCCsi_callbacks'
_G_CALLBACKS[_G_PRIMEKEY] = True # required prime key
# -------------------------------------------------------------------------
def init_callbacks(_callbacks=_G_CALLBACKS):
# store as a dict (Box is a fancy dict)
_callbacks[_G_PRIMEKEY] = True # required prime key
# signature dict['callback key'] = ('CallBack'(type), func, callbackObj)
_callbacks['on_new_file'] = ['NewSceneOpened', set_defaults, None]
_callbacks['new_scene_fix_paths'] = ['NewSceneOpened', install_fix_paths, None]
_callbacks['post_scene_fix_paths'] = ['PostSceneRead', install_fix_paths, None]
_callbacks['workspace_changed'] = ['workspaceChanged', update_workspace, None]
_callbacks['quit_app'] = ['quitApplication', uninstall_callbacks, None]
# nodeMessage style callbacks
# fire a function
_func_00 = oSR.on_shader_rename_rename_shading_group
# using a nodeMessage callback trigger
_cb_00 = om.MNodeMessage.addNameChangedCallback
# all nodeMessage type callbacks can use 'nodeMessageType' key
_callbacks['shader_rename'] = ['nodeMessageType', (_func_00, _cb_00), None]
return _callbacks
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def uninstall_callbacks():
"""Bulk uninstalls hte globally defined set of callbacks:
_G_callbacks"""
global _G_CALLBACKS
_LOGGER.debug('uninstall_callbacks() fired')
for key, value in _G_CALLBACKS:
if value[2] is not None: # have a cb
value[2].uninstall() # so uninstall it
else:
_LOGGER.warning('No callback in: key {0}, value:{1}'
''.format(key, value))
_G_CALLBACKS = None
_LOGGER.info('DCCSI CALLBACKS UNINSTALLED ... EXITING')
return _G_CALLBACKS
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def install_callbacks(_callbacks=_G_CALLBACKS):
"""Bulk installs the globally defined set of callbacks:
_G_callbacks"""
_LOGGER.debug('install_callback_set() fired')
_callbacks = init_callbacks(_callbacks)
# we initialized the box with this so pop it
if 'box_dots' in _callbacks:
_callbacks.pop('box_dots')
# don't pass anything but carefully considered dict
if _G_PRIMEKEY in _callbacks:
_primekey = _callbacks.pop(_G_PRIMEKEY)
else:
_LOGGER.error('No prime key, use a correct dictionary')
#To Do: implement error handling and return codes
return _callbacks[None]
for key, value in _G_CALLBACKS.items():
# we popped the prime key should the rest should be safe
if value[0] != 'nodeMessageType':
# set callback up
_cb = azEvCbH.EventCallbackHandler(value[0],
value[1])
# ^ installs by default
# stash it back into managed dict
value[2] = _cb
# value[2].install()
else:
# set up callback, value[1] should be tupple(func, trigger)
_cb = azNdMsH.NodeMessageCallbackHandler(value[1][0],
value[1][1])
# ^ installs by default
# stash it back into managed dict
value[2] = _cb
# value[2].install()
return _callbacks
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def install_fix_paths(foo=None):
"""Installs and triggers a fix paths module.
This can repair broken reference paths in shaders"""
global _fix_paths
_fix_paths = None
_LOGGER.debug('install_fix_paths() fired')
# if we don't have it already, this function is potentially triggered
# by a callback, so we don't need to keep importing it.
try:
_fix_paths
reload(_fix_paths)
except Exception as e:
try:
import fixPaths as _fix_paths
except Exception as e:
# To Do: not implemented yet
_LOGGER.warning('NOT IMPLEMENTED: {0}'.format(e))
# if we have it, use it
if _fix_paths:
return _fix_paths.main()
else:
# To Do: implement error handling and return codes
return 1
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def update_workspace(foo=None):
"""Forces and update of the workspace (workspace.mel)"""
_LOGGER.debug('update_workspace() fired')
result = mc.workspace(update=True)
return result
# -------------------------------------------------------------------------
# install and init callbacks on an import obj
_G_CALLBACKS = install_callbacks(_G_CALLBACKS)
# ==========================================================================
# Module Tests
#==========================================================================
if __name__ == '__main__':
_G_CALLBACKS = install_callbacks(_G_CALLBACKS)
@@ -0,0 +1,93 @@
# 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 line is 75 characters -------------------------------------------
"""
Module Documentation:
DccScriptingInterface:: SDK//maya//scripts//set_pref_defaults.py
This module manages a predefined set of prefs for maya
"""
# -------------------------------------------------------------------------
# -- Standard Python modules
import os
import sys
# -- External Python modules
# -- DCCsi Extension Modules
import azpy
from azpy.constants import *
# -- maya imports
import maya.cmds as mc
import maya.mel as mm
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
from azpy.env_bool import env_bool
from azpy.constants import ENVAR_DCCSI_GDEBUG
from azpy.constants import ENVAR_DCCSI_DEV_MODE
# global space
_DCCSI_GDEBUG = env_bool(ENVAR_DCCSI_GDEBUG, False)
_DCCSI_DEV_MODE = env_bool(ENVAR_DCCSI_DEV_MODE, False)
_MODULENAME = r'DCCsi.SDK.Maya.Scripts.set_defaults'
_LOGGER = azpy.initialize_logger(_MODULENAME, default_log_level=int(20))
_LOGGER.debug('Invoking:: {0}.'.format({_MODULENAME}))
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def set_defaults(units='meter'):
"""This method will make defined settings changes to Maya prefs,
to better configure maya to work with Lumberyard"""
# To Do: make this data-driven env/settings, game teams should be able
# to opt out and/or set their prefered configuration.
_LOGGER.debug('set_defaults_lumberyard() fired')
# set up default units ... this should be moved to bootstrap config
_LOGGER.info('Default, 1 Linear Game Unit in Lumberyard == 1 Meter'
' in Maya content. Setting default linear units to Meters'
' (user can change to other units in the preferences)')
result = mc.currentUnit(linear=units)
# set up grid defaults
_LOGGER.info('Setting Grid defaults, to match default unit scale.'
'(user can change grid config manually')
try:
mc.grid(size=32, spacing=1, divisions=10)
except Exception as e:
_LOGGER.warning('{0}'.format(e))
# viewFit
_LOGGER.info('Changing default mc.viewFit')
try:
mc.viewFit()
except Exception as e:
_LOGGER.warning('{0}'.format(e))
# some mel commands
_LOGGER.info('Changing sersp camera clipping planes')
try:
mm.eval(str(r'setAttr "perspShape.nearClipPlane" 0.01;'))
mm.eval(str(r'setAttr "perspShape.farClipPlane" 1000;'))
except Exception as e:
_LOGGER.warning('{0}'.format(e))
# set up fixPaths
_LOGGER.info('~ Setting up fixPaths in default scene')
return 0
# -------------------------------------------------------------------------
@@ -0,0 +1,88 @@
# 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 line is 75 characters -------------------------------------------
"""
Module Documentation:
DccScriptingInterface:: SDK//maya//scripts//set_menu.py
This module creates and manages a DCCsi mainmenu
"""
# -------------------------------------------------------------------------
# -- Standard Python modules
# none
# -- External Python modules
# none
# -- DCCsi Extension Modules
import azpy
from constants import OBJ_DCCSI_MAINMENU
from constants import TAG_DCCSI_MAINMENU
# -- maya imports
import pymel.core as pm
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
from azpy.env_bool import env_bool
from azpy.constants import ENVAR_DCCSI_GDEBUG
from azpy.constants import ENVAR_DCCSI_DEV_MODE
# global space
_DCCSI_GDEBUG = env_bool(ENVAR_DCCSI_GDEBUG, False)
_DCCSI_DEV_MODE = env_bool(ENVAR_DCCSI_DEV_MODE, False)
_MODULENAME = r'DCCsi.SDK.Maya.Scripts.set_menu'
_LOGGER = azpy.initialize_logger(_MODULENAME, default_log_level=int(20))
_LOGGER.debug('Invoking:: {0}.'.format({_MODULENAME}))
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def menu_cmd_test():
_LOGGER.info('test_func(), is TESTING main menu')
return
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def set_main_menu(obj_name=OBJ_DCCSI_MAINMENU, label=TAG_DCCSI_MAINMENU):
_main_window = pm.language.melGlobals['gMainWindow']
_menu_obj = obj_name
_menu_label = label
# check if it already exists and remove (so we don't duplicate)
if pm.menu(_menu_obj, label=_menu_label, exists=True, parent=_main_window):
pm.deleteUI(pm.menu(_menu_obj, e=True, deleteAllItems=True))
# create the main menu object
_custom_tools_menu = pm.menu(_menu_obj,
label=_menu_label,
parent=_main_window,
tearOff=True)
# make a dummpy sub-menu
pm.menuItem(label='Menu Item Stub',
subMenu=True,
parent=_custom_tools_menu,
tearOff=True)
# make a dummy menu item to test
pm.menuItem(label='Test', command=pm.Callback(menu_cmd_test))
return _custom_tools_menu
# ==========================================================================
# Run as LICENSE
#==========================================================================
if __name__ == '__main__':
_custom_menu = set_main_menu()
@@ -0,0 +1,130 @@
# 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 line is 75 characters -------------------------------------------
"""
Module Documentation:
DccScriptingInterface:: SDK//maya//scripts//set_shelf.py
This module manages a custom shelf in maya for the DCCsi
Reference: https://gist.github.com/vshotarov/1c3176fe9e38dcaadd1e56c2f15c95d9
"""
# -------------------------------------------------------------------------
# -- Standard Python modules
# none
# -- External Python modules
# none
# -- DCCsi Extension Modules
# none
# -- Maya Extension Modules
import maya.cmds as mc
# -------------------------------------------------------------------------
def _null(*args):
pass
# -------------------------------------------------------------------------
class customShelf(_Custom_Shelf):
'''This is an example shelf.'''
def build(self):
self.add_button(label="button1")
self.add_button("button2")
self.add_button("popup")
p = mc.popupMenu(b=1)
self.add_menu_item(p, "popupMenuItem1")
self.add_menu_item(p, "popupMenuItem2")
sub = self.add_submenu(p, "subMenuLevel1")
self.add_menu_item(sub, "subMenuLevel1Item1")
sub2 = self.add_submenu(sub, "subMenuLevel2")
self.add_menu_item(sub2, "subMenuLevel2Item1")
self.add_menu_item(sub2, "subMenuLevel2Item2")
self.add_menu_item(sub, "subMenuLevel1Item2")
self.add_menu_item(p, "popupMenuItem3")
self.add_button("button3")
# -------------------------------------------------------------------------
class _Custom_Shelf():
'''A simple class to build custom shelves in maya.
The build method is empty and an inheriting class should override'''
def __init__(self, name="DCCsi", icon_path=""):
self._name = name
self._icon_path = icon_path
self._label_background_color = (0, 0, 0, 0)
self._label_colour = (.9, .9, .9)
self._clean_old_shlef()
mc.setParent(self._name)
self.build()
def build(self):
'''Override this method in custom class.
Otherwise, nothing is added to the shelf.'''
pass
def add_button(self,
label='<NotSet>',
icon="commandButton.png",
command=_null,
doubleCommand=_null):
'''Adds a shelf button with the specified label,
command, double click command and image.'''
mc.setParent(self._name)
if icon:
icon = self._icon_path + icon
mc.shelfButton(width=37, height=37,
image=icon,
label=label,
command=command,
doubleClickCommand=doubleCommand,
imageOverlayLabel=label,
overlayLabelBackColor=self._label_background_color,
overlayLabelColor=self._label_colour)
def add_menu_item(self, parent, label, command=_null, icon=""):
'''Adds a shelf button with the specified label,
command, double click command and image.'''
if icon:
icon = self._icon_path + icon
return mc.menuItem(p=parent, l=label, c=command, i="")
def add_submenu(self, parent, label, icon=None):
'''Adds a sub menu item with the specified label and icon
to the specified parent popup menu.'''
if icon:
icon = self._icon_path + icon
return mc.menuItem(p=parent, l=label, i=icon, subMenu=1)
def _clean_old_shlef(self):
'''Checks if the shelf exists and empties it if it does or
creates it if it does not.'''
if mc.shelfLayout(self._name, ex=1):
if mc.shelfLayout(self._name, q=1, ca=1):
for each in mc.shelfLayout(self._name, q=1, ca=1):
mc.deleteUI(each)
else:
mc.shelfLayout(self._name, p="ShelfLayout")
# ==========================================================================
# Module Tests
# ==========================================================================
if __name__ == '__main__':
customShelf()
pass
@@ -0,0 +1,325 @@
# 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 line is 75 characters -------------------------------------------
from __future__ import unicode_literals
"""
This module fullfils the maya bootstrap pattern as described in their docs
https://tinyurl.com/y2aoz8es
Pattern is similar to Lumberyard Editor\\Scripts\\bootstrap.py
For now the proper way to initiate Maya boostrapping the DCCsi, is to use
the provided env and launcher bat files.
If you are developing for the DCCsi you can use this launcher to start Maya:
DccScriptingInterface\\Launchers\\Windows\\Launch_Maya_2020.bat"
To Do: ATOM-5861
"""
__project__ = 'DccScriptingInterface'
# it is really hard to debug userSetup bootstrapping
# this enables some rudimentary logging for debugging
_BOOT_INFO = True
# -------------------------------------------------------------------------
# built in's
import os
import sys
import site
import inspect
import traceback
import logging as _logging
# -- DCCsi Extension Modules
import azpy
from azpy.constants import *
from azpy.env_bool import env_bool
from azpy.constants import ENVAR_DCCSI_GDEBUG
from azpy.constants import ENVAR_DCCSI_DEV_MODE
# To Do: needs to be updated to use dynaconf and config.py
from azpy.env_base import _BASE_ENVVAR_DICT
# -- maya imports
import maya.cmds as cmds
import maya.mel as mel
#from pymel.all import *
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# global space
_DCCSI_GDEBUG = env_bool(ENVAR_DCCSI_GDEBUG, False)
_DCCSI_DEV_MODE = env_bool(ENVAR_DCCSI_DEV_MODE, False)
_DCCSI_DEV_MODE = True # force true for debugger testing
_ORG_TAG = r'Amazon::Lumberyard'
_APP_TAG = r'DCCsi'
_TOOL_TAG = r'SDK.Maya.Scripts.userSetup'
_TYPE_TAG = r'entrypoint' # bootstrap
_MODULENAME = str('{0}.{1}'.format(_APP_TAG, _TOOL_TAG))
_LOGGER = azpy.initialize_logger(_MODULENAME, default_log_level=int(20))
_LOGGER.info('Initializing: {0}.'.format({_MODULENAME}))
_LOGGER.info('DCCSI_GDEBUG: {0}.'.format({_DCCSI_GDEBUG}))
_LOGGER.info('DCCSI_DEV_MODE: {0}.'.format({_DCCSI_DEV_MODE}))
# flag to turn off setting up callbacks, until they are fully implemented
# To Do: consider making it a settings option to define and enable/disable
_G_LOAD_CALLBACKS = True # couple bugs, couple NOT IMPLEMENTED
_LOGGER.info('DCCSI_MAYA_SET_CALLBACKS: {0}.'.format({_G_LOAD_CALLBACKS}))
# early attach WingIDE debugger (can refactor to include other IDEs later)
if _DCCSI_DEV_MODE:
from azpy.test.entry_test import connect_wing
foo = connect_wing()
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# To Do REMOVE this block and replace with dev module
# debug prints, To Do: this should be moved to bootstrap config
#_G_DEBUGGER = os.getenv(ENVAR_DCCSI_GDEBUGGER, "WING")
#if _DCCSI_DEV_MODE:
#if _G_DEBUGGER == "WING":
#_LOGGER.info('{0}'.format('-' * 74))
#_LOGGER.info('Developer Debug Mode: {0}, Basic debugger: {1}'.format(_G_DEBUG, _G_DEBUGGER))
#try:
#_LOGGER.info('Attempting to start basic WING debugger')
#import azpy.lmbr.test
#_LOGGER.info('Package Imported: azpy.test')
#ouput = azpy.entry_test.main(verbose=False,
#connectDebugger=True,
#returnOuput=_G_DEBUG)
#_LOGGER.info(ouput)
#pass
#except Exception as e:
#_LOGGER.info("Error: azpy.test, entry_test (didn't perform)")
#_LOGGER.info("Exception: {0}".format(e))
#pass
#elif _G_DEBUGGER == "PYCHARM":
## https://github.com/juggernate/PyCharm-Maya-Debugging
#_LOGGER.info('{0}'.format('-' * 74))
#_LOGGER.info('Developer Debug Mode: {0}, Basic debugger: {1}'.format(_G_DEBUG, _G_DEBUGGER))
#sys.path.append('C:\Program Files\JetBrains\PyCharm 2019.1.3\debug-eggs\pydevd-pycharm.egg')
#try:
#_LOGGER.info('Attempting to start basic PYCHARM debugger')
## Inside Maya Python Console (Tip: add to a shelf button for quick access)
#import pydevd
#_LOGGER.info('Package Imported: pydevd')
#pydevd.settrace('localhost', port=7720, suspend=False)
#_LOGGER.info('PYCHARM Debugger Attach Success!!!')
## To disconnect run:
## pydevd.stoptrace()
#pass
#except Exception as e:
#_LOGGER.info("Error: pydevd.settrace (didn't perform)")
#_LOGGER.info("Exception: {0}".format(e))
#pass
#else:
#pass
## -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# validate access to the DCCsi and it's Lib site-packages
# bootstrap site-packages by version
from azpy.constants import PATH_DCCSI_PYTHON_LIB_PATH
try:
os.path.exists(PATH_DCCSI_PYTHON_LIB_PATH)
site.addsitedir(PATH_DCCSI_PYTHON_LIB_PATH)
_LOGGER.info('azpy 3rdPary site-packages: is: {0}'.format(PATH_DCCSI_PYTHON_LIB_PATH))
except Exception as e:
_LOGGER.error('ERROR: {0}, {1}'.format(e, PATH_DCCSI_PYTHON_LIB_PATH))
raise e
# 3rdparty
from unipath import Path
from box import Box
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Maya is frozen
#_MODULE_PATH = Path(__file__)
# https://tinyurl.com/y49t3zzn
# module path when frozen
_MODULE_FILEPATH = os.path.abspath(inspect.getfile(inspect.currentframe()))
_MODULE_PATH = os.path.dirname(_MODULE_FILEPATH)
if _BOOT_INFO:
_LOGGER.debug('Boot: CWD: {}'.format(os.getcwd()))
_LOGGER.debug('Frozen: _MODULE_FILEPATH: {}'.format(_MODULE_FILEPATH))
_LOGGER.debug('Frozen: _MODULE_PATH: {}'.format(_MODULE_PATH))
_LOGGER.debug('Module __name__: {}'.format(__name__))
# root: INFO: Module __name__: __main__
_LOGGER.info('_MODULENAME: {}'.format(_MODULENAME))
# -------------------------------------------------------------------------
# check some env var tags (fail if no, likely means no proper code access)
_STR_ERROR_ENVAR = "Envar 'key' does not exist in base_env: {0}"
_DCCSI_TOOLS_PATH = None
# To Do: needs to be updated to use dynaconf and config.py
try:
_DCCSI_TOOLS_PATH = _BASE_ENVVAR_DICT[ENVAR_DCCSI_TOOLS_PATH]
except Exception as e:
_LOGGER.critical(_STR_ERROR_ENVAR.format(_BASE_ENVVAR_DICT[ENVAR_DCCSI_TOOLS_PATH]))
_O3DE_PROJECT_PATH = None
try:
_O3DE_PROJECT_PATH = _BASE_ENVVAR_DICT[ENVAR_O3DE_PROJECT_PATH]
except Exception as e:
_LOGGER.critical(_STR_ERROR_ENVAR.format(_BASE_ENVVAR_DICT[ENVAR_O3DE_PROJECT_PATH]))
# check some env var tags (fail if no, likely means no proper code access)
_O3DE_DEV = _BASE_ENVVAR_DICT[ENVAR_O3DE_DEV]
_O3DE_DCCSIG_PATH = _BASE_ENVVAR_DICT[ENVAR_DCCSIG_PATH]
_O3DE_DCCSI_LOG_PATH = _BASE_ENVVAR_DICT[ENVAR_DCCSI_LOG_PATH]
_O3DE_AZPY_PATH = _BASE_ENVVAR_DICT[ENVAR_DCCSI_AZPY_PATH]
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# To Do: implement data driven config
# Currently not used, but will be where we store the ordered dict
# which is parsed from the project bootstrapping config files.
_G_app_config = {}
# global scope maya callbacks container
_G_callbacks = Box(box_dots=True) # global scope container
# used to store fixPaths in the global scope
_fix_paths = None
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# add appropriate common tools paths to the maya environment variables
def startup():
"""Early starup execution before mayautils.executeDeferred().
Some things like UI and plugins should be defered to avoid failure"""
_LOGGER.info('startup() fired')
# get known paths
_KNOWN_PATHS = site._init_pathinfo()
if os.path.isdir(_DCCSI_TOOLS_PATH):
site.addsitedir(_DCCSI_TOOLS_PATH, _KNOWN_PATHS)
try:
import azpy.test
_LOGGER.info('SUCCESS, import azpy.test')
except Exception as e:
_LOGGER.warning('startup(), could not import azpy.test')
_LOGGER.info('startup(), COMPLETE')
return 0
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# verify Shared\Python exists and add it as a site dir. Begin imports and config.
def post_startup():
"""Allows for a defered execution startup sequence"""
_LOGGER.info('post_startup() fired')
# plugins, To Do: these should be moved to bootstrapping config
try:
maya.cmds.loadPlugin("dx11Shader")
except Exception as e:
_LOGGER.error(e) # not a hard failure
# Lumberyard DCCsi environment ready or error out.
try:
import azpy.dcc.maya
_LOGGER.info('Python module imported: azpy.dcc.maya')
except Exception as e:
_LOGGER.error(e)
_LOGGER.error(traceback.print_exc())
return 1
# Dccsi azpy maya ready or error out.
try:
azpy.dcc.maya.init()
_LOGGER.info('SUCCESS, azpy.dcc.maya.init(), code accessible.')
except Exception as e:
_LOGGER.error(e)
_LOGGER.error(traceback.print_exc())
return 1
# callbacks, To Do: these should also be moved to the bootstrapping config
# Defered startup after the Ui is running.
_G_CALLBACKS = Box(box_dots=True) # this just ensures a global scope container
if _G_LOAD_CALLBACKS:
from set_callbacks import _G_CALLBACKS
# ^ need to hold on to this as the install repopulate set
# this ensures the fixPaths callback is loaded
# even when the other global callbacks are disabled
from set_callbacks import install_fix_paths
install_fix_paths()
# set the project workspace
#_O3DE_PROJECT_PATH = _BASE_ENVVAR_DICT[ENVAR_O3DE_PROJECT_PATH]
_project_workspace = os.path.join(_O3DE_PROJECT_PATH, TAG_MAYA_WORKSPACE)
if os.path.isfile(_project_workspace):
try:
# load workspace
maya.cmds.workspace(_O3DE_PROJECT_PATH, openWorkspace=True)
_LOGGER.info('Loaded workspace file: {0}'.format(_project_workspace))
maya.cmds.workspace(_O3DE_PROJECT_PATH, update=True)
except Exception as e:
_LOGGER.error(e)
else:
_LOGGER.warning('Workspace file not found: {1}'.format(_O3DE_PROJECT_PATH))
# Set up Lumberyard, maya default setting
from set_defaults import set_defaults
set_defaults()
# Setup UI tools
if not maya.cmds.about(batch=True):
_LOGGER.info('Add UI dependent tools')
# wrap in a try, because we haven't implmented it yet
try:
mel.eval(str(r'source "{}"'.format(TAG_O3DE_DCC_MAYA_MEL)))
except Exception as e:
_LOGGER.error(e)
# manage custom menu in a sub-module
from set_menu import set_main_menu
set_main_menu()
# To Do: manage custom shelf in a sub-module
_LOGGER.info('post_startup(), COMPLETE')
_LOGGER.info('DCCsi Bootstrap, COMPLETE')
return 0
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
if __name__ == '__main__':
try:
# Early startup config.
startup()
# This allows defered action post boot (atfer UI is active)
from maya.utils import executeDeferred
post = executeDeferred(post_startup)
except Exception as e:
traceback.print_exc()
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,23 @@
# 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
#
#
# -------------------------------------------------------------------------
# DCCsi\\Tools\\DCC\\Maya\\config.py
"""DccScriptingInterface (DCCsi)
This is the dynamic config (dynaconf) for O3DE Maya DCCsi interface
"""
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
print('Maya.config() not implemented')
@@ -0,0 +1,16 @@
# 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
#
#
# -------------------------------------------------------------------------
# DCCsi\\Tools\\DCC\\Maya\\constsants.py
"""DccScriptingInterface (DCCsi)
This module contains constants for the O3DE Maya DCCsi interface
"""
@@ -0,0 +1,78 @@
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
-------------------------------------------------------------------------------
"DccScriptingInterface" aka DCCsi is a Gem for O3DE to extend and interface with dcc tools
in the python ecosystem. Each dcc tool may have it's own specific version of python.
Most are some version of py3+. O3DE provides an install of py3+ and manages package
dependancies with requirements.txt files and the cmake build system.
However Autodesk Maya still uses a version of py2.7 and so we need an alternate way
to deal with package management for this DCC tool.
Maya ships with it's own python interpreter called mayapy.exe
Generally it is located here:
C:\Program Files\Autodesk\Maya2020\bin\mayapy.exe
The python install and site-packages are here:
C:\Program Files\Autodesk\Maya2020\Python\Lib\site-packages
A general goal of the DCCsi is be self-maintained, and to not taint the users installed applications of environment.
So we boostrap additional access to site-packages in our userSetup.py:
"C:\Depot\Lumberyard\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\SDK\Maya\Scripts\userSetup.py"
We don't want users to have to install or use Python2.7 although with maya and possibly other dcc tools we don't have that control. Maya 2020 and earlier versions are still on Python2.7, so instead of forcing another install of python we can just use mayapy to manage extensions.
Pip may already be installed, you can check like so (your maya install path may be different):
C:\Program Files\Autodesk\Maya2020\bin>mayapy -m pip --version
If pip is not available yet for your mayapy.
First find out where th site-packages is located
C:\Program Files\Autodesk\Maya2020\bin>mayapy -m site
sys.path = [
'C:\\Program Files\\Autodesk\\Maya2020\\bin',
'C:\\Program Files\\Autodesk\\Maya2020\\bin\\python27.zip',
'C:\\Program Files\\Autodesk\\Maya2020\\Python\\DLLs',
'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib',
'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\plat-win',
'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\lib-tk',
'C:\\Program Files\\Autodesk\\Maya2020\\Python',
'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\site-packages',
]
USER_BASE: 'C:\\Users\\gallowj\\AppData\\Roaming\\Python' (exists)
USER_SITE: 'C:\\Users\\gallowj\\AppData\\Roaming\\Python\\Python27\\site-packages' (doesn't exist)
ENABLE_USER_SITE: True
This is the location we are looking for:
C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\site-packages
download get-pip.py and put into the above ^ directory:
https://bootstrap.pypa.io/pip/2.7/get-pip.py
Put that in the root of site-packages:
C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\site-packages\\get-pip.py
With get-pip module ready, we run it to install pip:
C:\Program Files\Autodesk\Maya2020\bin>mayapy -m get-pip
Now you should be able to run the following command and verify pip:
C:\Program Files\Autodesk\Maya2020\bin>mayapy -m pip --version
pip 20.3.4 from C:\Users\< you >\AppData\Roaming\Python\Python27\site-packages\pip (python 2.7)
Now your local maya install is all set up with pip so you can install additional python packages to use in maya. (note: not all packages are compatible with maya)
Now you will want to run the following file to finish setup...
We have a requirements.txt file with the extension packages we use in the DCCsi.
You'll need the repo/branch path of your O3DE (aka Lumberyard) install.
And you'll need to know where the DCCsi is located, we will install package dependancies there.
Note: you may need to update the paths below to match your local o3de engine install!
C:\Program Files\Autodesk\Maya2020\bin>mayapy -m pip install -r C:\Depot\o3de\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\SDK\Maya\requirements.txt -t C:\Depot\o3de\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\3rdParty\Python\Lib\2.x\2.7.x\site-packages
@@ -0,0 +1,84 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes requirements.txt
#
certifi==2020.6.20 \
--hash=sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3 \
--hash=sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41
# via -r requirements.txt
cachetools==3.1.1 \
--hash=sha256:428266a1c0d36dc5aca63a2d7c5942e88c2c898d72139fca0e97fdd2380517ae \
--hash=sha256:8ea2d3ce97850f31e4a08b0e2b5e6c34997d7216a9d2c98e0f3978630d4da69a
# via -r requirements.txt
click==7.1.2 \
--hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \
--hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
# via
# -r requirements.txt
# pip-tools
dynaconf==3.1.4 \
--hash=sha256:b2f472d83052f809c5925565b8a2ba76a103d5dc1dbb9748b693ed67212781b9 \
--hash=sha256:e6f383b84150b70fc439c8b2757581a38a58d07962aa14517292dcce1a77e160
# via -r requirements.txt
hashids==1.3.1 \
--hash=sha256:6c3dc775e65efc2ce2c157a65acb776d634cb814598f406469abef00ae3f635c \
--hash=sha256:8bddd1acba501bfc9306e7e5a99a1667f4f2cacdc20cbd70bcc5ddfa5147c94c
# via -r requirements.txt
pathlib2==2.3.5 \
--hash=sha256:0ec8205a157c80d7acc301c0b18fbd5d44fe655968f5d947b6ecef5290fc35db \
--hash=sha256:6cd9a47b597b37cc57de1c05e56fb1a1c9cc9fab04fe78c29acd090418529868
# via -r requirements.txt
pathlib==1.0.1 \
--hash=sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f
# via -r requirements.txt
python-box==3.4.6 \
--hash=sha256:694a7555e3ff9fbbce734bbaef3aad92b8e4ed0659d3ed04d56b6a0a0eff26a9 \
--hash=sha256:a71d3dc9dbaa34c8597d3517c89a8041bd62fa875f23c0f3dad55e1958e3ce10
# via -r requirements.txt
scandir==1.10.0 \
--hash=sha256:2586c94e907d99617887daed6c1d102b5ca28f1085f90446554abf1faf73123e \
--hash=sha256:2ae41f43797ca0c11591c0c35f2f5875fa99f8797cb1a1fd440497ec0ae4b022 \
--hash=sha256:2b8e3888b11abb2217a32af0766bc06b65cc4a928d8727828ee68af5a967fa6f \
--hash=sha256:2c712840c2e2ee8dfaf36034080108d30060d759c7b73a01a52251cc8989f11f \
--hash=sha256:4d4631f6062e658e9007ab3149a9b914f3548cb38bfb021c64f39a025ce578ae \
--hash=sha256:67f15b6f83e6507fdc6fca22fedf6ef8b334b399ca27c6b568cbfaa82a364173 \
--hash=sha256:7d2d7a06a252764061a020407b997dd036f7bd6a175a5ba2b345f0a357f0b3f4 \
--hash=sha256:8c5922863e44ffc00c5c693190648daa6d15e7c1207ed02d6f46a8dcc2869d32 \
--hash=sha256:92c85ac42f41ffdc35b6da57ed991575bdbe69db895507af88b9f499b701c188 \
--hash=sha256:b24086f2375c4a094a6b51e78b4cf7ca16c721dcee2eddd7aa6494b42d6d519d \
--hash=sha256:cb925555f43060a1745d0a321cca94bcea927c50114b623d73179189a4e100ac
# via
# -r requirements.txt
# pathlib2
six==1.15.0 \
--hash=sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259 \
--hash=sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced
# via
# -r requirements.txt
# pathlib2
typing==3.7.4.3 \
--hash=sha256:1187fb9c82fd670d10aa07bbb6cfcfe4bdda42d6fab8d5134f04e8c4d0b71cc9 \
--hash=sha256:283d868f5071ab9ad873e5e52268d611e851c870a2ba354193026f2dfb29d8b5
# via
# -r requirements.txt
# dynaconf
unipath==1.1 \
--hash=sha256:09839adcc72e8a24d4f76d63656f30b5a1f721fc40c9bcd79d8c67bdd8b47dae \
--hash=sha256:e6257e508d8abbfb6ddd8ec357e33589f1f48b1599127f23b017124d90b0fff7
# via -r requirements.txt
qdarkstyle==3.0.2 \
--hash=sha256:55d149cf5f40ee297397f1818e091118cefb855a4a9c5c38566c47acd2d8c7ae \
--hash=sha256:7c791535cc20b3cc1e8e1bf6b88dabe53cb0615983df702be83597e73ada2558
# via -r c:\temp\requirements.txt
qtpy==1.9.0 \
--hash=sha256:2db72c44b55d0fe1407be8fba35c838ad0d6d3bb81f23007886dc1fc0f459c8d \
--hash=sha256:fa0b8363b363e89b2a6f49eddc162a04c0699ae95e109a6be3bb145a913190ea
# via
# -r c:\temp\requirements.txt
# qdarkstyle
wincertstore==0.2 \
--hash=sha256:22d5eebb52df88a8d4014d5cf6d1b6c3a5d469e6c3b2e2854f3a003e48872356 \
--hash=sha256:780bd1557c9185c15d9f4221ea7f905cb20b93f7151ca8ccaed9714dce4b327a
# via -r requirements.txt
@@ -0,0 +1,24 @@
# 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
#
#
# -------------------------------------------------------------------------
# DCCsi\\Tools\\DCC\\Maya\\start.py
"""DccScriptingInterface (DCCsi)
The DCCsi bootstraps tools like Maya with additional code access and extensions.
This module starts up maya in the DCCsi managed synthetic environment context.
"""
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
print('Maya.Start() not implemented')
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,9 @@
# 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
"""
# -------------------------------------------------------------------------
@@ -0,0 +1,131 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up environment for Lumberyard DCC tools and code access
:: Set up window
TITLE O3DE DCC Scripting Interface Core
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Skip initialization if already completed
IF "%DCCSI_ENV_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCC Scripting Interface Environment ...
echo _____________________________________________________________________
echo.
IF "%DCCSI_DEV_ENV%"=="" (set DCCSI_DEV_ENV=%~dp0)
echo DCCSI_DEV_ENV = %DCCSI_DEV_ENV%
:: add to the PATH
SET PATH=%DCCSI_DEV_ENV%;%PATH%
:: Constant Vars (Global)
:: global debug flag (propogates)
:: The intent here is to set and globally enter a debug mode
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=false)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates earliest debugger connection
:: we support attaching to WingIDE... PyCharm and VScode in the future
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=false)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: Override this to control the setting
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=20)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: This maps up to the \Dev folder
IF "%O3DE_REL_PATH%"=="" (set O3DE_REL_PATH=..\..\..\..)
echo O3DE_REL_PATH = %O3DE_REL_PATH%
:: You can define the project name
IF "%O3DE_PROJECT%"=="" (
for %%a in (%CD%..\..\..\..) do set O3DE_PROJECT=%%~na
)
echo O3DE_PROJECT = %O3DE_PROJECT%
:: set up the default project path (dccsi)
:: if not set we also use the DCCsi path as stand-in
CD /D ..\..\..\
:: To Do: remove one of these
IF "%O3DE_PROJECT_PATH%"=="" (set O3DE_PROJECT_PATH=%CD%)
echo O3DE_PROJECT_PATH = %O3DE_PROJECT_PATH%
IF "%ABS_PATH%"=="" (set ABS_PATH=%CD%)
echo ABS_PATH = %ABS_PATH%
:: Save current directory and change to target directory
pushd %ABS_PATH%
:: Change to root Lumberyard dev dir
CD /d %O3DE_PROJECT_PATH%\%O3DE_REL_PATH%
IF "%O3DE_DEV%"=="" (set O3DE_DEV=%CD%)
echo O3DE_DEV = %O3DE_DEV%
:: Restore original directory
popd
:: dcc scripting interface gem path
:: currently know relative path to this gem
set DCCSIG_PATH=%O3DE_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface
echo DCCSIG_PATH = %DCCSIG_PATH%
:: Change to DCCsi root dir
CD /D %DCCSIG_PATH%
:: per-dcc sdk path
set DCCSI_TOOLS_PATH=%DCCSIG_PATH%\Tools
echo DCCSI_TOOLS_PATH = %DCCSI_TOOLS_PATH%
:: temp log location specific to this gem
set DCCSI_LOG_PATH=%O3DE_PROJECT_PATH%\.temp\logs
echo DCCSI_LOG_PATH = %DCCSI_LOG_PATH%
:: O3DE build path
IF "%O3DE_BUILD_FOLDER%"=="" (set O3DE_BUILD_FOLDER=build)
echo O3DE_BUILD_FOLDER = %O3DE_BUILD_FOLDER%
IF "%O3DE_BUILD_PATH%"=="" (set O3DE_BUILD_PATH=%O3DE_DEV%\%O3DE_BUILD_FOLDER%)
echo O3DE_BUILD_PATH = %O3DE_BUILD_PATH%
IF "%O3DE_BIN_PATH%"=="" (set O3DE_BIN_PATH=%O3DE_BUILD_PATH%\bin\profile)
echo O3DE_BIN_PATH = %O3DE_BIN_PATH%
:: add to the PATH
SET PATH=%O3DE_BIN_PATH%;%DCCSIG_PATH%;%PATH%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,147 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up extended DCCsi environment for Maya
:: Set up window
TITLE O3DE DCCsi Autodesk Maya Environment
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Skip initialization if already completed
IF "%DCCSI_ENV_MAYA_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
IF "%DCCSI_PY_VERSION_MAJOR%"=="" (set DCCSI_PY_VERSION_MAJOR=2)
IF "%DCCSI_PY_VERSION_MINOR%"=="" (set DCCSI_PY_VERSION_MINOR=7)
IF "%DCCSI_PY_VERSION_RELEASE%"=="" (set DCCSI_PY_VERSION_RELEASE=11)
:: Default Maya Version
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi Autodesk Maya Environment ...
echo _____________________________________________________________________
echo.
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
echo DCCSI_PY_VERSION_RELEASE = %DCCSI_PY_VERSION_RELEASE%
echo DCCSI_MAYA_VERSION = %DCCSI_MAYA_VERSION%
:::: Set Maya native project acess to this project
IF "%MAYA_PROJECT%"=="" (set MAYA_PROJECT=%O3DE_PROJECT%)
echo MAYA_PROJECT = %MAYA_PROJECT%
:: maya sdk path
set DCCSI_TOOLS_MAYA_PATH=%DCCSI_TOOLS_PATH%\DCC\Maya
echo DCCSI_TOOLS_MAYA_PATH = %DCCSI_TOOLS_MAYA_PATH%
set MAYA_MODULE_PATH=%DCCSI_TOOLS_MAYA_PATH%;%MAYA_MODULE_PATH%
echo MAYA_MODULE_PATH = %MAYA_MODULE_PATH%
:: Maya File Paths, etc
:: https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/Environment-Variables-File-path-variables-htm.html
:::: Set Maya native project acess to this project
IF "%MAYA_LOCATION%"=="" (set MAYA_LOCATION=%ProgramFiles%\Autodesk\Maya%DCCSI_MAYA_VERSION%)
echo MAYA_LOCATION = %MAYA_LOCATION%
IF "%MAYA_BIN_PATH%"=="" (set MAYA_BIN_PATH=%MAYA_LOCATION%\bin)
echo MAYA_BIN_PATH = %MAYA_BIN_PATH%
:: these improve the boot up time (Ha ... not really much)
IF "%MAYA_DISABLE_CIP%"=="" (set MAYA_DISABLE_CIP=1)
echo MAYA_DISABLE_CIP = %MAYA_DISABLE_CIP%
IF "%MAYA_DISABLE_CER%"=="" (set MAYA_DISABLE_CER=1)
echo MAYA_DISABLE_CER = %MAYA_DISABLE_CER%
IF "%MAYA_DISABLE_CLIC_IPM%"=="" (set MAYA_DISABLE_CLIC_IPM=1)
echo MAYA_DISABLE_CLIC_IPM = %MAYA_DISABLE_CLIC_IPM%
IF "%DCCSI_MAYA_SET_CALLBACKS%"=="" (set DCCSI_MAYA_SET_CALLBACKS=false)
echo DCCSI_MAYA_SET_CALLBACKS = %DCCSI_MAYA_SET_CALLBACKS%
:: setting this to 1 should further improve boot time (I think)
::IF "%MAYA_NO_CONSOLE_WINDOW%"=="" (set MAYA_NO_CONSOLE_WINDOW=0)
::echo MAYA_NO_CONSOLE_WINDOW = %MAYA_NO_CONSOLE_WINDOW%
:: But I like the console window for development and debugging early boot
:: shared location for 64bit DCCSI_PY_MAYA python location (2.7)
set DCCSI_PY_MAYA=%MAYA_BIN_PATH%\mayapy.exe
echo DCCSI_PY_MAYA = %DCCSI_PY_MAYA%
:: add to the PATH
SET PATH=%MAYA_BIN_PATH%;%PATH%
:: Local DCCsi Maya plugins access (ours)
set DCCSI_MAYA_PLUG_IN_PATH=%DCCSI_TOOLS_MAYA_PATH%\plugins
:: also attached to maya's built-it env var
set MAYA_PLUG_IN_PATH=%DCCSI_MAYA_PLUG_IN_PATH%;MAYA_PLUG_IN_PATH
echo DCCSI_MAYA_PLUG_IN_PATH = %DCCSI_MAYA_PLUG_IN_PATH%
:: Local DCCsi Maya shelves (ours)
set DCCSI_MAYA_SHELF_PATH=%DCCSI_TOOLS_MAYA_PATH%\Prefs\Shelves
set MAYA_SHELF_PATH=%DCCSI_MAYA_SHELF_PATH%
echo DCCSI_MAYA_SHELF_PATH = %DCCSI_MAYA_SHELF_PATH%
:: Local DCCsi Maya icons path (ours)
set DCCSI_MAYA_XBMLANGPATH=%DCCSI_TOOLS_MAYA_PATH%\Prefs\icons
:: also attached to maya's built-it env var
set XBMLANGPATH=%DCCSI_MAYA_XBMLANGPATH%;%XBMLANGPATH%
echo DCCSI_MAYA_XBMLANGPATH = %DCCSI_MAYA_XBMLANGPATH%
:: Local DCCsi Maya Mel scripts (ours)
set DCCSI_MAYA_SCRIPT_MEL_PATH=%DCCSI_TOOLS_MAYA_PATH%\Scripts\Mel
:: also attached to maya's built-it env var
set MAYA_SCRIPT_PATH=%DCCSI_MAYA_SCRIPT_MEL_PATH%;%MAYA_SCRIPT_PATH%
echo DCCSI_MAYA_SCRIPT_MEL_PATH = %DCCSI_MAYA_SCRIPT_MEL_PATH%
:: Local DCCsi Maya Python scripts (ours)
set DCCSI_MAYA_SCRIPT_PY_PATH=%DCCSI_TOOLS_MAYA_PATH%\Scripts\Python
:: also attached to maya's built-it env var
set MAYA_SCRIPT_PATH=%DCCSI_MAYA_SCRIPT_PY_PATH%;%MAYA_SCRIPT_PATH%
echo DCCSI_MAYA_SCRIPT_PY_PATH = %DCCSI_MAYA_SCRIPT_PY_PATH%
:: DCCsi Maya boostrap, userSetup.py access (ours)
set DCCSI_MAYA_SCRIPT_PATH=%DCCSI_TOOLS_MAYA_PATH%\Scripts
:: also attached to maya's built-it env var
set MAYA_SCRIPT_PATH=%DCCSI_MAYA_SCRIPT_PATH%;%MAYA_SCRIPT_PATH%
echo DCCSI_MAYA_SCRIPT_PATH = %DCCSI_MAYA_SCRIPT_PATH%
echo MAYA_SCRIPT_PATH = %MAYA_SCRIPT_PATH%
:: add all python related paths to PYTHONPATH for package imports
set PYTHONPATH=%DCCSI_MAYA_SCRIPT_PATH%;%DCCSI_MAYA_SCRIPT_PY_PATH%;%PYTHONPATH%
echo PYTHONPATH = %PYTHONPATH%
:: DX11 Viewport
Set MAYA_VP2_DEVICE_OVERRIDE=VirtualDeviceDx11
echo MAYA_VP2_DEVICE_OVERRIDE = %MAYA_VP2_DEVICE_OVERRIDE%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_MAYA_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,64 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up environment for Lumberyard DCC tools and code access
:: Skip initialization if already completed
IF "%DCCSI_ENV_PYCHARM_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: version Major
SET PYCHARM_VERSION_YEAR=2020
:: version Major
SET PYCHARM_VERSION_MAJOR=2
::"C:\Program Files\JetBrains\PyCharm 2019.1.3\bin"
::"C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.5\bin\pycharm64.exe"
:: put project env variables/paths here
set PYCHARM_HOME=%PROGRAMFILES%\JetBrains\PyCharm %PYCHARM_VERSION_YEAR%.%PYCHARM_VERSION_MAJOR%
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_IDE = %O3DE_PYTHON_INSTALL%\runtime\python-3.7.10-rev2-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_IDE%\python.exe
SET PYCHARM_PROJ=%DCCSIG_PATH%\Solutions
echo.
echo _____________________________________________________________________
echo.
echo ~ Setting up O3DE DCCsi Dev Env PyCharm %PYCHARM_VERSION_YEAR%.%PYCHARM_VERSION_MAJOR%.%PYCHARM_VERSION_MINOR%
echo _____________________________________________________________________
echo.
echo PYCHARM_VERSION_YEAR = %PYCHARM_VERSION_YEAR%
echo PYCHARM_VERSION_MAJOR = %PYCHARM_VERSION_MAJOR%
echo PYCHARM_HOME = %PYCHARM_HOME%
echo PYCHARM_PROJ = %PYCHARM_PROJ%
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_PYCHARM_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,87 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up extended environment for O3DE and DCCsi python
:: Skip initialization if already completed
IF "%DCCSI_ENV_PY_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
CALL %~dp0\Env_Core.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi Python Environment ...
echo _____________________________________________________________________
echo.
:: Python Version
:: Ideally these are set to match the O3DE python distribution
:: <O3DE>\python\runtime
IF "%DCCSI_PY_VERSION_MAJOR%"=="" (set DCCSI_PY_VERSION_MAJOR=3)
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
:: PY version Major
IF "%DCCSI_PY_VERSION_MINOR%"=="" (set DCCSI_PY_VERSION_MINOR=7)
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
IF "%DCCSI_PY_VERSION_RELEASE%"=="" (set DCCSI_PY_VERSION_RELEASE=10)
echo DCCSI_PY_VERSION_RELEASE = %DCCSI_PY_VERSION_RELEASE%
:: shared location for 64bit python 3.7 DEV location
:: this defines a DCCsi sandbox for lib site-packages by version
:: <O3DE>\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\3rdParty\Python\Lib
set DCCSI_PYTHON_PATH=%DCCSIG_PATH%\3rdParty\Python
echo DCCSI_PYTHON_PATH = %DCCSI_PYTHON_PATH%
:: add access to a Lib location that matches the py version (example: 3.7.x)
:: switch this for other python versions like maya (2.7.x)
IF "%DCCSI_PYTHON_LIB_PATH%"=="" (set DCCSI_PYTHON_LIB_PATH=%DCCSI_PYTHON_PATH%\Lib\%DCCSI_PY_VERSION_MAJOR%.x\%DCCSI_PY_VERSION_MAJOR%.%DCCSI_PY_VERSION_MINOR%.x\site-packages)
echo DCCSI_PYTHON_LIB_PATH = %DCCSI_PYTHON_LIB_PATH%
:: add to the PATH
SET PATH=%DCCSI_PYTHON_LIB_PATH%;%PATH%
:: shared location for default O3DE python location
set O3DE_PYTHON_INSTALL=%O3DE_DEV%\python
echo O3DE_PYTHON_INSTALL = %O3DE_PYTHON_INSTALL%
:: location for O3DE python 3.7 location
:: Note, many DCC tools (like Maya) include thier own python interpretter
:: Some DCC apps may not operate correctly if PYTHONHOME is set (this is definitely the case with Maya)
:: Be aware the python.cmd below does set PYTHONHOME
set DCCSI_PY_BASE=%O3DE_PYTHON_INSTALL%\python.cmd
echo DCCSI_PY_BASE = %DCCSI_PY_BASE%
CALL %O3DE_PYTHON_INSTALL%\get_python_path.bat
:: Some IDEs like Wing, may in some cases need acess directly to the exe to operate correctly
IF "%DCCSI_PY_IDE%"=="" (set DCCSI_PY_IDE=%O3DE_PYTHONHOME%\python.exe)
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: add to the PATH
SET PATH=%O3DE_PYTHON_INSTALL%;%O3DE_PYTHONHOME%;%DCCSI_PY_IDE%;%PATH%
:: add all python related paths to PYTHONPATH for package imports
set PYTHONPATH=%DCCSIG_PATH%;%DCCSI_PYTHON_LIB_PATH%;%O3DE_BUILD_PATH%;%PYTHONPATH%
echo PYTHONPATH = %PYTHONPATH%
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_PY_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,64 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Skip initialization of QT if already completed
IF "%DCCSI_ENV_QT_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi Qt/PySide2 Environment ...
echo _____________________________________________________________________
echo.
:: These need to be ADDED to any env or launcher that needs Qt/PySide2 access
:: This bootstraps O3DE Qt binaraies and PySide2 packages (which likely won't work in other versions of python)
:: If you set these in the env.bat it may cause some Qt apps like WingIDE from starting correctly (Wing is a Qt app)
:: Those apps provide their own Qt bins and Pyside packages (Wing, Substance, Maya, etc.)
:: set up Qt/Pyside paths
:: set up PySide2/Shiboken
set QTFORPYTHON_PATH=%O3DE_DEV%\Gems\QtForPython\3rdParty\pyside2\windows\release
echo QTFORPYTHON_PATH = %QTFORPYTHON_PATH%
:: add to the PATH
SET PATH=%QTFORPYTHON_PATH%;%PATH%
SET PYTHONPATH=%QTFORPYTHON_PATH%;%PYTHONPATH%
set QT_PLUGIN_PATH=%O3DE_BUILD_PATH%\bin\profile\EditorPlugins
echo QT_PLUGIN_PATH = %QT_PLUGIN_PATH%
:: add to the PATH
SET PATH=%QT_PLUGIN_PATH%;%PATH%
SET PYTHONPATH=%QT_PLUGIN_PATH%;%PYTHONPATH%
set O3DE_BIN_PATH=%O3DE_BUILD_PATH%\bin\profile
echo O3DE_BIN_PATH = %O3DE_BIN_PATH%
SET PATH=%O3DE_BIN_PATH%;%PATH%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_QT_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,54 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up environment for Lumberyard DCC tools and code access
:: Skip initialization if already completed
IF "%DCCSI_ENV_SUBSTANCE_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi Adobe Substance Environment ...
echo _____________________________________________________________________
echo.
: Substance Designer
:: maya sdk path
set DCCSI_SUBSTANCE_PATH=%DCCSI_TOOLS_PATH%\Substance
echo DCCSI_SUBSTANCE_PATH = %DCCSI_SUBSTANCE_PATH%
:: https://docs.substance3d.com/sddoc/project-preferences-107118596.html#ProjectPreferences-ConfigurationFile
:: Path to .exe, "C:\Program Files\Allegorithmic\Substance Designer\Substance Designer.exe"
set SUBSTANCE_PATH="%ProgramFiles%\Allegorithmic\Substance Designer"
echo SUBSTANCE_PATH = %SUBSTANCE_PATH%
:: default config
set SUBSTANCE_CFG_PATH=%O3DE_PROJECT_PATH%\DCCsi_default.sbscfg
echo SUBSTANCE_CFG_PATH = %SUBSTANCE_CFG_PATH%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_SUBSTANCE_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,52 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up environment for Lumberyard DCC tools and code access
:: Skip initialization if already completed
IF "%DCCSI_ENV_VSCODE_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
::SETLOCAL ENABLEDELAYEDEXPANSION
:: vscode has either a user install or a system install
:: https://code.visualstudio.com/#alt-downloads
:: that will change the paths assumed in this launcher (assume system install)
:: vscode envars: https://code.visualstudio.com/docs/editor/variables-reference
SET VSCODE_WRKSPC=%DCCSIG_PATH%\Solutions\.vscode\dccsi.code-workspace
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi WingIDE Environment ...
echo _____________________________________________________________________
echo.
echo VSCODE_WRKSPC = %VSCODE_WRKSPC%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_VSCODE_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,56 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Sets up environment for Lumberyard DCC tools and code access
:: Skip initialization if already completed
IF "%DCCSI_ENV_WINGIDE_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: WingIDE version Major
IF "%DCCSI_WING_VERSION_MAJOR%"=="" (set DCCSI_WING_VERSION_MAJOR=7)
:: WingIDE version Major
IF "%DCCSI_WING_VERSION_MINOR%"=="" (set DCCSI_WING_VERSION_MINOR=1)
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
:: put project env variables/paths here
set WINGHOME=%PROGRAMFILES(X86)%\Wing Pro %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR%
SET WING_PROJ=%DCCSIG_PATH%\Tools\Dev\Windows\Solutions\.wing\DCCsi_%DCCSI_WING_VERSION_MAJOR%x.wpr
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi WingIDE Environment ...
echo _____________________________________________________________________
echo.
echo DCCSI_WING_VERSION_MAJOR = %DCCSI_WING_VERSION_MAJOR%
echo DCCSI_WING_VERSION_MINOR = %DCCSI_WING_VERSION_MINOR%
echo WINGHOME = %WINGHOME%
echo WING_PROJ = %WING_PROJ%
:: add to the PATH
SET PATH=%WINGHOME%;%PATH%
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_WINGIDE_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,53 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up and run LY Python CMD prompt
:: Sets up the DccScriptingInterface_Env,
:: Puts you in the CMD within the dev environment
:: Set up window
TITLE O3DE DCC Scripting Interface Cmd
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCCsi CMD ...
echo _____________________________________________________________________
echo.
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
CALL %~dp0\Env_Maya.bat
CALL %~dp0\Env_Substance.bat
CALL %~dp0\Env_WingIDE.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
:: Create command prompt with environment
CALL %windir%\system32\cmd.exe
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,100 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up window
TITLE O3DE DCCsi GEM PyCharm
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: Constant Vars (Global)
:: global debug (propogates)
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=True)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates debugger connection
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=True)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=10)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_PyCharm.bat
CALL %~dp0\Env_Maya.bat
set DCCSI_PY_DEFAULT=%DCCSI_PY_MAYA%
:: add prefered python to the PATH
set PATH=%DCCSI_PY_DEFAULT%;%PATH%
echo.
echo _____________________________________________________________________
echo.
echo ~ Launching DCCsi Project in PyCharm %PYCHARM_VER_YEAR%.%PYCHARM_VER_MAJOR%.%PYCHARM_VER_MINOR% ...
echo ~ MayaPy.exe (default python interpreter)
echo _____________________________________________________________________
echo.
echo O3DE_DEV = %O3DE_DEV%
:: shared location for default O3DE python location
set O3DE_PYTHON_INSTALL=%O3DE_DEV%\Python
echo O3DE_PYTHON_INSTALL = %O3DE_PYTHON_INSTALL%
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_IDE = %O3DE_PYTHON_INSTALL%\runtime\python-3.7.10-rev2-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: ide and debugger plug
set DCCSI_PY_BASE=%DCCSI_PY_IDE%\python.exe
echo DCCSI_PY_BASE = %DCCSI_PY_BASE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_MAYA%
echo DCCSI_PY_DEFAULT = %DCCSI_PY_DEFAULT%
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
IF EXIST "%PYCHARM_HOME%\bin\pycharm64.exe" (
start "" "%PYCHARM_HOME%\bin\pycharm64.exe" "%PYCHARM_PROJ%"
) ELSE (
Where pycharm64.exe 2> NUL
IF ERRORLEVEL 1 (
echo pycharm64.exe could not be found
pause
) ELSE (
start "" pycharm64.exe "%PYCHARM_PROJ%"
)
)
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,73 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
:: Default Maya and Python version
set MAYA_VERSION=2020
set DCCSI_PY_VERSION_MAJOR=2
set DCCSI_PY_VERSION_MINOR=7
set DCCSI_PY_VERSION_RELEASE=11
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Maya.bat
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_MAYA%
:: Default BASE DCCsi python 3.7 location
:: Can be overridden (example, Launch_mayaPy_2020.bat :: MayaPy.exe)
set DCCSI_PY_DCCSI=%DCCSI_LAUNCHERS_PATH%Launch_mayaPy_2020.bat
echo DCCSI_PY_DCCSI = %DCCSI_PY_DCCSI%
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
echo _____________________________________________________________________
echo.
echo Launching Maya %MAYA_VERSION% for O3DE DCCsi...
echo _____________________________________________________________________
echo.
echo MAYA_VERSION = %MAYA_VERSION%
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
echo DCCSI_PY_VERSION_RELEASE = %DCCSI_PY_VERSION_RELEASE%
echo MAYA_LOCATION = %MAYA_LOCATION%
echo MAYA_BIN_PATH = %MAYA_BIN_PATH%
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
:: Default to the right version of Maya if we can detect it... and launch
IF EXIST "%MAYA_BIN_PATH%\maya.exe" (
start "" "%MAYA_BIN_PATH%\maya.exe" %*
) ELSE (
Where maya.exe 2> NUL
IF ERRORLEVEL 1 (
echo Maya.exe could not be found
pause
) ELSE (
start "" Maya.exe %*
)
)
::ENDLOCAL
:: Restore previous directory
POPD
:END_OF_FILE
@@ -0,0 +1,70 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up window
TITLE O3DE DCCsi GEM PyCharm
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: Constant Vars (Global)
:: global debug (propogates)
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=True)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates debugger connection
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=True)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=10)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: Initialize env
CALL %~dp0\Env_PyCharm.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ Launching DCCsi Project in PyCharm %PYCHARM_VERSION_YEAR%.%PYCHARM_VERSION_MAJOR% ...
echo _____________________________________________________________________
echo.
IF EXIST "%PYCHARM_HOME%\bin\pycharm64.exe" (
start "" "%PYCHARM_HOME%\bin\pycharm64.exe" "%PYCHARM_PROJ%"
) ELSE (
Where pycharm64.exe 2> NUL
IF ERRORLEVEL 1 (
echo pycharm64.exe could not be found
pause
) ELSE (
start "" pycharm64.exe "%PYCHARM_PROJ%"
)
)
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,51 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up and run LY Python CMD prompt
:: Sets up the DccScriptingInterface_Env,
:: Puts you in the CMD within the dev environment
:: Set up window
TITLE O3DE DCC Scripting Interface Py Min CMD
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE DCC Scripting Interface, Py Min Env CMD ...
echo _____________________________________________________________________
echo.
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
:: Create command prompt with environment
CALL %windir%\system32\cmd.exe
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,52 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up and run LY Python CMD prompt
:: Sets up the DccScriptingInterface_Env,
:: Puts you in the CMD within the O3DE_DEV environment
:: Set up window
TITLE O3DE DCC Scripting Interface Py Qt Cmd
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ LY DCC Scripting Interface, Py Qt Env CMD ...
echo _____________________________________________________________________
echo.
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
:: Create command prompt with environment
CALL %windir%\system32\cmd.exe
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,104 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Launches VScode and the DccScriptingInterface Project Files
:: Set up window
TITLE O3DE DCC Scripting Interface VScode
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
echo.
echo _____________________________________________________________________
echo.
echo ~ Setting up O3DE DCCsi VScode Dev Env...
echo _____________________________________________________________________
echo.
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: Constant Vars (Global)
:: global debug (propogates)
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=True)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates debugger connection
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=True)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=10)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: Initialize envCALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
CALL %~dp0\Env_Maya.bat
CALL %~dp0\Env_Substance.bat
CALL %~dp0\Env_VScode.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ Launching DCCsi Project in VScode
echo _____________________________________________________________________
echo.
echo O3DE_DEV = %O3DE_DEV%
:: shared location for default O3DE python location
set O3DE_PYTHON_INSTALL=%O3DE_DEV%\Python
echo O3DE_PYTHON_INSTALL = %O3DE_PYTHON_INSTALL%
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_IDE = %O3DE_PYTHON_INSTALL%\runtime\python-3.7.10-rev2-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: ide and debugger plug
set DCCSI_PY_BASE=%DCCSI_PY_IDE%\python.exe
echo DCCSI_PY_BASE = %DCCSI_PY_BASE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_BASE%
echo DCCSI_PY_DEFAULT = %DCCSI_PY_DEFAULT%
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
REM "C:\Program Files\Microsoft VS Code\Code.exe"
IF EXIST "%ProgramFiles%\Microsoft VS Code\Code.exe" (
start "" "%ProgramFiles%\Microsoft VS Code\Code.exe" "%VSCODE_WRKSPC%"
) ELSE (
Where Code.exe 2> NUL
IF ERRORLEVEL 1 (
echo Code.exe could not be found
pause
) ELSE (
start "" code.exe "%VSCODE_WRKSPC%"
)
)
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,87 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Launches Wing IDE and the DccScriptingInterface Project Files
:: Set up window
TITLE O3DE DCCsi Launch WingIDE 7x
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
:: Constant Vars (Global)
:: global debug (propogates)
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=True)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates debugger connection
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=True)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=10)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
CALL %~dp0\Env_Maya.bat
CALL %~dp0\Env_Substance.bat
CALL %~dp0\Env_WingIDE.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ WingIDE Version %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR%
echo ~ Launching O3DE %O3DE_PROJECT% project in WingIDE %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR% ...
echo _____________________________________________________________________
echo.
echo O3DE_DEV = %O3DE_DEV%
:: shared location for default O3DE python location
set O3DE_PYTHON_INSTALL=%O3DE_DEV%\Python
echo O3DE_PYTHON_INSTALL = %O3DE_PYTHON_INSTALL%
echo.
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
IF EXIST "%WINGHOME%\bin\wing.exe" (
start "" "%WINGHOME%\bin\wing.exe" "%WING_PROJ%"
) ELSE (
Where wing.exe 2> NUL
IF ERRORLEVEL 1 (
echo wing.exe could not be found
pause
) ELSE (
start "" wing.exe "%WING_PROJ%"
)
)
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,73 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up window
TITLE O3DE DCCsi Launch MayaPy
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Store current directory and change to environment directory so script works in any path.
%~d0
cd %~dp0
PUSHD %~dp0
:: Default Maya and Python version
set MAYA_VERSION=2020
set DCCSI_PY_VERSION_MAJOR=2
set DCCSI_PY_VERSION_MINOR=7
set DCCSI_PY_VERSION_RELEASE=11
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Maya.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_MAYA%
echo.
echo _____________________________________________________________________
echo.
echo ~ Launching O3DE DCCsi MayaPy (%MAYA_VERSION%) ...
echo ________________________________________________________________
echo.
echo MAYA_VERSION = %MAYA_VERSION%
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
echo DCCSI_PY_VERSION_RELEASE = %DCCSI_PY_VERSION_RELEASE%
echo MAYA_LOCATION = %MAYA_LOCATION%
echo MAYA_BIN_PATH = %MAYA_BIN_PATH%
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
SETLOCAL ENABLEDELAYEDEXPANSION
:: Default to the right version of Maya if we can detect it... and launch
IF EXIST "%DCCSI_PY_MAYA%" (
start "" "%DCCSI_PY_MAYA%" %*
) ELSE (
Where maya.exe 2> NUL
IF ERRORLEVEL 1 (
echo Maya.exe could not be found
pause
) ELSE (
start "" Maya.exe %*
)
)
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,99 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Launches Wing IDE and the DccScriptingInterface Project Files
:: Set up window
TITLE O3DE DCCsi Launch WingIDE 7x
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: Constant Vars (Global)
:: global debug (propogates)
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=True)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates debugger connection
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=True)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=10)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_WingIDE.bat
CALL %~dp0\Env_Maya.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ WingIDE Version %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR%
echo ~ Launching O3DE %O3DE_PROJECT% project in WingIDE %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR% ...
echo ~ MayaPy.exe (default python interpreter)
echo _____________________________________________________________________
echo.
echo O3DE_DEV = %O3DE_DEV%
:: shared location for default O3DE python location
set O3DE_PYTHON_INSTALL=%O3DE_DEV%\Python
echo O3DE_PYTHON_INSTALL = %O3DE_PYTHON_INSTALL%
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_IDE = %O3DE_PYTHON_INSTALL%\runtime\python-3.7.10-rev2-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: ide and debugger plug
set DCCSI_PY_BASE=%DCCSI_PY_IDE%\python.exe
echo DCCSI_PY_BASE = %DCCSI_PY_BASE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_MAYA%
echo DCCSI_PY_DEFAULT = %DCCSI_PY_DEFAULT%
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo.
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
IF EXIST "%WINGHOME%\bin\wing.exe" (
start "" "%WINGHOME%\bin\wing.exe" "%WING_PROJ%"
) ELSE (
Where wing.exe 2> NUL
IF ERRORLEVEL 1 (
echo wing.exe could not be found
pause
) ELSE (
start "" wing.exe "%WING_PROJ%"
)
)
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,43 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up and run LY Python CMD prompt
:: Sets up the DccScriptingInterface_Env,
:: Puts you in the CMD within the dev environment
:: Set up window
TITLE O3DE DCCsi Launch pyBase
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
CALL %~dp0\Env_Maya.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
echo Starting: %DCCSI_PY_BASE%
call %DCCSI_PY_BASE% %*
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,46 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Set up and run LY Python CMD prompt
:: Sets up the DccScriptingInterface_Env,
:: Puts you in the CMD within the dev environment
:: Set up window
TITLE O3DE DCCsi pyBase CMD
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Qt.bat
CALL %~dp0\Env_Maya.bat
:: if the user has set up a custom env call it
IF EXIST "%~dp0Env_Dev.bat" CALL %~dp0Env_Dev.bat
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
:: Create command prompt with environment
CALL %windir%\system32\cmd.exe
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE
@@ -0,0 +1,78 @@
"""
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
"""
# -------------------------------------------------------------------------
DccScriptingInterface (DCCsi) is a framework for O3DE extensions, for example:
- Lightweight python integrations with DCC tools like Maya
- O3DE configuration, customization and extensions of tools
- Standalone PySide2/Qt tools
- ^ These might utilize a mix of O3DE and DDC python APIs
The DccScriptingInterface\config.py, procedurally provides a synthetic env context.
This env is a data-driven approach to configuring layered and managed env settings.
This env provides the hooks for DDC apps and/or standalone tools,
to configure acess to O3DE code (for boostrapping), safely retreive known paths, set/get developer flags, etc.
DccScriptingInterface\Tools\Dev\Windows\
This is a .bat file based version of the default env context for development on windows.
This is what we use to boot the default env context such that it is available, when launching a development tool such as a IDE.
This allows a developer to troubleshoot/debug code, like config.py
Other tools, can use config.py to stand up the env context.
What is in this folder ...
Core env modules
---------------------
Env_Core.bat : core access to O3DE and DCCsi
Env_Python.bat : access to O3DE python and general py configuration
Env_Qt.bat : access to O3DE Qt .dll files and PySide2
DCC add on envars
---------------------
Env_Maya.bat : configures Maya with code O3DE/DCCsi access
Env_Substance.bat : Configures Substance Designer
IDE env
---------------------
Env_WingIDE.bat : configures WingIDE for DCCsi development
Env_VScode.bat : configures VScode for DCCsi development
Env_PyCharm.bat : configures PyCharm for DCCsi development
Launchers
---------------------
Launch_env_Cmd.bat : Starts a cmd with entire managed env context
: ^ allows use to validate env
: ^ display all default ENVAR plugs
: ^ allows user to test O3DE python + scripts from cmd
Launch_PyMin_Cmd.bat : Starts minimal cmd with O3DE python access only
: ^ for instance, test Dccsi\config.py like this:
: {DCCsi prommpt}>python config.py
Launch_Maya_2020.bat : Starts Maya2020 within managed env context
Launch_WindIDE-7-1.bat : Starts WingIDE within managed env context
---------------------
Instructions: How to test the synthetic environment and settings externally
1. Run the cmd: Launch_PyMin_Cmd.bat
C:\Depot\o3de-engine\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface>
2. Run command:>python config.py -dm=True -py=True -qt=True
What this does?
- runs the O3DE python exe
- starts the config.py which begins to procedurally create synthetic/dynamic environment (hooks)
- ^ this starts with DCCsi hooks
- enters 'dev mode'(-dm) and attempts to attach debugger (Wing IDE only for now, others planned)
- enables additional O3DE python hooks and code access
- ^ great for standalone tools, but you don't want that functionality to interfer with other DCC tools python environments (like Maya!)
- enables access to O3DE Qt .dlls and PySide2 python package support(-qt)
- ^ great for standalone PySide2 which can operate outside of the O3DE editor
@@ -0,0 +1,25 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: This maps up to the \Dev folder
set O3DE_DEV=..\..\..\..\..\..
:: shared location for default O3DE python location
set O3DE_PYTHON_INSTALL=%O3DE_DEV%\Python
set PY_SITE=%O3DE_PYTHON_INSTALL%\runtime\python-3.7.10-rev2-windows\python\Lib\site-packages
set PACKAGE_LOC=C:\Depot\3rdParty\packages\openimageio-2.1.16.0-rev1-windows\OpenImageIO\2.1.16.0\win_x64\bin
copy %PACKAGE_LOC%\OpenImageIO.pyd %PY_SITE%\OpenImageIO.pyd
@@ -0,0 +1,38 @@
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
-------------------------------------------------------------------------------
We .gitignore the folder .dev:
DccScriptingInterface\Solutions\.dev
Locally we put two things here foor development.
1. pyi inspection files, this makes it easier to add a single folder
to IDE configurations for api inspection and auto-complete
DccScriptingInterface\Solutions\.dev\pyi
DccScriptingInterface\Solutions\.dev\pyi\maya
DccScriptingInterface\Solutions\.dev\pyi\pymel
DccScriptingInterface\Solutions\.dev\pyi\PySide2
etc
2. Pyside2-tools
DccScriptingInterface\Solutions\.dev\QtForPython\pyside2-tools-dev
These are not currently part of the O3DE QtForPython Gem
But they can be valuable for development.
Ticket to include them in O3DE: https://jira.agscollab.com/browse/ATOM-13861
You can manually clone them from here: https://github.com/pyside/pyside2-tools
Note: if you want to use them as a python package
1. you will need to add as a site-package (PYTHONPATH)
2. you will need to rename a file:
this: pyside2-tools/pyside2uic/__init__.py.in
becomes: pyside2-tools/pyside2uic/__init__.py
Some examples are in: DccScriptingInterface\azpy\shared\ui\templates.py
@@ -0,0 +1,7 @@
.dev/*
!.dev/stub
!.dev/readme.txt
!.idea
!.vscode
!.wing
.venv
@@ -0,0 +1,2 @@
# Default ignored files
./workspace.xml
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/..">
<sourceFolder url="file://$MODULE_DIR$/../SDK/Python/Lib/3.x/3.7.x/site-packages" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../azpy" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../.idea" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../3rdParty" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../Code" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../Editor" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../Launchers" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../MockProject" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../SDK" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$" type="java-resource" />
</content>
<orderEntry type="jdk" jdkName="Python 3.7 (Solutions) (2)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyNamespacePackagesService">
<option name="namespacePackageFolders">
<list>
<option value="$MODULE_DIR$/../azpy" />
</list>
</option>
</component>
</module>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
@@ -0,0 +1,27 @@
# -*- 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 sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (Solutions) (2)" project-jdk-type="Python SDK" />
<component name="PyPackaging">
<option name="earlyReleasesAsUpgrades" value="true" />
</component>
</project>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/DccScriptingInterface.iml" filepath="$PROJECT_DIR$/.idea/DccScriptingInterface.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../../../.." vcs="Git" />
</component>
</project>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebResourcesPaths">
<contentEntries>
<entry url="file://$PROJECT_DIR$/..">
<entryData>
<resourceRoots>
<path value="file://$PROJECT_DIR$/../azpy/shared/ui/resources" />
</resourceRoots>
</entryData>
</entry>
</contentEntries>
</component>
</project>
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "..\\.."
}
],
"settings": {
"python.envFile": "${workspaceFolder}/../../.env",
"python.pythonPath": "${env:DCCSI_PY_DEFAULT}"
}
}
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"python": "${workspaceFolder}\\..\\..\\..\\..\\..\\..\\Tools\\Python\\3.7.5\\windows\\python.exe"
}
]
}
@@ -0,0 +1,5 @@
{
"python.envFile": "${workspaceFolder}/../../.env",
"python.pythonPath": "${workspaceFolder}\\..\\..\\..\\..\\..\\..\\Tools\\Python\\3.7.5\\windows\\python.exe",
"editor.wordWrap": "wordWrapColumn"
}
@@ -0,0 +1,77 @@
#!wing
#!version=7.0
##################################################################
# Wing project file #
##################################################################
[project attributes]
debug.launch-configs = (2,
{'launch-0L6se5pxC9AWvpY0': ({'shared': True},
{'buildcmd': ('project',
None),
'env': ('project',
[u'']),
'name': 'DCCSI_PY_IDE',
'pyexec': ('custom',
u'${DCCSI_PY_IDE}'),
'pypath': ('project',
[]),
'pyrunargs': ('project',
'-u'),
'runargs': u'',
'rundir': ('project',
u'')}),
'launch-GeaM41WYMGA1sEfm': ({'shared': True},
{'buildcmd': ('project',
None),
'env': ('custom',
[u'']),
'name': u'DCCSI_PY_MAYA',
'pyexec': ('custom',
u'${DCCSI_PY_MAYA}'),
'pypath': ('project',
[]),
'pyrunargs': ('project',
'-u'),
'runargs': u'',
'rundir': ('project',
u'')}),
'launch-WUN9lgYK6qYU7qE9': ({'shared': True},
{'buildcmd': ('project',
None),
'env': ('custom',
[u'']),
'name': u'DCCSI_PY_BASE',
'pyexec': ('custom',
u'${DCCSI_PY_BASE}'),
'pypath': ('project',
[]),
'pyrunargs': ('project',
'-u'),
'runargs': u'',
'rundir': ('project',
u'')})})
proj.directory-list = [{'dirloc': loc('../../../../..'),
'excludes': (),
'filter': u'*',
'include_hidden': False,
'recursive': True,
'watch_for_changes': True},
{'dirloc': loc('../../../../../../../../Atom/Feature/Common/Editor/Scripts/ColorGrading'),
'excludes': (),
'filter': u'*',
'include_hidden': False,
'recursive': True,
'watch_for_changes': True},
{'dirloc': loc('../../../../../../../../../python'),
'excludes': (),
'filter': u'*',
'include_hidden': False,
'recursive': True,
'watch_for_changes': True}]
proj.file-type = 'shared'
proj.launch-config = {loc('../../../../../azpy/core/py2/utils.py'): ('custom',
(u'',
'launch-0L6se5pxC9AWvpY0')),
loc('../../../../../azpy/core/py3/utils.py'): ('custom',
(u'',
'launch-0L6se5pxC9AWvpY0'))}
@@ -0,0 +1,12 @@
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
-------------------------------------------------------------------------------
We .gitignore the folder .dev:
DccScriptingInterface\Solutions\.dev
The user can create this folder locally.
We use it to store .pyi files to add to IDE configurations
for api inspection and auto-complete functionality
@@ -0,0 +1,9 @@
"""
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 folder resprents a Mock Tool - currently just a scaffold (not implemented)
@@ -0,0 +1,9 @@
"""
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 folder is for tool resources - this file is a resource stub.
@@ -0,0 +1,12 @@
# 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
#
#
# -------------------------------------------------------------------------
print('Not Implemented')
@@ -0,0 +1,12 @@
# 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
#
#
# -------------------------------------------------------------------------
print('Not Implemented')
@@ -0,0 +1,17 @@
{
"default": {
"DCCSI_GDEBUG": true,
"SPDX-LICENSE-IDENTIFIER": "Apache-2.0 OR MIT",
"COPYWRITE":"Copyright (c) Contributors to the Open 3D Engine Project.",
"COPYWRITE_MSG":"For complete copyright and license terms please see the LICENSE at the root of this distribution."
},
"development": {
"DCCSI_GDEBUG": true,
"TEST_RULE": "/dccsi_with_json",
"MESSAGE": "The O3DE DCCsi manages dynamic configuration and settings with dynaconf",
"DYNACONF_HELP": "https://dynaconf.readthedocs.io/"
},
"production": {
"DCCSI_GDEBUG": false
}
}
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c34bbeafae5c5b62d3571ac9eee295fff12ac0744f81375f53a3faf2c5095e4
size 286400
@@ -0,0 +1,66 @@
# 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 line is 75 characters -------------------------------------------
import OpenImageIO as oiio
def convert(src):
try:
rgba = oiio.ImageBuf(src)
spec = get_image_spec(rgba)
# Normal output ------>
rgb = oiio.ImageBufAlgo.channels(rgba, (0, 1, 2))
normal_output = src.replace('ddna', 'Normal')
# Roughness output ------>
alpha = oiio.ImageBufAlgo.channels(rgba, (3,))
roughness = oiio.ImageBufAlgo.invert(alpha)
roughness_output = normal_output.replace('Normal', 'Roughness')
write_image(rgba, normal_output, spec['format'])
write_image(roughness, roughness_output, spec['format'])
# logging.info('Output Normal Map: {}'.format(normal_output))
# logging.info('Output Roughness Map: {}'.format(roughness_output))
except Exception as e:
logging.info('OIIO error in image conversion: {}'.format(e))
return None
def get_image_spec(target_image):
spec = target_image.spec()
info = {'resolution': (spec.width, spec.height, spec.x, spec.y), 'channels': spec.channelnames,
'format': str(spec.format)}
if spec.channelformats :
info['channelformats'] = str(spec.channelformats)
info['alpha channel'] = str(spec.alpha_channel)
info['z channel'] = str(spec.z_channel)
info['deep'] = str(spec.deep)
for i in range(len(spec.extra_attribs)):
if type(spec.extra_attribs[i].value) == str:
info[spec.extra_attribs[i].name] = spec.extra_attribs[i].value
else:
info[spec.extra_attribs[i].name] = spec.extra_attribs[i].value
return info
def write_image(image, filename, image_format):
if not image.has_error:
image.set_write_format(image_format)
image.write(filename)
if image.has_error:
print("Error writing", filename, ":", image.geterror())
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
# run a test
convert('AA_Gun_01_ddna.tif')
# validate()
@@ -0,0 +1,47 @@
{
"description": "",
"materialType": "Materials/Types/StandardPBR.materialtype",
"parentMaterial": "",
"propertyLayoutVersion": 3,
"properties": {
"general": {
"texcoord": 0
},
"baseColor": {
"colorLinear": [ 1.0, 1.0, 1.0 ],
"factor": 1.0,
"useTexture": true,
"textureMap": "EngineAssets/TextureMsg/DefaultNoUVs.tif"
},
"metallic": {
"factor": 0.0,
"useTexture": false,
"textureMap": ""
},
"roughness": {
"factor": 1.0,
"useTexture": true,
"textureMap": "EngineAssets/TextureMsg/DefaultNoUVs_spec.tif"
},
"specularF0": {
"factor": 0.5,
"useTexture": false,
"textureMap": ""
},
"normal": {
"factor": 1.0,
"useTexture": true,
"textureMap": "EngineAssets/TextureMsg/DefaultNoUVs_ddn.tif"
},
"opacity": {
"doubleSided": false,
"factor": 1.0,
"cutoutAlpha": false,
"cutoutThreshold": 0.5,
"useBaseColorTextureAlpha": false,
"useTexture": false,
"textureMap": ""
}
}
}
@@ -0,0 +1,21 @@
"""
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
"""
# -------------------------------------------------------------------------
"""DCCsi Tool and Application service launcher"""
def start_service():
"""Not Implemented"""
print('DCCsi.Tools.DCC.start_service() not implemented')
return None
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
start_service()