add_component_to_blueprint
Add a component to a Blueprint's SCS with optional relative transform and parent, then compile. Verify placement with get_blueprint_scs_tree, as the tool may report success without persisting.
Instructions
Add a component to a Blueprint's SCS (engine class or a Blueprint AC_* class) with an optional relative transform and parent, then compile. TRAP 1: on a CHILD Blueprint whose scene root is INHERITED, a SCENE component can end up written into the PARENT's SCS (source:"inherited", owner_class = the parent) -- which silently edits a vendor/library asset; non-scene ActorComponents land correctly on the child. TRAP 2: a scene component of a BLUEPRINT class, or one given a location, can report success without persisting and then materialize LATER as a duplicate. Both have the same oracle: get_blueprint_scs_tree right after, checking owner_class and source of the new node -- never the return value.
Returns: { component_name: string, component_type: string } -- an ECHO of the request with no owner, no source and no verification. It says nothing about WHERE the node landed: read get_blueprint_scs_tree afterwards.
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. | |
| scale | No | Optional [x, y, z] relative scale for scene components | |
| location | No | Optional [x, y, z] relative location for scene components | |
| rotation | No | PREFERRED: the OBJECT {"roll":R,"pitch":P,"yaw":Y} (any subset, absent axes are 0). The ARRAY form below is [pitch, yaw, roll] -- its index 2 is ROLL, NOT yaw, which once put a PlayerStart on its side. Optional [pitch, yaw, roll] relative rotation for scene components | |
| transform | No | Optional {"location":[x,y,z], "rotation":[p,y,r], "scale":[x,y,z]} alias for scene components; any flat location/rotation/scale arg above wins over the matching axis in here if both are given. | |
| socket_name | No | Optional socket/bone name on the parent (AttachToName) | |
| blueprint_name | No | Name of the blueprint | |
| blueprint_path | No | Alias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`. | |
| component_name | Yes | Name for the new component instance | |
| component_type | Yes | Component class: a native short name ('StaticMesh', 'Box', 'Sphere'), a /Script path ('/Script/Engine.StaticMeshComponent'), OR a Blueprint component class given as its object path ('/Game/.../AC_Foo.AC_Foo_C'), a bare package path ('/Game/.../AC_Foo'), or a bare '<Name>_C' ('AC_Foo_C'). | |
| parent_component_name | No | Optional parent for scene components; omit / "root" attaches under the Blueprint's EXISTING scene root (SCS or native) instead of force-adding a second orphan root node. May also name a NATIVE inherited scene component (e.g. ACharacter's "CharacterMesh0"), mirroring attach_blueprint_component. Ignored for non-scene ActorComponents (no transform, no hierarchy to join). |