def update_bg_checkbox(self): """Enables background selection if frames are present.""" # We cannot use background if we don't have background data has_bg = dep_util.check_image_existence(self.path_bg_disparity) != "" cb_use_bg = self.dlg.cb_depth_options_use_bg if not has_bg: cb_use_bg.setChecked(False) cb_use_bg.setEnabled(False) common.call_force_refreshing( self, dep_util.update_flagfile, self.flagfile_fn, "use_foreground_masks", False, ) else: cb_use_bg.setEnabled(True)
def get_valid_types(self): """Checks which render types are valid. Returns: list[str]: Subset of ("background", "video") depending on if the corresponding inputs are present. """ # We need both full-size color and disparity for a type to be valid type_paths = OrderedDict({ "color": [self.path_video_color, self.path_video_disparity], "background_color": [self.path_bg_color, self.path_bg_disparity], }) ps = [] for type, paths in type_paths.items(): if all(dep_util.check_image_existence(p) != "" for p in paths): ps.append(type) return ps
def update_buttons(self, gb): """Enables buttons and dropdowns according to whether or not data is present. Args: gb (QtWidgets.QGroupBox): Group box for the tab. """ dlg = self.dlg ignore = [dlg.dd_export_farm_workers, dlg.dd_export_farm_ec2] if self.is_viewer_rift_hidden: ignore.append(dlg.btn_export_data_rift_view) if self.is_viewer_smr_hidden: ignore.append(dlg.btn_export_data_smr_view) if self.parent.is_aws: dlg.btn_export_farm_terminate_cluster.setEnabled( bool(len(common.get_aws_workers()))) common.update_buttons(self, gb, ignore) if not self.is_viewer_rift_hidden: has_fused = dep_util.check_image_existence(self.path_fused) != "" dlg.btn_export_data_rift_view.setEnabled(has_fused)