← All text IRs

BPIR

Round-trip Blueprint graphs

A Blueprint event graph is a labeled directed graph - nodes wired by named exec and data pins, stored in a binary .uasset you can only really read by opening the editor and tracing wires across the canvas. BPIR is that same graph as a compact, line-based text: every node named, every branch and reconvergence spelled out. And because BPIR is round-trip, your assistant does not just read it - it edits a few lines and compiles the result straight back into the asset.

Why it matters

Diffable in version control

A graph edit becomes a handful of changed lines in a pull request instead of an opaque binary blob no reviewer can read.

Reviewable like code

Control flow is explicit: named values, labeled blocks, and [pin -> @label] targets. You see what a branch does and where it rejoins without following wires by eye.

A format an AI can author

One consistent, keyword-first language your assistant learns from a few examples - so it writes whole event and function bodies in a single call instead of dozens of blind create-node / connect-pin RPCs.

Faithful and round-trip

Every instruction preserves node identity, and authored @(x, y) positions are kept. Text back to graph is a real compile, not a lossy approximation - it runs the Blueprint compiler on success.

A taste

Named results (%name), Blueprint variables ($name), and labeled exec targets (@label) make the graph readable top to bottom - branches and their reconvergence are written out, not inferred:

entry event BeginPlay() {
    call PrintString(InString: "Hello")
    %valid = call IsValid(Object: $MyRef)
    %b = branch(%valid) [true -> @ok, false -> @end]

@ok:
    set Score = 100
    call DoSomething(Target: $MyRef)

@end:
    call PrintString(InString: "Done")
}

How your assistant uses it

It reads the current graph out with blueprint.decompile, edits the text, and compiles the change back in with blueprint.compile_bpir - a single call that replaces a long sequence of node-create and connect-pin operations:

You: In BP_Door, add an OnInteract event that plays Open and disables collision.

  call("blueprint.decompile", {path:"/Game/BP_Door"})
    → {bpir:"entry event BeginPlay() { ... }"}
  call("blueprint.compile_bpir", {path:"/Game/BP_Door",
        code:"entry custom_event OnInteract() {\n    call PlayAnimation(Anim: $OpenAnim)\n    call SetActorEnableCollision(bNewActorEnableCollision: false)\n}"})
    → {ok:true, compiled:true}

Done. OnInteract added: plays Open, disables collision.
Early Access. BPIR covers the common Blueprint node vocabulary and the long tail of K2Nodes through a generic round-trip form; unusual composite or plugin-defined nodes may need review after a compile. Decompile an existing graph to learn the exact shape before authoring an unfamiliar pattern.

← Back to all text IRs