# Copyright Buckley Builds LLC 2026 All Rights Reserved.

# add_interface.txt — Implement (and later remove) a Blueprint Interface on a Blueprint.
#
# Sample script for the blueprints skill. Run via execute_python_code.
# Prefer the FULL interface asset path — short names only resolve if already loaded.
# The interface must be a true Blueprint Interface (made with BlueprintInterfaceFactory).
import unreal
bs = unreal.BlueprintService

BP_PATH = "/Game/Blueprints/BP_Player"
INTERFACE_PATH = "/Game/Interfaces/BPI_Interactable"   # full path

print("add:", bs.add_interface(BP_PATH, INTERFACE_PATH))   # idempotent; False if not a real BP interface
unreal.EditorAssetLibrary.save_asset(BP_PATH)

# Interface functions now appear as overridable — implement one:
# bs.override_function(BP_PATH, "OnInteract")

# To remove later:
# bs.remove_interface(BP_PATH, INTERFACE_PATH)
# unreal.EditorAssetLibrary.save_asset(BP_PATH)
