duplicate_widget
Clone a leaf widget under a target parent panel, copy matching slot properties, and reject panels with children to prevent broken aliased clones.
Instructions
Duplicate a widget (DuplicateObject outered to the WidgetTree) and add the clone under a target parent panel, copying the source's slot property values onto the new slot when the slot classes match. Refuses (clear error, no partial/broken result) to duplicate a panel widget that currently has children -- UE's object duplication would leave the clone's slots aliasing the SAME original child widgets rather than deep-copying them (see FDuplicateDataWriter); duplicate leaf widgets, or rebuild the panel's children individually with add_widget_extended. Name collisions on new_name are a clear error (not a silent alias of the pre-existing widget at that name).
Returns: { widget_bp_path: string, source_widget_name: string, new_widget_name: string, widget_class: string, target_parent_name: string, slot_class: string, slot_class_matched_source: bool, slot_properties_copied: int, duplicated: bool, saved: bool, save_error: string }
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. | |
| new_name | Yes | unique name for the duplicate | |
| widget_name | Yes | name of the widget to duplicate (must not be a panel widget with children) | |
| 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 | |
| target_parent_name | No | Optional name of the panel widget to host the duplicate; defaults to the source widget's own current parent (sibling placement). |