def add_to_selected_bank(self): if WaapiTools.Client is None: return banks = WaapiTools.get_selected_objects() if len(banks) == 0 or banks[0]['type'] != 'SoundBank': return add_objects_to_bank(banks[0], self.activeObjects, ['media'])
def export_to_file(self): if WaapiTools.Client is None: return saveDict = { "selectObject": WaapiTools.get_selected_objects(), "activeObjects": self.activeObjects, "cacheObjects": self.cacheObjects, "radioBtn_group_key_name": self.radioBtn_group_key_name.isChecked(), "radioBtn_group_ope_include": self.radioBtn_group_ope_include.isChecked(), "cbxUseRegularExpression": self.cbxUseRegularExpression.isChecked(), "cbxMatchWholeWord": self.cbxMatchWholeWord.isChecked(), "cbxCaseSensitive": self.cbxCaseSensitive.isChecked(), "cbbDescendantType": self.cbbDescendantType.currentIndex(), "iptSelectionFilter": self.iptSelectionFilter.text() } FileTools.export_to_file(saveDict)
def copy_selection_to_active_objects(self): if WaapiTools.Client is None: return selection = WaapiTools.get_selected_objects() if len(selection) > 0: self.batchProcessor = BatchProcessor( self.activeObjects, lambda obj: WaapiTools.copy_object(selection[0], obj)) self.batchProcessor.start()
def move_active_objects_to_selection(self): if WaapiTools.Client is None: return selection = WaapiTools.get_selected_objects() if len(selection) > 0: self.batchProcessor = BatchProcessor( self.activeObjects, lambda obj: WaapiTools.move_object(obj, selection[0])) self.batchProcessor.start()
def get_children_from_selection(self): selected_objects = WaapiTools.get_selected_objects() if len(selected_objects) == 0: return children = WaapiTools.get_children_objects(selected_objects[0], False) row = 0 for child in children: if row >= self.tblMatrix.rowCount(): self.tblMatrix.setRowCount(row + 1) self.tblMatrix.setItem(row, 0, QTableWidgetItem(child['name'])) row += 1
def get_selected_objects(self): if WaapiTools.Client is None: return self.cacheObjects = WaapiTools.get_selected_objects() self.reset_filter() self.filter_and_show_list()