set_widget_slot_properties
Set anchors, offsets, position, size, z_order, or auto_size on a widget's CanvasPanelSlot in a Widget Blueprint, then compile, save, and read back the slot.
Instructions
Set the CanvasPanelSlot layout of a widget inside a CanvasPanel of a Widget Blueprint asset -- anchors, offsets, position, size, z_order and auto_size, only those passed -- then compile and save the blueprint; the reply reads the whole slot back. position and size write the same fields as offsets (Left/Top and Right/Bottom) and are applied after it, so they win when both are given. A widget not under a CanvasPanel, or a call with none of the six fields, is an error. Refused while PIE runs unless force=true. For other slot types use set_box_slot_properties, set_grid_slot_properties or set_slot_properties.
Returns: { widget_bp_path: string, widget_name: string, anchors_set: bool, offsets_set: bool, position_set: bool, size_set: bool, z_order_set: bool, auto_size_set: bool, current_anchors: [float], current_offsets: [float], current_position: [float], current_size: [float], current_z_order: int, current_auto_size: bool, saved: bool, save_error: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Optional [X, Y] size. | |
| 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. | |
| anchors | No | Optional [MinX, MinY, MaxX, MaxY] anchor floats. | |
| offsets | No | Optional [Left, Top, Right, Bottom] offset floats. | |
| z_order | No | Optional int draw/hit-test order (higher draws on top); use with reorder_widget_child's note for CanvasPanel stacking. | |
| position | No | Optional [X, Y] position. | |
| auto_size | No | Optional bool: when true, the slot sizes itself to the widget's desired size instead of `size`. | |
| widget_name | Yes | name of the widget whose canvas slot to edit | |
| blueprint_name | No | Alias of `widget_bp_path` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `widget_bp_path`. | |
| widget_bp_path | No | /Game path of the Widget Blueprint asset |