コード例 #1
0
ファイル: lcBatchBake.py プロジェクト: kotchin/mayaSettings
def lcBake_open_lightmap_folder(*args, **kwargs):
  ''' '''
  dir = pm.textField(prefix+'_textField_texture_path', query=True, text=True)
  lightmapDir = os.path.normpath(os.path.join(dir, 'lightMap'))
  if os.path.exists(lightmapDir):
    path.openFilePath(lightmapDir)
  elif os.path.exists(dir):
    path.openFilePath(dir)
  else:
    pm.warning('Path not found: {0}'.format(dir) )
コード例 #2
0
def lcBake_open_lightmap_folder(*args, **kwargs):
    ''' '''
    dir = pm.textField(prefix + '_textField_texture_path',
                       query=True,
                       text=True)
    lightmapDir = os.path.normpath(os.path.join(dir, 'lightMap'))
    if os.path.exists(lightmapDir):
        path.openFilePath(lightmapDir)
    elif os.path.exists(dir):
        path.openFilePath(dir)
    else:
        pm.warning('Path not found: {0}'.format(dir))
コード例 #3
0
ファイル: lcTexture.py プロジェクト: kotchin/mayaSettings
 def openTextureList(cls, texList, *args, **kwargs): 
   ''' open a list of file nodes in default program ie. photoshop '''
   for item in texList:
     texPath = pm.getAttr(item+'.fileTextureName')
     path.openFilePath(texPath)
コード例 #4
0
def lcObjToolsUI(dockable=False, *args, **kwargs):
    ''' '''
    global prefix
    ci = 0  #color index iterator
    windowName = 'lcObjTools'
    shelfCommand = 'import lct.src.lcObjTools.lcObjTools as lcObj\nreload(lcObj)\nlcObj.lcObjToolsUI()'
    icon = basePath + 'lcObjTools.png'
    winWidth = 204
    winHeight = 158

    mainWindow = lcWindow(windowName=windowName,
                          width=winWidth,
                          height=winHeight,
                          icon=icon,
                          shelfCommand=shelfCommand,
                          annotation=annotation,
                          dockable=dockable,
                          menuBar=True)
    mainWindow.create()

    #
    pm.columnLayout(prefix + '_columLayout_main')

    #
    pm.rowColumnLayout(nc=2, cw=([1, 150], [2, 50]))
    pm.textField(prefix + '_textField_export_path', w=150)
    pm.button(prefix + '_button_browse_path',
              l='Browse',
              bgc=colorWheel.getColorRGB(ci),
              annotation='Choose an export directory',
              w=50,
              command=lambda *args: path.browsePathTextField(
                  prefix + '_textField_export_path', "Wavefront Obj (*.obj)",
                  'Obj Export Location'))
    ci += 1
    pm.setParent(prefix + '_columLayout_main')

    #
    pm.checkBox(prefix + '_checkBox_export_indi',
                l='Export Individual',
                v=False)
    pm.checkBox(prefix + '_checkBox_use_smooth',
                l='Use Smooth Preview',
                v=True)

    #
    pm.rowColumnLayout(nc=2, cw=([1, 100], [2, 100]))
    pm.textField(prefix + '_textField_prefix', w=100)
    pm.text(l='   Prefix_', al='left')
    pm.setParent(prefix + '_columLayout_main')

    #
    pm.rowColumnLayout(nc=2, cw=([1, 169], [2, 31]))
    pm.columnLayout(w=169)
    pm.button(prefix + '_button_export',
              l='Export OBJ',
              bgc=colorWheel.getColorRGB(ci),
              annotation='Export the selected geometry',
              w=168,
              h=30,
              command=lambda *args: lcObj_exportObjs())
    ci += 1
    pm.button(prefix + '_button_Import',
              l='Import Multiple OBJs',
              bgc=colorWheel.getColorRGB(ci),
              annotation='Clean import more than one obj',
              w=168,
              h=20,
              command=lambda *args: lcObj_importMultiple())
    ci += 1
    pm.setParent('..')
    pm.columnLayout(w=31)
    pm.iconTextButton(
        prefix + '_button_open_folder',
        style='iconOnly',
        image=iconBasePath + 'folder_30x50.png',
        annotation='Open the export folder',
        w=30,
        h=50,
        command=lambda *args: path.openFilePath(
            pm.textField(
                prefix + '_textField_export_path', query=True, text=True)))
    ci += 1

    #
    mainWindow.show()

    plugin.reloadPlugin(plugin='objExport', autoload=True)
コード例 #5
0
ファイル: lcObjTools.py プロジェクト: kotchin/mayaSettings
def lcObjToolsUI(dockable=False, *args, **kwargs):
  ''' '''
  global prefix
  ci = 0 #color index iterator
  windowName = 'lcObjTools'
  shelfCommand = 'import lct.src.lcObjTools.lcObjTools as lcObj\nreload(lcObj)\nlcObj.lcObjToolsUI()'
  icon = basePath+'lcObjTools.png'
  winWidth  = 204
  winHeight = 158
  
  mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True)
  mainWindow.create()

  #
  pm.columnLayout(prefix+'_columLayout_main')

  #
  pm.rowColumnLayout(nc=2, cw=([1,150], [2,50]) )
  pm.textField(prefix+'_textField_export_path', w=150)
  pm.button(prefix+'_button_browse_path', l='Browse', bgc=colorWheel.getColorRGB(ci), annotation='Choose an export directory', w=50, command=lambda *args: path.browsePathTextField(prefix+'_textField_export_path', "Wavefront Obj (*.obj)", 'Obj Export Location') )
  ci+=1
  pm.setParent(prefix+'_columLayout_main')

  #
  pm.checkBox(prefix+'_checkBox_export_indi', l='Export Individual', v=False)
  pm.checkBox(prefix+'_checkBox_use_smooth', l='Use Smooth Preview', v=True)

  #
  pm.rowColumnLayout(nc=2, cw=([1,100], [2,100]) )
  pm.textField(prefix+'_textField_prefix', w=100)
  pm.text(l='   Prefix_', al='left')
  pm.setParent(prefix+'_columLayout_main')

  #
  pm.rowColumnLayout(nc=2, cw=([1,169], [2,31]) )
  pm.columnLayout(w=169)
  pm.button(prefix+'_button_export', l='Export OBJ', bgc=colorWheel.getColorRGB(ci), annotation='Export the selected geometry', w=168, h=30, command=lambda *args: lcObj_exportObjs() )
  ci+=1
  pm.button(prefix+'_button_Import', l='Import Multiple OBJs', bgc=colorWheel.getColorRGB(ci), annotation='Clean import more than one obj', w=168, h=20, command=lambda *args: lcObj_importMultiple() )
  ci+=1
  pm.setParent('..')
  pm.columnLayout(w=31)
  pm.iconTextButton(prefix+'_button_open_folder', style='iconOnly', image=iconBasePath+'folder_30x50.png', annotation='Open the export folder', w=30, h=50, command=lambda *args: path.openFilePath(pm.textField(prefix+'_textField_export_path', query=True, text=True) ) )
  ci+=1
  
  #
  mainWindow.show()
  
  plugin.reloadPlugin(plugin='objExport', autoload=True)
コード例 #6
0
 def openTextureList(cls, texList, *args, **kwargs):
     ''' open a list of file nodes in default program ie. photoshop '''
     for item in texList:
         texPath = pm.getAttr(item + '.fileTextureName')
         path.openFilePath(texPath)