Description

When using the Subobject Data Subsystem (Engine\Source\Editor\SubobjectDataInterface\Public\SubobjectDataSubsystem.h), we often have to work with an instance of FSubobjectData (Engine\Source\Editor\SubobjectDataInterface\Public\SubobjectData.h), for which we make use of the blueprint-exported functions in USubobjectDataBlueprintFunctionLibrary (Engine\Source\Editor\SubobjectDataInterface\Public\SubobjectDataBlueprintFunctionLibrary.h).

Suppose we have a blueprint BP_Parent, which contains a StaticMeshComponent (or any other Component). And we also have a blueprint BP_Child, which derived from BP_Parent and thus inherits that component. When accessing BP_Child using the SubObjectDataSubsystem, an Editor Utility may need to get the component object to change some property on it. In this situation, the method FSubobjectData::GetObject() returns a pointer to a component in BP_Parent, which is expected. On the other hand, the method FSubobjectData::GetObjectForBlueprint() seems to be the one intended to access the inherited component in BP_Child. However, that function currently returns null in this case. This seems to happen because, internally, it fails a CanEdit() test, which for some reason returns true only for components added to actor instances inside the level editor (not for components added to actor blueprints). As a result, it is currently impossible for an Editor Utility to access inherited components though the currently blueprint-exposed API

Steps to Reproduce
  • Download the attached repro project
  • In the content drawer, select "BP_Parent" and "BP_Child"
  • "BP_Parent" is derived from "Actor" and has a StaticMeshComponent with "Visible" set to "true".
  • "BP_Child" is derived from "BP_Parent" and its inherited StaticMeshComponent has "Visible" set to "false".
  • Right-click on one of them, then choose "Scripted Asset Actions – Print Info"
  • Output:
  • Blueprint Object = BP_Child | Parent Mesh Visible = true | Child Mesh Object = None
  • Blueprint Object = BP_Parent | Parent Mesh Visible = true | Child Mesh Object = None
  • It is expected that Parent Mesh Visible = true on both cases.
  • It is not expected that Child Mesh Object is None on either case.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-196994 in the post.

1
Login to Vote

Fixed
ComponentUE - Gameplay - Components
Affects Versions5.3
Target Fix5.4
Fix Commit29967258
CreatedOct 3, 2023
ResolvedDec 11, 2023
UpdatedJan 19, 2024