def unlock(self): asset_name = str(self.current_item.text()) if self.model_radio.isChecked(): toUnlock = os.path.join(os.environ['ASSETS_DIR'], asset_name, 'model') elif self.rig_radio.isChecked(): toUnlock = os.path.join(os.environ['ASSETS_DIR'], asset_name, 'rig') elif self.animation_radio.isChecked(): toUnlock = os.path.join(os.environ['SHOTS_DIR'], asset_name, 'animation') if amu.isLocked(toUnlock): if self.showConfirmUnlockDialog() == 'No': return cmd.file(save=True, force=True) cmd.file(force=True, new=True) #open new file amu.unlock(toUnlock) self.showUnlockedDialog() else: self.showIsLockedDialog()
def unlockLightingFile(): print("unlockLightingFile") shotPaths = glob.glob(os.path.join(os.environ['SHOTS_DIR'], '*')) selections = [] for sp in shotPaths: selections.append(os.path.basename(sp)) selections.sort() answer = hou.ui.selectFromList(selections, message='Select shot file to unlock:', exclusive=True) if answer: answer = answer[0] toUnlock = os.path.join(os.environ['SHOTS_DIR'], selections[answer], 'lighting') if amu.isLocked(toUnlock): reply = hou.ui.displayMessage( 'Are you sure you want to unlock this file?', buttons=('Ok', 'Cancel')) if reply == 0: hou.hipFile.save() hou.hipFile.clear() amu.unlock(toUnlock) hou.ui.displayMessage('Lighting file unlocked') else: hou.ui.displayMessage('Lighting file already unlocked') return
def unlock_button_clicked(self): toUnlock = self.get_asset_path() if amu.isLocked(toUnlock): if self.checkout_dialog.show_confirm_unlock_dialog() == False: return amu.unlock(toUnlock) self.checkout_dialog.show_message("Asset unlocked") else: self.checkout_dialog.show_message("Asset not locked")
def unlockOTL(filename): asset_name, ext = os.path.splitext(filename) toUnlock = os.path.join(os.environ['ASSETS_DIR'], asset_name, 'otl') print toUnlock if amu.isLocked(toUnlock): reply = hou.ui.displayMessage('Are you REALLY sure you want to unlock this node?', buttons=('Ok', 'Cancel')) if reply == 0: amu.unlock(toUnlock) hou.ui.displayMessage('Node unlocked') else: hou.ui.displayMessage('Node already unlocked') return
def unlock(self): toUnlock = self.get_asset_path() if amu.isLocked(toUnlock): if self.showConfirmUnlockDialog() == 'No': return cmd.file(save=True, force=True) cmd.file(force=True, new=True) #open new file amu.unlock(toUnlock) self.showUnlockedDialog() else: self.showIsLockedDialog() #Update node info self.show_node_info()
def unlock(self): print("unlocking!!!!") toUnlock = self.get_asset_path() if amu.isLocked(toUnlock): if self.showConfirmUnlockDialog() == 'No': return if cmd.file(q=True, sceneName=True) != "": cmd.file(save=True, force=True) cmd.file(force=True, new=True) #open new file amu.unlock(toUnlock) self.showUnlockedDialog() else: self.showIsLockedDialog() #Update node info self.show_node_info()
def unlockLightingFile(): print("unlockLightingFile") shotPaths = glob.glob(os.path.join(os.environ['SHOTS_DIR'], '*')) selections = [] for sp in shotPaths: selections.append(os.path.basename(sp)) selections.sort() answer = hou.ui.selectFromList(selections, message='Select shot file to unlock:', exclusive=True) if answer: answer = answer[0] toUnlock = os.path.join(os.environ['SHOTS_DIR'], selections[answer], 'lighting') if amu.isLocked(toUnlock): reply = hou.ui.displayMessage('Are you sure you want to unlock this file?', buttons=('Ok', 'Cancel')) if reply == 0: hou.hipFile.save() hou.hipFile.clear() amu.unlock(toUnlock) hou.ui.displayMessage('Lighting file unlocked') else: hou.ui.displayMessage('Lighting file already unlocked') return
def unlockLightingFile(): print("unlockLightingFile") shotPaths = glob.glob(os.path.join(os.environ['SHOTS_DIR'], '*')) selections = [] for sp in shotPaths: selections.append(os.path.basename(sp)) selections.sort() answer = ui.listWindow(selections, wmessage='Select shot file to unlock:') if answer: answer = answer[0] toUnlock = os.path.join(os.environ['SHOTS_DIR'], selections[answer], 'lighting') if amu.isLocked(toUnlock): reply = ui.warningWindow('Are you sure you want to unlock this file?') if reply == 0: hou.hipFile.save() hou.hipFile.clear() amu.unlock(toUnlock) ui.infoWindow('Lighting file unlocked') else: ui.infoWindow('Lighting file already unlocked') return
def unlockLightingFile(): print ("unlockLightingFile") shotPaths = glob.glob(os.path.join(os.environ["SHOTS_DIR"], "*")) selections = [] for sp in shotPaths: selections.append(os.path.basename(sp)) selections.sort() answer = hou.ui.selectFromList(selections, message="Select shot file to unlock:", exclusive=True) if answer: answer = answer[0] toUnlock = os.path.join(os.environ["SHOTS_DIR"], selections[answer], "lighting") if amu.isLocked(toUnlock): reply = hou.ui.displayMessage("Are you sure you want to unlock this file?", buttons=("Ok", "Cancel")) if reply == 0: hou.hipFile.save() hou.hipFile.clear() amu.unlock(toUnlock) hou.ui.displayMessage("Lighting file unlocked") else: hou.ui.displayMessage("Lighting file already unlocked") return
def unlock(self): asset_name = str(self.current_item.text()) if self.model_radio.isChecked(): toUnlock = os.path.join(os.environ['ASSETS_DIR'], asset_name, 'model') elif self.rig_radio.isChecked(): toUnlock = os.path.join(os.environ['ASSETS_DIR'], asset_name, 'rig') elif self.animation_radio.isChecked(): toUnlock = os.path.join(os.environ['SHOTS_DIR'], asset_name, 'animation') if not amu.isLocked(toUnlock): cmd.confirmDialog(title = 'Already Unlocked' , message = 'Asset already unlocked' , button = ['Ok'] , defaultButton = 'Ok' , cancelButton = 'Ok' , dismissString = 'Ok') return if cmd.confirmDialog(title = 'Confirmation' , message = 'Are you sure you want to unlock this asset?' , button = ['No', 'Yes'] , defaultButton = 'No' , cancelButton = 'No' , dismissString = 'No') == 'No': return amu.unlock(toUnlock) cmd.confirmDialog(title = 'Asset unlocked' , message = 'Asset unlocked' , button = ['Ok'] , defaultButton = 'Ok' , cancelButton = 'Ok' , dismissString = 'Ok') return
def isLocked(self): return amu.isLocked(self.workingDirectory)