Skip to content

Commit

Permalink
Thirs Release
Browse files Browse the repository at this point in the history
  • Loading branch information
melMass committed Jul 9, 2021
1 parent 522b3ae commit af05565
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 42 deletions.
75 changes: 36 additions & 39 deletions W_hotbox.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#----------------------------------------------------------------------------------------------------------
# Wouter Gilsing
# [email protected]
# 28 August 2016
# v1.1
# 29 August 2016
# v1.2
#----------------------------------------------------------------------------------------------------------

import nuke
Expand All @@ -15,41 +15,8 @@

import colorsys

#----------------------------------------------------------------------------------------------------------
#
# USER SETTINGS TO MAKE THE HOTBOX FUNCTION PROPERLY IN A STUDIO ENVIRONMENT
#
#----------------------------------------------------------------------------------------------------------
'''
When enabled, users are able to change the location of the Hotbox Manager icons. In a studio environment,
this can be unwanted. Change to False to hide the knob.
'''

enableChangeableIconLocation = True

'''
For a studio environment it can be useful to be able to setup multiple repositories to load buttons from,
rather than having only one. Think of a show specific set of buttons, or facility wide, or both.
Make sure to point the path to the folder containing the 'All','Multiple' and 'Single' folder, and to end the
filepath with a '/'. Also, make sure to always use '/' rather than '\\'. All repositories should be named
uniquely.
'''

extraRepositories = []
#extraRepositories.append(['NAME','/path/to/extra/repository/W_hotbox/'])

'''
For example, this will add two extra repositories:
extraRepositories.append(['SHOW','server/shows/nuke/repository/W_hotbox/'])
extraRepositories.append(['FACILITY','server/tools/nuke/repository/W_hotbox/'])
'''

#----------------------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------------------------------


class hotbox(QtGui.QWidget):
'''
The main class for the hotbox
Expand Down Expand Up @@ -236,7 +203,7 @@ def __init__(self, mode, allItems = ''):
if self.path[-1] != '/':
self.path = self.path + '/'

self.allRepositories = list(set([self.path]+[i[1].replace('\\','/') for i in extraRepositories]))
self.allRepositories = list(set([self.path]+[i[1] for i in extraRepositories]))

self.rowMaxAmount = int(preferencesNode.knob('hotboxRowAmountAll').value())

Expand Down Expand Up @@ -714,10 +681,12 @@ def addPreferences():
except:
pass

#hide the iconLocation knob if defined so at the top of the script (line 28)
#hide the iconLocation knob if environment varible called 'W_HOTBOX_HIDE_ICON_LOC' is set to 'true' or '1'
preferencesNode.knob('iconLocation').setVisible(True)
if not enableChangeableIconLocation:
preferencesNode.knob('iconLocation').setVisible(False)
if 'W_HOTBOX_HIDE_ICON_LOC' in os.environ.keys():
if os.environ['W_HOTBOX_HIDE_ICON_LOC'].lower() in ['true','1']:
preferencesNode.knob('iconLocation').setVisible(False)

#----------------------------------------------------------------------------------------------------------
#Color
#----------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -840,6 +809,33 @@ def getFileBrowser():

#----------------------------------------------------------------------------------------------------------

#check for environment variables to add extra repositories
'''
NUKE_HOTBOX_REPO_PATHS=/path1:/path2:/path3
NUKE_HOTBOX_REPO_NAMES=name1:name2:name3
'''

extraRepositories = []

if 'W_HOTBOX_REPO_PATHS' in os.environ and 'W_HOTBOX_REPO_NAMES' in os.environ.keys():

extraRepositoriesPaths = os.environ['W_HOTBOX_REPO_PATHS'].split(os.pathsep)
extraRepositoriesNames = os.environ['W_HOTBOX_REPO_NAMES'].split(os.pathsep)

for index, i in enumerate(range(min(len(extraRepositoriesPaths),len(extraRepositoriesNames)))):
path = extraRepositoriesPaths[index].replace('\\','/')

#make sure last character is a '/'
if path[-1] != '/':
path += '/'

name = extraRepositoriesNames[index]
if name not in [i[0] for i in extraRepositories] and path not in [i[1] for i in extraRepositories]:
extraRepositories.append([name,path])

#----------------------------------------------------------------------------------------------------------


preferencesNode = nuke.toNode('preferences')
addPreferences()

Expand All @@ -849,6 +845,7 @@ def getFileBrowser():
lastPosition = ''

#----------------------------------------------------------------------------------------------------------
#add menu items

nuke.menu('Nuke').addCommand('Edit/W_hotbox/Open W_hotbox',showHotbox, shortcut)
nuke.menu('Nuke').addCommand('Edit/W_hotbox/Open Hotbox Manager', 'W_hotboxManager.showHotboxManager()')
Expand Down
8 changes: 5 additions & 3 deletions W_hotboxManager.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#----------------------------------------------------------------------------------------------------------
# Wouter Gilsing
# [email protected]
version = '1.1'
releaseDate = '28 August 2016'
version = '1.2'
releaseDate = '29 August 2016'
#----------------------------------------------------------------------------------------------------------

from PySide import QtGui, QtCore
Expand Down Expand Up @@ -1244,7 +1244,9 @@ def __init__(self):
self.setFixedWidth(230)

aboutHotbox = QtGui.QLabel()
aboutHotbox.setPixmap(QtGui.QPixmap(preferencesNode.knob('iconLocation').value() + '/icon.png'))
aboutIcon = preferencesNode.knob('iconLocation').value().replace('\\','/') + '/icon.png'
aboutIcon = aboutIcon.replace('//icon.png','/icon.png')
aboutHotbox.setPixmap(QtGui.QPixmap(aboutIcon))

aboutVersion = QtGui.QLabel(version)
aboutDate = QtGui.QLabel(releaseDate)
Expand Down
Binary file not shown.
Binary file modified buttonBundle.hotbox
Binary file not shown.

0 comments on commit af05565

Please sign in to comment.