def draw(self, context): layout = self.layout if not pkt.is_installed(): self._draw_start_panel(layout) return state, headnum = what_is_state() if headnum >= 0 and FBLoader.is_not_loaded(): FBLoader.load_model(headnum) if state == 'PINMODE': # Unhide Button if Head is hidden in pinmode (by ex. after Undo) if not FBLoader.viewport().wireframer().is_working(): row = layout.row() row.scale_y = 2.0 row.alert = True row.operator(Config.fb_unhide_head_idname, icon='HIDE_OFF') return elif state == 'RECONSTRUCT': self._draw_reconstruct(layout) return elif state == 'NO_HEADS': self._draw_start_panel(layout) return else: self._draw_many_heads(layout) if not FBUpdater.has_response_message(): FBUpdater.init_updater()
def test_download_latest_nightly(use_progress_callback): try: if use_progress_callback: def testing_progress_callback(progress): assert (testing_progress_callback.last_progress <= progress <= 1) testing_progress_callback.last_progress = progress testing_progress_callback.last_progress = 0 else: testing_progress_callback = None pkt.install_from_download(nightly=True, progress_callback=testing_progress_callback) if use_progress_callback: assert (testing_progress_callback.last_progress == 1.0) except Exception: # can fail with no network return assert (pkt.is_installed()) pykeentools = pkt.module() assert (isinstance(pykeentools.__version__, str)) pkt.uninstall()
def _show_all_panels_no_blendshapes(): if not pkt.is_installed(): return False state, headnum = what_is_state() if not _state_valid_to_show(state): return False settings = get_main_settings() return settings.get_head(headnum).has_no_blendshapes()
def draw(self, context): layout = self.layout if not pkt.is_installed(): self._draw_accept_license_offer(layout) else: self._draw_version(layout) # self._draw_license_info(layout) self._draw_download_progress(layout)
def init_updater(cls): if cls.has_response_message() or not pkt.is_installed(): return uc = cls.get_update_checker() res = uc.check_for_updates('FaceBuilder') # res = cls.get_response() # Mock (2/2) if res is not None: cls.set_response(res) parsed = parse_html(skip_new_lines_and_spaces(res.message)) cls.set_parsed(parsed)
def _license_was_accepted(self): return pkt.is_installed() or self.license_accepted
def test_uninstall(): pkt.uninstall() assert (not pkt.is_installed())
def test_wrong_installations(): with pytest.raises(FileNotFoundError): pkt.install_from_file('some/non/existing/file.zip') with pytest.raises(Exception): pkt.install_from_file(__file__) assert (not pkt.is_installed())
def poll(cls, context): if not pkt.is_installed(): return False state, _ = what_is_state() return _state_valid_to_show(state) or state == 'FACS_HEAD'
def _show_all_panels(): if not pkt.is_installed(): return False state, _ = what_is_state() return _state_valid_to_show(state)
def _draw_start_panel(self, layout): if not pkt.is_installed(): self._pkt_install_offer(layout) else: self._head_creation_offer(layout)