INNER CODE UNIT · Python
execute
untoldengine/UntoldEngine · scripts/untold-blender-addon/untold_exporter/__init__.py:171
def execute(self, context: bpy.types.Context) -> set[str]:
output_path = self._asset_output_path(self.filepath)
compression_summary = {"detail": None}
wm = context.window_manager
workspace = context.workspace
wm.progress_begin(0, 100)
def progress(stage: str, done: int, total: int, detail: str) -> None:
if stage == "Compress geometry" and done >= total:
compression_summary["detail"] = detail
percent = (100.0 * done) / max(total, 1)
suffix = f" - {detail}" if detail else ""
wm.progress_update(percent)
workspace.status_text_set(f"Untold Export: {stage} {percent:5.1f}%{suffix}")
print(f"[Untold Exporter] {percent:5.1f}% {stage}{suffix}", flush=True)
# Force the status bar to redraw now; the UI does not refresh on
# its own while this blocking export operator is running.