set_bp_variable_default
Set a Blueprint-declared variable's default value, writing the live CDO and serialized description so it survives save/reload. Inherited variables are refused.
Instructions
Set the default value of a variable DECLARED on this Blueprint: writes the live CDO and mirrors the result back into the serialized variable description so it survives save/reload. LIMIT (not a lie, a hard boundary): it CANNOT touch an INHERITED variable -- it answers "Variable 'X' is not declared on this blueprint" -- so the "child that only overrides a parent default" pattern needs the CDO route (execute_python + set_editor_property + compile_blueprint + save). And on a class with actors already placed in a level, the placed instances keep their serialized value: verify on the instances, never on the CDO.
Returns: { blueprint_name, variable_name, default_value, roundtrip_verified } -- default_value is re-exported from the CDO after the write, so it is the real stored value. WARNING: roundtrip_verified:false means the exported text does NOT re-import into the type (e.g. FGameplayTagContainer): the CDO holds the right value and the compiler's property copy carries it, but the serialized description was deliberately left empty because feeding an unparseable string back through a Full compile ZEROES the default. Verify that variable on the CDO after compiling, and prefer wiring it in the graph if it must survive a fresh regeneration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| value | No | New default in exported-text form, parsed into the variable's type; empty allowed. A value the type cannot parse is an error AND the previous value is restored (the engine's struct import zeroes the target before parsing, so a failed parse wipes the CDO). | |
| variable_name | Yes | Name of a variable declared on THIS Blueprint (inherited ones are refused) | |
| blueprint_name | No | Blueprint asset name or path | |
| blueprint_path | No | Alias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`. |