Untitled

mail@pastecode.io avatar
unknown
python
a year ago
467 B
48
Indexable
Never
import bpy
from functools import partial

def progress(area):
    if progress.i >= 100:
        area.header_text_set(None)
        return
    else:
        area.header_text_set('Loading ' + progress.bar + " " + str(progress.i) +"%")
        progress.i += 0.5
        progress.bar = "█"*int(progress.i)+"░"*(100-int(progress.i))
        return 0.01
    
progress.bar = ""
progress.i = 0

bpy.app.timers.register(partial(progress, bpy.context.area))