def save_crv(self): """ Save selected curve under selected name. If no name given, use crv name. :return: """ # Get data from ui data = self.get_ui_data() # get selection selection = Mgu.get_selection() # get the name of the curve crv_name = selection[0] if data['new_shape_name']: crv_type = data['new_shape_name'] else: crv_type = crv_name crv_dict = Mcu.get_crv_info(crv_name) self.crv_data[crv_type] = crv_dict fu.FileSystem.save_to_json(self.crv_data, DICTS_PATH) self.crv_list = self.create_crv_list() UIu.update_combobox(self.curve_cbB, self.crv_list) UIu.update_combobox(self.curve_to_delete_cbB, self.crv_list) return
def update_asset_type_combobox(self): """ Update asset_type/episode comboBox according to the project, asset/anim """ # Get datas from ui self.data = self.get_pc_ui_datas() # Build list types_list = [ asset_type for asset_type in self.hierarchy[self.data['project']][ self.data['scenes_sound']][self.data['asset_anim']] ] # Change labels according to selection if self.data['asset_anim'] == 'ANIMATION': self.asset_type_label.setText('Episode') self.asset_label.setText('Shot') else: self.asset_type_label.setText('Type') self.asset_label.setText('Asset') # Update comboBox mla_UI_utils.update_combobox(self.asset_type, types_list) # Init update asset/shot combobox self.update_asset_shot_combobox()
def update_task_combobox(self): """ Update task comboBox according to the project, asset/anim, asset_type/episode, asset/shot """ # Get datas from ui self.data = self.get_pc_ui_datas() # Build list task_list = [ asset for asset in self.hierarchy[self.data['project']][ self.data['scenes_sound']][self.data['asset_anim']][ self.data['asset_type_episode']][self.data['asset_shot']] ] # Update comboBox mla_UI_utils.update_combobox(self.task, task_list, block=False)
def update_scenes_sound_combobox(self): """ Update asset_type/episode comboBox according to the project, asset/anim """ # Get datas from ui self.data = self.get_pc_ui_datas() # Build list scenes_sound_list = [ asset_type for asset_type in self.hierarchy[self.data['project']] ] # Update comboBox mla_UI_utils.update_combobox(self.scenes_sound, scenes_sound_list) # Init update asset/shot combobox self.update_asset_anim_combobox() logging.debug('===== END OF scenes_sound comboBox UPDATE =====')
def __init__(self): super(PathConstructorUI, self).__init__() # Get current open file self.path = Multi_path_utils.get_current_scene_path() self.setWindowTitle('Path Constructor UI') self.setMinimumSize(800, 165) self.buildUI() self.data = dict() self.hierarchy = hierarchy_utils.list_hierarchy() # Populating menus self.project_list = [project for project in self.hierarchy.keys()] self.project_list.sort() mla_UI_utils.update_combobox(self.project, self.project_list) self.update_scenes_sound_combobox() # Connecting ui selections self.project.currentIndexChanged.connect( self.update_asset_anim_combobox) self.scenes_sound.currentIndexChanged.connect( self.update_scenes_sound_combobox) self.asset_anim.currentIndexChanged.connect( self.update_asset_type_combobox) self.asset_type.currentIndexChanged.connect( self.update_asset_shot_combobox) self.asset.currentIndexChanged.connect(self.update_task_combobox) self.set_path_field.pressed.connect(self.update_path) self.set_path_field.released.connect(self.select_from_path) # Select currently open scene if possible # self.select_from_path() logging.debug('===== END OF INIT =====')
def __init__(self, parent=None): super(CurveManagerUI, self).__init__(parent=parent) self.setWindowTitle('CM') self.crv_data = self.get_crv_data() # UI self.buildUI() # Connexion self.save_to_dict_pB.clicked.connect(self.save_crv) self.delete_shape_pB.clicked.connect(self.delete_crv) self.creation_pB.clicked.connect(self.create_crv_from_ui) self.curve_edition_pB.clicked.connect(self.edit_crv_from_ui) if self.crv_data: self.crv_list = self.create_crv_list() # Update UIu.update_combobox(self.curve_cbB, self.crv_list) UIu.update_combobox(self.curve_to_delete_cbB, self.crv_list)
def update_asset_anim_combobox(self): """ Update asset/anim comboBox according to the project """ # Get datas from ui self.data = self.get_pc_ui_datas() # Set project directory # path_utils.set_current_project_directory(self.data['project']) # Build list asset_anim_list = [ directory for directory in self.hierarchy[self.data['project']][ self.data['scenes_sound']] ] # Update comboBox mla_UI_utils.update_combobox(self.asset_anim, asset_anim_list) # Init update type/episode combobox self.update_asset_type_combobox() logging.debug('===== END OF asset_anim comboBox UPDATE =====')