set_data_layer_parent
Set or clear a World Partition data layer instance's parent in Unreal Editor by asset path; omit the parent path to detach it to the root.
Instructions
Sets (or clears) the parent of a data layer instance in the editor world's World Partition (twin of create_data_layer_instance). Uses UDataLayerEditorSubsystem::SetParentDataLayer, verified by read-back (GetParent() must equal the requested parent). Both instances are resolved from their UDataLayerAsset paths (create the instances first via create_data_layer_instance). Pass parent_data_layer_asset_path empty/omitted to detach (reparent to root). Requires a World Partition world; on a non-WP (default) map this returns an honest error (no editor-world swap). Idempotent: already_parented=true when the instance already had the requested parent. Note: SetParentDataLayer returns false (parented=false) when the engine rejects the relationship (CanBeChildOf()==false, e.g. a runtime child under an editor parent or a cycle); the read-back reports the honest result.
Returns: { data_layer_asset_path: string, parent_data_layer_asset_path: string, instance_name: string, parent_instance_name: string, parented: bool, already_parented: bool, note?: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data_layer_asset_path | Yes | Full /Game path to the child UDataLayerAsset (its instance must exist in the world). | |
| parent_data_layer_asset_path | No | Full /Game path to the parent UDataLayerAsset (its instance must exist in the world). Omit or pass empty to clear the parent (reparent to root). |