Skip to content

armgit / BUI

Public Imported from GitHub
0

Blender's GPU Accelerated UI, Decoupled from it's original codebase. Supports Rust, Python, JS, React, C & C++. Twice as good as GPUI

666 B
Raw Blame
"""Benchmark app, Blender components: the shared small UI. Prints "ready" once
the first frame is on screen, then idles until the harness stops it."""
from blenderui import host
from blenderui.components import App, Button, Checkbox, Label, NumberSlider, Panel, TextField

app = App("bench", (360, 260),
          Panel("Settings",
                TextField("Name", "Cube"),
                Checkbox("Shadows", True),
                NumberSlider("Strength", 1.0, min=0, max=10)),
          Button("Apply"))
win = app.open()


def poll():
    if win.frames > 0:
        print("ready", flush=True)
    else:
        win.after(1, poll)


win.after(1, poll)
host.run()