def rtb_choose_active(highresListDropdown, *args, **kwargs): ''' ''' global prefix global defaultString global lct_cfg lct_cfg.set('lcRetopoBasicListItem', highresListDropdown.getSelect()) high = highresListDropdown.getValue() if high != defaultString: rtb_scale_layer_mesh(highresListDropdown) pm.picture(prefix + '_picture_layer_mesh', edit=True, enable=True) pm.floatSlider(prefix + '_floatSlider_layer_mesh', edit=True, enable=True) live = pm.PyNode(high.replace('_high', '_live')) liveShape = live.getShape() pm.makeLive(live) else: pm.makeLive(none=True) rtb_scale_layer_mesh(highresListDropdown) pm.picture(prefix + '_picture_layer_mesh', edit=True, enable=False) pm.floatSlider(prefix + '_floatSlider_layer_mesh', edit=True, enable=False) rtb_glow(highresListDropdown)
def rtb_setup_live_mesh(highresListDropdown, *args, **kwargs): ''' ''' global lct_cfg sel = pm.ls(sl=True) lcGeometry.Geometry.fixNamespaceNames() if sel: for item in sel: pm.undoInfo(chunkName='lc_undo_makelive', openChunk=True) try: pm.parent(item, world=True) lcGeometry.Geometry.unlock_translate_rotate_scale(item) root = pm.group(empty=True, name=item + '_RETOPO') live = pm.duplicate(item, name=item + '_live')[0] high = item.rename(item + '_high') pm.makeIdentity([high, live], apply=True, t=1, r=1, s=1, n=0) lcUtility.Utility.centerPvt([high, live]) highShape = high.getShape() liveShape = live.getShape() highShape.overrideEnabled.set(1) # enable display overrides highShape.overrideDisplayType.set(2) # set to referenced liveShape.overrideEnabled.set(1) # enable display overrides liveShape.overrideDisplayType.set(1) # set to template liveShape.overrideVisibility.set(0) # set visibility to 0 pm.makeLive(live) highresListDropdown.addItems([high]) numItems = highresListDropdown.getNumberOfItems() highresListDropdown.setSelect(numItems) pm.parent(high, root) pm.parent(live, root) pm.connectAttr('persp.translate', high.scalePivot) rtb_scale_layer_mesh(highresListDropdown) rtb_glow(highresListDropdown) lct_cfg.set('lcRetopoBasicListItem', highresListDropdown.getSelect()) pm.picture(prefix + '_picture_layer_mesh', edit=True, enable=True) pm.floatSlider(prefix + '_floatSlider_layer_mesh', edit=True, enable=True) pm.undoInfo(chunkName='lc_undo_makelive', closeChunk=True) pm.select(clear=True) except: pm.undoInfo(chunkName='lc_undo_makelive', closeChunk=True) pm.undo() lcUtility.Utility.lc_print( 'Could not make {0} live'.format(item))
def flushScript( *args ): if( script_job_id != -1 ): pm.scriptJob( kill=script_job_id, force=True ) pm.lockNode( 'light_probe', lock=False ) pm.delete('light_probe') pm.makeLive(none=True)
def pickTgtObj(*args): tgtObj = pm.ls( sl=True ) if ( len( tgtObj) != 1 ): pm.confirmDialog( t='Error', message= 'Selct only One Mesh Object!' , button = 'OK' ) return 0 if ( pm.nodeType( tgtObj[0].getShape() ) != 'mesh' ): pm.confirmDialog( t='Error', message= 'Selct object is NOT Mesh' , button = 'OK' ) return 0 pm.textFieldButtonGrp( 'txtBtn_object', edit=True, text=str( tgtObj[0] ) ) #// initialize make live objet pm.makeLive( none=True ) pm.makeLive( str(tgtObj[0]) ) return 1
def rtb_choose_active(highresListDropdown, *args, **kwargs): ''' ''' global defaultString sel = pm.ls(sl=True) pm.select(cl=True) pm.makeLive() high = highresListDropdown.getValue() if not high == defaultString: rtb_scale_layer_mesh(highresListDropdown) live = pm.PyNode(high.replace('_high', '_live')) liveShape = live.getShape() pm.select(liveShape, replace=True) pm.makeLive() pm.select(sel, replace=True) rtb_glow(highresListDropdown)
def rtb_setup_live_mesh(highresListDropdown, *args, **kwargs): ''' ''' sel = pm.ls(sl=True) geometry.fixNamespaceNames() if sel[0] != '': root = pm.group(empty=True, name=sel[0]+'_RETOPO') live = pm.duplicate(sel[0], name = sel[0]+'_live')[0] high = sel[0].rename(sel[0]+'_high') pm.makeIdentity([high, live], apply=True, t=1, r=1, s=1, n=0) utility.centerPvt([high, live]) highShape = high.getShape() liveShape = live.getShape() highShape.overrideEnabled.set(1) #enable display overrides highShape.overrideDisplayType.set(2) #set to referenced liveShape.overrideEnabled.set(1) #enable display overrides liveShape.overrideDisplayType.set(1) #set to template liveShape.overrideVisibility.set(0) #set visibility to 0 pm.select(live) pm.makeLive() highresListDropdown.addItems([high]) numItems = highresListDropdown.getNumberOfItems() highresListDropdown.setSelect(numItems) pm.parent(high, root) pm.parent(live, root) pm.connectAttr('persp.translate', high.scalePivot) rtb_scale_layer_mesh(highresListDropdown) rtb_glow(highresListDropdown)
def rtb_setup_live_mesh(highresListDropdown, *args, **kwargs): ''' ''' sel = pm.ls(sl=True) geometry.fixNamespaceNames() if sel[0] != '': root = pm.group(empty=True, name=sel[0] + '_RETOPO') live = pm.duplicate(sel[0], name=sel[0] + '_live')[0] high = sel[0].rename(sel[0] + '_high') pm.makeIdentity([high, live], apply=True, t=1, r=1, s=1, n=0) utility.centerPvt([high, live]) highShape = high.getShape() liveShape = live.getShape() highShape.overrideEnabled.set(1) #enable display overrides highShape.overrideDisplayType.set(2) #set to referenced liveShape.overrideEnabled.set(1) #enable display overrides liveShape.overrideDisplayType.set(1) #set to template liveShape.overrideVisibility.set(0) #set visibility to 0 pm.select(live) pm.makeLive() highresListDropdown.addItems([high]) numItems = highresListDropdown.getNumberOfItems() highresListDropdown.setSelect(numItems) pm.parent(high, root) pm.parent(live, root) pm.connectAttr('persp.translate', high.scalePivot) rtb_scale_layer_mesh(highresListDropdown) rtb_glow(highresListDropdown)
import maya.OpenMaya as OM import maya.OpenMayaUI as omui from math import * import pymel.core.datatypes as dt ui_layout = {} UI_name = [] item_list = [] pos_hLitPt = dt.Vector([0,0,0]) #// initilize pm.scriptJob(ka=True) pm.makeLive(none=True) script_job_id = -1 def getActiveCam(*args): #// get active camera dag path dPath_cam = OM.MDagPath() omui.M3dView.active3dView().getCamera( dPath_cam ) activeViewCamera = str(pm.PyNode(dPath_cam.fullPathName()).getParent()) #print dPath_cam.Path_cam.partialPathName() return activeViewCamera def placeHighLight(*args): ### UI setup global UI_name