Skip to content

Commit

Permalink
Nuke add with gizmo mod
Browse files Browse the repository at this point in the history
added project folder structure
mod img
fixed user, arDesktop
added tank props
  • Loading branch information
alexanderrichter committed Jun 29, 2017
1 parent 8a06376 commit 806d562
Show file tree
Hide file tree
Showing 97 changed files with 286 additions and 195 deletions.
2 changes: 1 addition & 1 deletion data/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def set_pipeline_env(self):
self.add_env('PYTHONPATH', os.environ['IMG_PATH'])
self.add_env('PYTHONPATH', os.environ['UTILS_PATH'])
self.add_env('PYTHONPATH', os.environ['CLASSES_PATH'])
self.add_env('PYTHONPATH', os.environ['SOFTWARE_PATH'] )
# self.add_env('PYTHONPATH', os.environ['SOFTWARE_PATH'])

import libLog
LOG = libLog.init(script=TITLE)
Expand Down
1 change: 1 addition & 0 deletions data/project/default/folder_template/00_pipeline/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/05_user/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/20_footage/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/30_assets/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/40_shots/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/45_render/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/50_post/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/50_post/mov/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
1 change: 1 addition & 0 deletions data/project/default/folder_template/60_planning/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
18 changes: 17 additions & 1 deletion data/project/default/software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MAYA:

ENV: # Added BEFORE software start
PYTHONPATH:
- !env_first [SOFTWARE_PATH]
- !env_first [SOFTWARE_PATH, /scripts]
- !env_first [SOFTWARE_PATH, /plugins]
- !env_first [SOFTWARE_PATH, /shelf]
Expand Down Expand Up @@ -64,13 +65,18 @@ MAYA:
# NUKE
NUKE:
version: &NUKE_VERSION 10.5
version_long: &NUKE_VERSION_LONG !join [*NUKE_VERSION, v2]
version_long: &NUKE_VERSION_LONG !join [*NUKE_VERSION, v1]

start: !join ['start "" Nuke', *NUKE_VERSION ,'.exe --nukex "{}"']

path: !join ["C:/Program Files/Nuke", *NUKE_VERSION_LONG,/Nuke, *NUKE_VERSION, .exe]

ENV:
PYTHONPATH:
- !env_first [SOFTWARE_PATH, /scripts]
- !env_first [SOFTWARE_PATH, /plugins]
- !env_first [SOFTWARE_PATH, /shelf]

NUKE_PATH:
- !env [PIPELINE_PATH]
- !env [SOFTWARE_PATH]
Expand Down Expand Up @@ -114,3 +120,13 @@ HOUDINI:

renderer:
renderer_path:


RV:
version:
path: "C:/Program Files/Tweak/RV/bin/rv.exe"

start:

renderer:
renderer_path:
Binary file added img/btn/btnFolder48c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified img/software/maya/MayaEDUStartupImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified img/software/nuke/nuke_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file not shown.
17 changes: 13 additions & 4 deletions lib/classes/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ def add_env(self):

#************************
# SOFTWARE
def start(self, open_file=''):
def start(self, software='', open_file=''):
if software: self.setup(software)
self.add_env()

cmd = self._software_data['start'].format(open_file)
if self._software == 'maya' and not open_file:
cmd = cmd.split('-file')[0]
LOG.debug(cmd)
subprocess.Popen(cmd, shell=True, env=os.environ)

Expand Down Expand Up @@ -136,17 +139,24 @@ def add_menu(self, menu_node, new_command):
continue
self.add_menu(sub_menu, item)
else:
eval('menu_node.{}'.format(item))
if self._software == 'maya':
import maya.cmds as cmds
cmd = ('cmds.{}'.format(item)).format(menu_node)
LOG.debug(cmd)
eval(cmd)
if self._software == 'nuke':
eval('menu_node.{}'.format(item))

def print_header(self):
space = (20-int(len(os.getenv('PROJECT_NAME'))/2)) - 1

# project name & user namse
# project name
print('')
print(chr(218) + chr(196)*38 + chr(191))
print(chr(179) + ' '*space + os.getenv('PROJECT_NAME') + ' '*space + chr(179))
print(chr(192) + chr(196)*38 + chr(217))

# user name
print ('\n' + ' '*12 + 'Welcome ' + getpass.getuser() + '\n')

print('PATHS')
Expand All @@ -163,7 +173,6 @@ def print_header(self):
if self._software == 'nuke':
print(' {} ON - software/{}/gizmos'.format(chr(254), self._software))


print('') # ********************

print('SCRIPTS')
Expand Down
9 changes: 8 additions & 1 deletion lib/classes/tank.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

import os

import libData

from users import User
from software import Software
from context import Context
Expand All @@ -13,7 +15,8 @@ class Tank(Singleton):
def init_os(self):
# self._notificator = Notificator()
# self._notificator.setup()
pass
self._user = User()
self._user.setup()


def init_software(self):
Expand All @@ -39,3 +42,7 @@ def user(self):
@property
def context(self):
return self._context

@property
def data(self):
return libData.get_data()
5 changes: 3 additions & 2 deletions lib/classes/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
LOG = libLog.init(script=TITLE)

class User(Singleton):
def setup(user_id):
def setup(self, user_id=os.getenv('username')):
# get user data and set
# if not create create
pass
self.create()


def create(self, user_id=os.getenv('username'), name=os.getenv('username'), settings = {}, rights = 'artist'):
self._id = user_id # arichter
Expand Down
31 changes: 16 additions & 15 deletions lib/utils/arDesktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import libLog
import libData
import libFunc
from tank import Tank
from software import Software

TITLE = os.path.splitext(os.path.basename(__file__))[0]
Expand All @@ -33,15 +34,16 @@
class SystemTrayIcon(QtGui.QSystemTrayIcon):

def __init__(self, parent=None):
Tank().init_os()
QtGui.QSystemTrayIcon.__init__(self, parent)
#self.activated.connect(self.showMainWidget)
self.setIcon(QtGui.QIcon(libData.get_img_path('program/default')))
self.setIcon(QtGui.QIcon(libData.get_img_path('software/default')))

self.user = Tank().user
self.parent = parent
menu = QtGui.QMenu()
self.user = users.User()
menu = QtGui.QMenu()

self.config_data = libData.get_data()
self.config_data = Tank().data
menu.setStyleSheet(self.config_data['style']['arDesktop']['menu'])

# ADMIN UI
Expand Down Expand Up @@ -79,11 +81,11 @@ def __init__(self, parent=None):
subMenu.setStyleSheet(self.config_data['style']['arDesktop']['menu'])
menu.addMenu(subMenu)

menuItem = subMenu.addAction(QtGui.QIcon(libData.get_img_path('program/maya')), 'Maya')
menuItem = subMenu.addAction(QtGui.QIcon(libData.get_img_path('software/maya')), 'Maya')
QtCore.QObject.connect(menuItem, QtCore.SIGNAL('triggered()'), self.press_btnOpenMaya)
menuItem = subMenu.addAction(QtGui.QIcon(libData.get_img_path('program/nuke')), 'Nuke')
menuItem = subMenu.addAction(QtGui.QIcon(libData.get_img_path('software/nuke')), 'Nuke')
QtCore.QObject.connect(menuItem, QtCore.SIGNAL('triggered()'), self.press_btnOpenNuke)
# menuItem = subMenu.addAction(QtGui.QIcon(libData.get_img_path('program/houdini')), 'Houdini')
# menuItem = subMenu.addAction(QtGui.QIcon(libData.get_img_path('software/houdini')), 'Houdini')
# QtCore.QObject.connect(menuItem, QtCore.SIGNAL('triggered()'), self.press_btnOpenHoudini)

menu.addSeparator()
Expand Down Expand Up @@ -112,35 +114,34 @@ def startArNotificator(self):
# PRESS_TRIGGER
def press_btnShowUserData(self):
LOG.debug('showUserData')
webbrowser.open(libData.getEnv('PROJECT_USER_PATH'))
webbrowser.open(libData.get_env('PROJECT_USER_PATH'))

def press_btnOpenProjectPath(self):
LOG.debug('openProjectPath')
webbrowser.open(libData.getEnv('PROJECT_PATH'))
webbrowser.open(libData.get_env('PROJECT_PATH'))
#------------------------------
def press_btnProject(self):
import arProject
arProject.start()
#------------------------------
def press_btnOpenMaya(self):
LOG.debug('Maya')
Software('maya').start_software()
Software().start('maya')

def press_btnOpenNuke(self):
LOG.debug('Nuke')
Software('nuke').start_software()

Software().start('nuke')

def press_btnOpenHoudini(self):
LOG.debug('Houdini')
Software().start_software()
Software().start('houdini')

#------------------------------
def press_btnOpenProjectLog(self):
webbrowser.open(libData.getEnv('DATA_PROJECT_PATH'))
webbrowser.open(libData.get_env('DATA_PROJECT_PATH'))

def press_btnOpenLocalLog(self):
webbrowser.open(libData.getEnv('DATA_USER_PATH'))
webbrowser.open(libData.get_env('DATA_USER_PATH'))

def press_btnWriteReminder(self):
LOG.debug('writeReminder')
Expand Down
8 changes: 4 additions & 4 deletions software/maya/userSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
import maya.cmds as cmds

import libLog
from software import Software
from tank import Tank

TITLE = os.path.splitext(os.path.basename(__file__))[0]
TITLE = 'userSetup' # os.path.splitext(os.path.basename(__file__))[0]
LOG = libLog.init(script=TITLE)


#************************
# PRINT CONSOLE
Software.print_header()
Tank().init_software()

print ""

print "MENU"
try:
cmds.evalDeferred("from scripts import menu\nmenu.arMenuLoad()")
cmds.evalDeferred("from scripts import menu\nmenu.load_menu()")
print " ON - menu"
print " ON - shelf"
except:
Expand Down
Loading

0 comments on commit 806d562

Please sign in to comment.