def load_and_write_paths(self): import Nuke_Scripts.base_functions as bf execfile( os.path.join(self.driver_location, self.pipeline_paths_list[0], 'menu.py')) # Load pipe menu execfile( os.path.join(self.driver_location, self.pipeline_paths_list[2], 'menu.py')) # Load pipe Gizmos bf.read_write_nuke_init(self.nuke_init_file, self.pipeline_paths_list) bf.json_read_write(self.driver_location)
def __init__(self): try: self.google_drive_directory = bf.json_read_write() except KeyError: nuke.message('Can not find Google Drive location path, please try adding location path!') # Assign shot code of loaded nuke scene try: self.shot_code = nuke.root()['name'].getValue().split('/')[-1][:-8] except AttributeError: self.shot_code = '' print 'Function ran outside of nuke'
def sync_read_nodes(): google_drive = bf.json_read_write() _search_str = '/VFX Project/' for node in nuke.allNodes(): if node.knob('file'): old_file_path = node['file'].getValue() new_file_path = os.path.join(google_drive, old_file_path.split('VFX Project/', 1)[-1]).replace('\\', '/') if _search_str in old_file_path: node['file'].setValue(new_file_path) else: print '{} is not saved on shared drive'.format(old_file_path)
def __init__(self): super(Toolset, self).__init__(parent=QApplication.activeWindow()) self.setWindowTitle('Save Toolset') self.setFixedSize(350, 195) self.setStyleSheet('QDialog {background : #262c35}') self.Toolset_Dir = '' self.Toolset_Dir = os.path.join(bf.json_read_write(), 'Pipeline/ToolSets/') self.Toolset_List = [ x for x in os.listdir(self.Toolset_Dir) if os.path.isdir(self.Toolset_Dir + x) ] + ['Create Folder'] self.master()
def __init__(self): super(RenderSubmission, self).__init__(parent=QApplication.activeWindow()) # Set ui size and window title self.setWindowTitle('Render Submission Tool Beta') self.setMinimumSize(350, 500) # Initiate google sheets self.google_sheets = GoogleSheet() # Create labels and user input label_1 = QLabel('Artist:') self.username = QLineEdit(getuser()) # Create labels and add shot code label_2 = QLabel('Shot Code:') self.shot_code = QLineEdit('003_002') self.shot_code.textEdited.connect(self.set_combo_box) # If nuke is imported find shot code try: self.shot_code.setText( nuke.root()['name'].getValue().split('/')[-3]) except AttributeError: pass except IndexError: pass # Assigning user google sync path self.google_drive = bf.json_read_write() self.review_directory = self.google_drive + 'Comp/{}/Renders/Review/'.format( self.shot_code.text()) # Create label and pull down box for task job label_3 = QLabel('Job Task:') self.task = QComboBox() task_list = [ folder_dir for folder_dir in os.listdir(self.review_directory) if os.path.isdir(self.review_directory + folder_dir) ] self.task.addItems(task_list) self.task.activated.connect(self.set_combo_box) # Note content widget label_4 = QLabel('Submission Version:') self.review_version = QComboBox() self.note_content = QTextEdit() self.set_combo_box() # Push button submission and css style submission = QPushButton('Submit Review') submission.connect(SIGNAL('pressed()'), self.submit_notes) submission.setStyleSheet( '*{height: 30px; border-radius: 10px; border: 1px solid}' ':hover {background-color: blue;}' ':pressed {background-color: white}') # Create grid layout and add listed widgets self.layout_1 = QGridLayout() # Add labels to the grid layout self.layout_1.addWidget(label_1, 0, 0, Qt.AlignRight) self.layout_1.addWidget(label_2, 1, 0, Qt.AlignRight) self.layout_1.addWidget(label_3, 2, 0, Qt.AlignRight) self.layout_1.addWidget(label_4, 3, 0) # Adding line edit to the layout self.layout_1.addWidget(self.username, 0, 1) self.layout_1.addWidget(self.shot_code, 1, 1) # Adding pull down bar to the layout self.layout_1.addWidget(self.task, 2, 1) self.layout_1.addWidget(self.review_version, 3, 1) # Adding text content box to layout self.layout_1.addWidget(self.note_content, 4, 0, 1, 0) # Adding submission button self.layout_1.addWidget(submission, 5, 0, 1, 0) # Assign master layout to self self.master_layout()
def __init__(self): super(ProxyUI, self).__init__(parent=QApplication.activeWindow()) self.setWindowTitle('Proxy Render Tool') self.setMinimumSize(300, 100) self.google_drive = bf.json_read_write() self.setLayout(self.layout1()[0])