Created
November 17, 2014 17:33
-
-
Save mclavan/af02ba7d390fbb48a87e to your computer and use it in GitHub Desktop.
Establishing an icons folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
controls.py | |
Michael Clavan | |
import controls | |
reload(controls) | |
''' | |
import pymel.core as pm | |
print 'Control Icons Interface' | |
import os # os.path | |
def icon_path_finder(): | |
# '/Users/mclavan/Library/Preferences/Autodesk/maya/scripts' | |
file_path = os.path.split(__file__)[0] | |
global icon_path | |
icon_path = os.path.join(file_path, 'icons') | |
print 'Icon path established.' | |
''' | |
icons | |
arrowsToget.png | |
mark.png | |
plus.png | |
image=os.path.join(icon_path, 'arrowsToget.png') | |
''' | |
def load_icon(icon): | |
return os.path.join(icon_path, icon) | |
def gui(): | |
''' | |
import controls | |
controls.gui() | |
''' | |
win_name = 'mecControlWin' | |
if pm.window(win_name, ex=True): | |
pm.deleteUI(win_name) | |
global win_object | |
win_object = pm.window('mecControlWin', w=100, h=300) | |
main_layout = pm.columnLayout() | |
pm.rowColumnLayout(nc=2, cw=[[1, 52],[2, 52]]) | |
pm.symbolButton(w=52, h=36, image=load_icon('arrowsToget.png')) | |
pm.symbolButton(w=52, h=36, image=load_icon('mark.png')) | |
pm.symbolButton(w=52, h=36, image=load_icon('plus.png')) | |
pm.symbolButton(w=52, h=36, image=load_icon('arrowsToget.png')) | |
win_object.show() | |
print 'Interface Loaded' | |
icon_path_finder() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment