def lcTextureToolsUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcTextureTools' shelfCommand = 'import lct.src.lcTextureTools.lcTextureTools as lcTxT\nreload(lcTxT)\nlcTxT.lcTextureToolsUI()' icon = basePath+'lcTextureTools.png' winWidth = 204 winHeight = 174 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=1, cw=([1,201]) ) pm.iconTextButton(w=200, h=25, style='iconOnly', image=iconBasePath+'renameNodes.png', annotation='Renames all file nodes based on the attached file name with a tx_ suffix', command=lambda *args: texture.renameAllTextureNodes() ) pm.setParent('..') pm.separator(style='in', h=5) # pm.rowColumnLayout(nc=2, cw=([1,100], [2,100]) ) pm.rowColumnLayout(nc=2, cw=([1,75], [2,25]) ) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath+'reloadAll.png', annotation='Reloads all the file texture nodes', command=lambda *args: texture.reloadTextures() ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'addToShelf.png', highlightImage=iconBasePath+'addToShelf_over.png', annotation='Add to Shelf', command=lambda *args: shelf.makeShelfButton('Reload Textures', 'from lct.src.core.lcTexture import Texture as texture\ntexture().reloadTextures()', iconBasePath+'reloadAllTextures.png', 'Reload All Textures') ) pm.setParent('..') pm.rowColumnLayout(nc=2, cw=([1,75], [2,25]) ) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath+'reloadChanged.png', annotation='Reloads only the changed file texture nodes based on timestamp', command=lambda *args: texture().reloadChangedTextures() ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'addToShelf.png', highlightImage=iconBasePath+'addToShelf_over.png', annotation='Add to Shelf', command=lambda *args: shelf.makeShelfButton('Reload Changed Textures', 'from lct.src.core.lcTexture import Texture as texture\ntexture().reloadChangedTextures()', iconBasePath+'reloadChangedTextures.png', 'Reload Changed Textures') ) pm.setParent('..') pm.setParent(prefix+'_columLayout_main') pm.separator(style='in', h=5) # pm.rowColumnLayout(nc=2, cw=([1,150], [2,50]) ) pm.textField(prefix+'_textField_new_path', w=150) pm.button(prefix+'_button_browse_path', l='Browse', bgc=colorWheel.getColorRGB(ci), annotation='Choose a new directory', w=50, command=lambda *args: path.browsePathTextField(prefix+'_textField_new_path', '', 'Browse New Texture Directory') ) ci+=1 pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,100], [2,100]) ) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath+'pathAll.png', annotation='Repath all file texture nodes', command=lambda *args: lcTxT_repath_all() ) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath+'pathSelected.png', annotation='Repath selected file texture nodes', command=lambda *args: lcTxT_repath_selected() ) pm.setParent(prefix+'_columLayout_main') pm.separator(style='in', h=5) # pm.rowColumnLayout(nc=2, cw=([1,100], [2,100]) ) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath+'openAll.png', annotation='Open all file texture nodes in default associated program', command=lambda *args: lcTxT_open_all() ) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath+'openSelected.png', annotation='Open selected file texture nodes in default associated program', command=lambda *args: lcTxT_open_selected() ) pm.setParent(prefix+'_columLayout_main') pm.separator(style='in', h=5) # mainWindow.show()
def lcCameraToolsUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcCameraTools' shelfCommand = 'import lct.src.lcCameraTools.lcCameraTools as lcCam\nreload(lcCam)\nlcCam.lcCameraToolsUI()' icon = basePath+'lcCameraTools.png' winWidth = 204 winHeight = 209 mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True) mainWindow.create() pm.menu(l='Options', helpMenu=True) pm.menuItem(l='Reset Gradient Colors', command=lambda *args: cam_set_default_colors() ) # pm.columnLayout(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,50], [2,150]) ) pm.text(l='Edit:', al='right') cameraListDropdown = pm.optionMenu(prefix+'_optionMenu_camera_list', bgc=colorWheel.getColorRGB(ci), w=150, h=25 ) ci+=1 cameraListDropdown.changeCommand(lambda *args: cam_get_cam_attrs(cameraListDropdown) ) pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,125], [2,75]) ) pm.text(l='Focal Length:', al='right') pm.floatField(prefix+'_floatField_focal_length', min=0.0, v=0.0, pre=1, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.text(l='Near Clip Plane:', al='right') pm.floatField(prefix+'_floatField_near_clip_plane', min=0.0, v=0.0, pre=4, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.text(l='Far Clip Plane:', al='right') pm.floatField(prefix+'_floatField_far_clip_plane', min=0.0, v=0.0, pre=0, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.text(l='Overscan:', al='right') pm.floatField(prefix+'_floatField_overscan', min=0.0, v=0.0, pre=3, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.text(l='Background Color:', al='right') pm.colorSliderGrp(prefix+'_colorSliderGrp_background_color', cw1=50, rgb=(0.0,0.0,0.0), changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.text(l='Gradient Top:', al='right') pm.colorSliderGrp(prefix+'_colorSliderGrp_gradient_top', cw1=50, rgb=(0.54,0.62,0.70), changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.text(l='Gradient Bottom:', al='right') pm.colorSliderGrp(prefix+'_colorSliderGrp_gradient_bottom', cw1=50, rgb=(0.1,0.1,0.1), changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) ) pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,175], [2,25]) ) pm.button(prefix+'_button_toggle_bkgd', l='Toggle Background', bgc=colorWheel.getColorRGB(ci), w=200, h=25, annotation='Toggle between flat color and gradient background', command=lambda *args: camera.toggleBackground() ) ci+=1 pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'addToShelf.png', highlightImage=iconBasePath+'addToShelf_over.png', annotation='Add to Shelf', command=lambda *args: shelf.makeShelfButton('Toggle Camera Background', 'from lct.src.core.lcUtility import Camera as camera\ncamera.toggleBackground()', iconBasePath+'toggleBackground.png', "Toggle Camera's Viewport Background") ) # mainWindow.show() cam_populate_camera_list(cameraListDropdown) cam_get_cam_attrs(cameraListDropdown)
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)
def lcMoveImagePlaneUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcMoveImagePlane' shelfCommand = 'import lct.src.lcMoveImagePlane.lcMoveImagePlane as lcMIP\nreload(lcMIP)\nlcMIP.lcMoveImagePlaneUI()' icon = basePath+'lcMoveImagePlane.png' winWidth = 204 winHeight = 103 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=3, cw=([1,66], [2,66], [3,66] ) ) pm.button(l='Front', bgc=colorWheel.getColorRGB(ci), w=66, h=25, annotation='Create an image plane for the front camera', command=lambda *args: mip_make_image_plane('front', imageListDropdown) ) ci+=1 pm.button(l='Side', bgc=colorWheel.getColorRGB(ci), w=66, h=25, annotation='Create an image plane for the side camera', command=lambda *args: mip_make_image_plane('side', imageListDropdown) ) ci+=1 pm.button(l='Top', bgc=colorWheel.getColorRGB(ci), w=66, h=25, annotation='Create an image plane for the top camera', command=lambda *args: mip_make_image_plane('top', imageListDropdown) ) ci+=1 pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,25], [2,175]) ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'reloadList.png', annotation='Reload the image planes list', command=lambda *args: mip_populate_image_list(imageListDropdown) ) imageListDropdown = pm.optionMenu(prefix+'_optionMenu_image_plane_list', w=175, h=25, annotation='List of orthographic image planes' ) pm.setParent(prefix+'_columLayout_main') # pm.button(l='Make Image Plane Move Control', bgc=colorWheel.getColorRGB(ci), w=200, h=25, annotation='Create control curve for image plane from drop down list', command=lambda *args: mip_make_ctrl(imageListDropdown) ) ci+=1 # mainWindow.show() mip_populate_image_list(imageListDropdown)
def lcHideByTokenUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcHideByToken' shelfCommand = 'import lct.src.lcHideByToken.lcHideByToken as lcHbT\nreload(lcHbT)\nlcHbT.lcHideByTokenUI()' icon = basePath+'lcHideByToken.png' winWidth = 204 winHeight = 48 mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True) mainWindow.create() # pm.rowColumnLayout(nc=3, cw=([1,100], [2,50], [3,50]) ) pm.textField(prefix+'_textField_token', w=100) pm.button(prefix+'_button_hide', l='Hide', bgc=colorWheel.getColorRGB(ci), w=50, command=lambda *args: lcHideByTokenButton(vis=0) ) ci+=1 pm.button(prefix+'_button_show', l='Show', bgc=colorWheel.getColorRGB(ci), w=50, command=lambda *args: lcHideByTokenButton(vis=1) ) ci+=1 # mainWindow.show()
def lcHideByTokenUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcHideByToken' shelfCommand = 'import lct.src.lcHideByToken.lcHideByToken as lcHbT\nreload(lcHbT)\nlcHbT.lcHideByTokenUI()' icon = basePath + 'lcHideByToken.png' winWidth = 204 winHeight = 48 mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True) mainWindow.create() # pm.rowColumnLayout(nc=3, cw=([1, 100], [2, 50], [3, 50])) pm.textField(prefix + '_textField_token', w=100) pm.button(prefix + '_button_hide', l='Hide', bgc=colorWheel.getColorRGB(ci), w=50, command=lambda *args: lcHideByTokenButton(vis=0)) ci += 1 pm.button(prefix + '_button_show', l='Show', bgc=colorWheel.getColorRGB(ci), w=50, command=lambda *args: lcHideByTokenButton(vis=1)) ci += 1 # mainWindow.show()
def lcRetopoBasicUI(dockable=False, *args, **kwargs): """ """ ci = 0 #color index iterator windowName = 'lcRetopoBasic' shelfCommand = 'import lct.src.lcRetopoBasic.lcRetopoBasic as lcRtB\nreload(lcRtB)\nlcRtB.lcRetopoBasicUI()' icon = basePath+'lcRetopoBasic.png' winWidth = 204 winHeight = 180 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.button(l='Setup for Retopo', bgc=colorWheel.getColorRGB(ci), w=200, h=25, annotation='Setup a high res mesh for retopology', command=lambda *args: rtb_setup_live_mesh(highresListDropdown) ) ci+=1 # pm.rowColumnLayout(nc=3, cw=([1,25], [2,150], [3,25] ) ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'reloadMeshList.png', annotation='Reload the list of high res meshes', command=lambda *args: rtb_highres_list_populate(highresListDropdown) ) highresListDropdown = pm.optionMenu(prefix+'_optionMenu_highres_list', w=150, h=25, bgc=[0.5,0.5,0.5], annotation='List of high res meshes in the scene' ) highresListDropdown.changeCommand(lambda *args: rtb_choose_active(highresListDropdown) ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'removeMeshFromList.png', annotation='Remove current high res mesh from the list and return it to a normal state', command=lambda *args: rtb_remove(highresListDropdown) ) pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=4, cw=([1,50], [2,100], [3,25], [4,25] ) ) pm.iconTextStaticLabel(w=50, h=25, style='iconOnly', image=iconBasePath+'meshLayering.png', annotation='Drag slider to change mesh layering' ) pm.floatSlider(prefix+'_floatSlider_layer_mesh', step=0.01, min=0, max=1, v=0, h=25, dragCommand=lambda *args: rtb_scale_layer_mesh(highresListDropdown) ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'toggleXray.png', annotation='Toggle current high res mesh X-Ray', command=lambda *args: rtb_toggle_xray(highresListDropdown) ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'hideMesh.png', annotation='Hide the high-res mesh', command=lambda *args: rtb_toggle_hide(highresListDropdown) ) pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=3, cw=([1,50], [2,100], [3,50] ) ) pm.iconTextStaticLabel(w=50, h=25, style='iconOnly', image=iconBasePath+'shaderOpacity.png', annotation='Drag slider to change shader transparency' ) pm.floatSlider(prefix+'_floatSlider_topo_trans', step=0.1, min=0, max=1, v=0.5, h=25, dragCommand=lambda *args: rtb_update_topo_transparency() ) pm.iconTextButton(w=50, h=25, style='iconOnly', image=iconBasePath+'assignShader.png', annotation='Create and/or assign a semi-transparent shader to selected low res mesh', command=lambda *args: rtb_create_retopo_shader() ) pm.setParent(prefix+'_columLayout_main') # pm.separator(style='in', h=5, hr=True) #this doesn't seem to be working right pm.rowColumnLayout(nc=2) pm.button(l='Relax', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Relax selected verts and shrink-wrap them to the live mesh', command=lambda *args: rtb_relax_verts(highresListDropdown) ) ci+=1 pm.button(l='Shrink-Wrap', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Shrink-wrap selected verts to the live mesh', command=lambda *args: rtb_shrink_wrap_verts(highresListDropdown) ) ci+=1 pm.setParent(prefix+'_columLayout_main') # pm.progressBar(prefix+'_progress_control', vis=False, w=202) # mainWindow.show() rtb_highres_list_populate(highresListDropdown) #vertex animation cache in viewport 2.0 must be disabled or the mesh will not update properly if pm.objExists('hardwareRenderingGlobals'): pm.PyNode('hardwareRenderingGlobals').vertexAnimationCache.set(0)
def lcTextureToolsUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcTextureTools' shelfCommand = 'import lct.src.lcTextureTools.lcTextureTools as lcTxT\nreload(lcTxT)\nlcTxT.lcTextureToolsUI()' icon = basePath + 'lcTextureTools.png' winWidth = 204 winHeight = 174 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=1, cw=([1, 201])) pm.iconTextButton( w=200, h=25, style='iconOnly', image=iconBasePath + 'renameNodes.png', annotation= 'Renames all file nodes based on the attached file name with a tx_ suffix', command=lambda *args: texture.renameAllTextureNodes()) pm.setParent('..') pm.separator(style='in', h=5) # pm.rowColumnLayout(nc=2, cw=([1, 100], [2, 100])) pm.rowColumnLayout(nc=2, cw=([1, 75], [2, 25])) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath + 'reloadAll.png', annotation='Reloads all the file texture nodes', command=lambda *args: texture.reloadTextures()) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'addToShelf.png', highlightImage=iconBasePath + 'addToShelf_over.png', annotation='Add to Shelf', command=lambda *args: shelf.makeShelfButton( 'Reload Textures', 'from lct.src.core.lcTexture import Texture as texture\ntexture().reloadTextures()', iconBasePath + 'reloadAllTextures.png', 'Reload All Textures')) pm.setParent('..') pm.rowColumnLayout(nc=2, cw=([1, 75], [2, 25])) pm.iconTextButton( w=100, h=25, style='iconOnly', image=iconBasePath + 'reloadChanged.png', annotation= 'Reloads only the changed file texture nodes based on timestamp', command=lambda *args: texture().reloadChangedTextures()) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'addToShelf.png', highlightImage=iconBasePath + 'addToShelf_over.png', annotation='Add to Shelf', command=lambda *args: shelf.makeShelfButton( 'Reload Changed Textures', 'from lct.src.core.lcTexture import Texture as texture\ntexture().reloadChangedTextures()', iconBasePath + 'reloadChangedTextures.png', 'Reload Changed Textures')) pm.setParent('..') pm.setParent(prefix + '_columLayout_main') pm.separator(style='in', h=5) # pm.rowColumnLayout(nc=2, cw=([1, 150], [2, 50])) pm.textField(prefix + '_textField_new_path', w=150) pm.button(prefix + '_button_browse_path', l='Browse', bgc=colorWheel.getColorRGB(ci), annotation='Choose a new directory', w=50, command=lambda *args: path.browsePathTextField( prefix + '_textField_new_path', '', 'Browse New Texture Directory')) ci += 1 pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1, 100], [2, 100])) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath + 'pathAll.png', annotation='Repath all file texture nodes', command=lambda *args: lcTxT_repath_all()) pm.iconTextButton(w=100, h=25, style='iconOnly', image=iconBasePath + 'pathSelected.png', annotation='Repath selected file texture nodes', command=lambda *args: lcTxT_repath_selected()) pm.setParent(prefix + '_columLayout_main') pm.separator(style='in', h=5) # pm.rowColumnLayout(nc=2, cw=([1, 100], [2, 100])) pm.iconTextButton( w=100, h=25, style='iconOnly', image=iconBasePath + 'openAll.png', annotation='Open all file texture nodes in default associated program', command=lambda *args: lcTxT_open_all()) pm.iconTextButton( w=100, h=25, style='iconOnly', image=iconBasePath + 'openSelected.png', annotation= 'Open selected file texture nodes in default associated program', command=lambda *args: lcTxT_open_selected()) pm.setParent(prefix + '_columLayout_main') pm.separator(style='in', h=5) # mainWindow.show()
def lcBatchBakeUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcBatchBake' shelfCommand = 'import lct.src.lcBatchBake.lcBatchBake as lcBake\nreload(lcBake)\nlcBake.lcBatchBakeUI()' icon = basePath + 'lcBatchBake.png' winWidth = 204 winHeight = 218 mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True) mainWindow.create() pm.menu(l='Options', helpMenu=True) pm.menuItem( l='Delete All bake sets', command=lambda *args: lcBake_delete_all_bake_sets(bakeSetListDropdown)) # pm.columnLayout(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1, 100], [2, 100])) pm.button(l='Make Texture', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Create a Texture bake set', command=lambda *args: lcBake_make_new_bake_set( bakeSetListDropdown, 'texture')) ci += 1 pm.button(l='Make Vertex', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Create a Texture bake set', command=lambda *args: lcBake_make_new_bake_set( bakeSetListDropdown, 'vertex')) ci += 1 pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=3, cw=([1, 25], [2, 150], [3, 25])) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath + 'reloadList.png', annotation='Reload the bake set list', command=lambda *args: lcBake_populate_bake_set_list( bakeSetListDropdown)) bakeSetListDropdown = pm.optionMenu(prefix + '_optionMenu_bake_set_list', w=150, h=25, annotation='List of bake sets') pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath + 'deleteItem.png', annotation='Delete this bake set', command=lambda *args: lcBake_delete_current_bake_set( bakeSetListDropdown)) pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1, 100], [2, 100])) #nc=3, cw=([1,50], [2,50], [3,100] ) ) pm.button(l='+ Add', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Add geometry to bake set', command=lambda *args: lcBake_add_to_current_bake_set( bakeSetListDropdown)) ci += 1 # pm.button(l='- Rem', bgc=colorWheel.getColorRGB(ci), w=50, h=25, annotation='Remove geometry from bake set', command=lambda *args: lcBake_fake_command() ) # ci+=1 pm.button( l='Edit Options', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Edit the bake set options', command=lambda *args: lcBake_show_bake_set_attrs(bakeSetListDropdown)) ci += 1 pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1, 75], [2, 125])) pm.text(l='Bake Camera: ', al='right') cameraListDropdown = pm.optionMenu(prefix + '_optionMenu_camera_list', w=125, h=25, annotation='List of cameras') pm.text(l='') pm.checkBox(prefix + '_checkBox_shadows', w=125, h=25, value=True, label='Shadows and AO?', annotation='Turn on to bake shadows and ambient occlusion') pm.setParent(prefix + '_columLayout_main') # pm.separator(style='none', h=10) pm.rowColumnLayout(nc=2, cw=([1, 150], [2, 50])) pm.textField(prefix + '_textField_texture_path', text='texture output directory', annotation='Output directory path', w=150) pm.button( prefix + '_button_browse_path', l='Browse', bgc=colorWheel.getColorRGB(ci), annotation='Choose a directory', w=50, command=lambda *args: path.browsePathTextField( prefix + '_textField_texture_path', '', 'Browse a Directory')) ci += 1 pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1, 150], [2, 50])) pm.button(l='Bake It !!', bgc=colorWheel.getColorRGB(ci), w=150, h=25, annotation='Bake to texture or vertex', command=lambda *args: lcBake_convert_lightmap( bakeSetListDropdown, cameraListDropdown)) ci += 1 pm.button(l='Open Dir', bgc=colorWheel.getColorRGB(ci), w=50, h=25, annotation='Open the output directory', command=lambda *args: lcBake_open_lightmap_folder()) ci += 1 # mainWindow.show() plugin.reloadPlugin(plugin='Mayatomr', autoload=True) lcBake_populate_bake_set_list(bakeSetListDropdown) lcBake_populate_camera_list(cameraListDropdown)
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)
def lcRetopoBasicUI(dockable=False, *args, **kwargs): """ """ ci = 0 #color index iterator windowName = 'lcRetopoBasic' shelfCommand = 'import lct.src.lcRetopoBasic.lcRetopoBasic as lcRtB\nreload(lcRtB)\nlcRtB.lcRetopoBasicUI()' icon = basePath + 'lcRetopoBasic.png' winWidth = 204 winHeight = 180 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.button(l='Setup for Retopo', bgc=colorWheel.getColorRGB(ci), w=200, h=25, annotation='Setup a high res mesh for retopology', command=lambda *args: rtb_setup_live_mesh(highresListDropdown)) ci += 1 # pm.rowColumnLayout(nc=3, cw=([1, 25], [2, 150], [3, 25])) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'reloadMeshList.png', annotation='Reload the list of high res meshes', command=lambda *args: rtb_highres_list_populate(highresListDropdown)) highresListDropdown = pm.optionMenu( prefix + '_optionMenu_highres_list', w=150, h=25, bgc=[0.5, 0.5, 0.5], annotation='List of high res meshes in the scene') highresListDropdown.changeCommand( lambda *args: rtb_choose_active(highresListDropdown)) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'removeMeshFromList.png', annotation= 'Remove current high res mesh from the list and return it to a normal state', command=lambda *args: rtb_remove(highresListDropdown)) pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=4, cw=([1, 50], [2, 100], [3, 25], [4, 25])) pm.iconTextStaticLabel(w=50, h=25, style='iconOnly', image=iconBasePath + 'meshLayering.png', annotation='Drag slider to change mesh layering') pm.floatSlider( prefix + '_floatSlider_layer_mesh', step=0.01, min=0, max=1, v=0, h=25, dragCommand=lambda *args: rtb_scale_layer_mesh(highresListDropdown)) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'toggleXray.png', annotation='Toggle current high res mesh X-Ray', command=lambda *args: rtb_toggle_xray(highresListDropdown)) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'hideMesh.png', annotation='Hide the high-res mesh', command=lambda *args: rtb_toggle_hide(highresListDropdown)) pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=3, cw=([1, 50], [2, 100], [3, 50])) pm.iconTextStaticLabel( w=50, h=25, style='iconOnly', image=iconBasePath + 'shaderOpacity.png', annotation='Drag slider to change shader transparency') pm.floatSlider(prefix + '_floatSlider_topo_trans', step=0.1, min=0, max=1, v=0.5, h=25, dragCommand=lambda *args: rtb_update_topo_transparency()) pm.iconTextButton( w=50, h=25, style='iconOnly', image=iconBasePath + 'assignShader.png', annotation= 'Create and/or assign a semi-transparent shader to selected low res mesh', command=lambda *args: rtb_create_retopo_shader()) pm.setParent(prefix + '_columLayout_main') # pm.separator(style='in', h=5, hr=True) #this doesn't seem to be working right pm.rowColumnLayout(nc=2) pm.button( l='Relax', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Relax selected verts and shrink-wrap them to the live mesh', command=lambda *args: rtb_relax_verts(highresListDropdown)) ci += 1 pm.button(l='Shrink-Wrap', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Shrink-wrap selected verts to the live mesh', command=lambda *args: rtb_shrink_wrap_verts(highresListDropdown)) ci += 1 pm.setParent(prefix + '_columLayout_main') # pm.progressBar(prefix + '_progress_control', vis=False, w=202) # mainWindow.show() rtb_highres_list_populate(highresListDropdown) #vertex animation cache in viewport 2.0 must be disabled or the mesh will not update properly if pm.objExists('hardwareRenderingGlobals'): pm.PyNode('hardwareRenderingGlobals').vertexAnimationCache.set(0)
def lcMoveImagePlaneUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcMoveImagePlane' shelfCommand = 'import lct.src.lcMoveImagePlane.lcMoveImagePlane as lcMIP\nreload(lcMIP)\nlcMIP.lcMoveImagePlaneUI()' icon = basePath + 'lcMoveImagePlane.png' winWidth = 204 winHeight = 103 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=3, cw=([1, 66], [2, 66], [3, 66])) pm.button( l='Front', bgc=colorWheel.getColorRGB(ci), w=66, h=25, annotation='Create an image plane for the front camera', command=lambda *args: mip_make_image_plane('front', imageListDropdown)) ci += 1 pm.button( l='Side', bgc=colorWheel.getColorRGB(ci), w=66, h=25, annotation='Create an image plane for the side camera', command=lambda *args: mip_make_image_plane('side', imageListDropdown)) ci += 1 pm.button( l='Top', bgc=colorWheel.getColorRGB(ci), w=66, h=25, annotation='Create an image plane for the top camera', command=lambda *args: mip_make_image_plane('top', imageListDropdown)) ci += 1 pm.setParent(prefix + '_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1, 25], [2, 175])) pm.iconTextButton( w=25, h=25, style='iconOnly', image=iconBasePath + 'reloadList.png', annotation='Reload the image planes list', command=lambda *args: mip_populate_image_list(imageListDropdown)) imageListDropdown = pm.optionMenu( prefix + '_optionMenu_image_plane_list', w=175, h=25, annotation='List of orthographic image planes') pm.setParent(prefix + '_columLayout_main') # pm.button( l='Make Image Plane Move Control', bgc=colorWheel.getColorRGB(ci), w=200, h=25, annotation='Create control curve for image plane from drop down list', command=lambda *args: mip_make_ctrl(imageListDropdown)) ci += 1 # mainWindow.show() mip_populate_image_list(imageListDropdown)
def lcBatchBakeUI(dockable=False, *args, **kwargs): ''' ''' ci = 0 #color index iterator windowName = 'lcBatchBake' shelfCommand = 'import lct.src.lcBatchBake.lcBatchBake as lcBake\nreload(lcBake)\nlcBake.lcBatchBakeUI()' icon = basePath+'lcBatchBake.png' winWidth = 204 winHeight = 218 mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True) mainWindow.create() pm.menu(l='Options', helpMenu=True) pm.menuItem(l='Delete All bake sets', command=lambda *args: lcBake_delete_all_bake_sets(bakeSetListDropdown) ) # pm.columnLayout(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,100], [2,100]) ) pm.button(l='Make Texture', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Create a Texture bake set', command=lambda *args: lcBake_make_new_bake_set(bakeSetListDropdown, 'texture') ) ci+=1 pm.button(l='Make Vertex', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Create a Texture bake set', command=lambda *args: lcBake_make_new_bake_set(bakeSetListDropdown, 'vertex') ) ci+=1 pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=3, cw=([1,25], [2,150], [3,25]) ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'reloadList.png', annotation='Reload the bake set list', command=lambda *args: lcBake_populate_bake_set_list(bakeSetListDropdown) ) bakeSetListDropdown = pm.optionMenu(prefix+'_optionMenu_bake_set_list', w=150, h=25, annotation='List of bake sets' ) pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'deleteItem.png', annotation='Delete this bake set', command=lambda *args: lcBake_delete_current_bake_set(bakeSetListDropdown) ) pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,100], [2,100] ) ) #nc=3, cw=([1,50], [2,50], [3,100] ) ) pm.button(l='+ Add', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Add geometry to bake set', command=lambda *args: lcBake_add_to_current_bake_set(bakeSetListDropdown) ) ci+=1 # pm.button(l='- Rem', bgc=colorWheel.getColorRGB(ci), w=50, h=25, annotation='Remove geometry from bake set', command=lambda *args: lcBake_fake_command() ) # ci+=1 pm.button(l='Edit Options', bgc=colorWheel.getColorRGB(ci), w=100, h=25, annotation='Edit the bake set options', command=lambda *args: lcBake_show_bake_set_attrs(bakeSetListDropdown) ) ci+=1 pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,75], [2,125] ) ) pm.text(l='Bake Camera: ', al='right') cameraListDropdown = pm.optionMenu(prefix+'_optionMenu_camera_list', w=125, h=25, annotation='List of cameras' ) pm.text(l='') pm.checkBox(prefix+'_checkBox_shadows', w=125, h=25, value=True, label='Shadows and AO?', annotation='Turn on to bake shadows and ambient occlusion' ) pm.setParent(prefix+'_columLayout_main') # pm.separator(style='none', h=10) pm.rowColumnLayout(nc=2, cw=([1,150], [2,50]) ) pm.textField(prefix+'_textField_texture_path', text='texture output directory', annotation='Output directory path', w=150) pm.button(prefix+'_button_browse_path', l='Browse', bgc=colorWheel.getColorRGB(ci), annotation='Choose a directory', w=50, command=lambda *args: path.browsePathTextField(prefix+'_textField_texture_path', '', 'Browse a Directory') ) ci+=1 pm.setParent(prefix+'_columLayout_main') # pm.rowColumnLayout(nc=2, cw=([1,150], [2,50]) ) pm.button(l='Bake It !!', bgc=colorWheel.getColorRGB(ci), w=150, h=25, annotation='Bake to texture or vertex', command=lambda *args: lcBake_convert_lightmap(bakeSetListDropdown, cameraListDropdown) ) ci+=1 pm.button(l='Open Dir', bgc=colorWheel.getColorRGB(ci), w=50, h=25, annotation='Open the output directory', command=lambda *args: lcBake_open_lightmap_folder() ) ci+=1 # mainWindow.show() plugin.reloadPlugin(plugin='Mayatomr', autoload=True) lcBake_populate_bake_set_list(bakeSetListDropdown) lcBake_populate_camera_list(cameraListDropdown)