Hi there,
I found out an issue that under certain situation assets in Child Blueprint (Inherit from another blueprint) is not loaded properly.
I have uploaded a repro project, so I’ll describe the problem based on that repro project.
Preparation / Description of Repro Project:
- Have two StaticMesh assets with the SAME name but under different folder:
- Content/Asset_1/TestCube
- Content/Asset_2/TestCube
- Assign a different material to one of the Asset_2/TestCube
[Image Removed]
- Create a blueprint inherited from Actor, name it BP_Parent.
- Add StaticMeshComponent, and assign StaticMesh as /Asset_1/TestCube
- Create a blueprint inherited from BP_Parent, name it BP_Child.
- Assign the StaticMesh property as /Asset_2/TestCube.
- Save everything and close the Project.
Repro Steps:
- Open the project, open BP_Child and click Open Full Blueprint Editor.
- You can see the static mesh reference becomes /Asset_1/TestCube instead of /Asset_2/TestCube.
[Image Removed]
- Now if you close the project and open it again.
- This time open either /Asset_1/TestCube or /Asset_2/TestCube, to make sure one of them is loaded
- Then open BP_Child and you can see the Static mesh is properly loaded as /Asset_2/TestCube
[Image Removed]
Investigation
In UInheritableComponentHandler::ValidateTemplates(), it is checking IsRecordNecessary for each component.
And when it is checking StaticMesh property for StaticMeshComponent against the template (BP_Parent), because both StaticMesh assets have the same name, it needs to check Deep Comparison in FObjectPropertyBase::StaticIdentical.
However, either /Asset_1/TestCube or /Asset_2/TestCube is fully loaded at this point. StaticMaterials which should be the only difference, is empty for both of them. Deep comparison will return true, and eventually IsRecordNecessary returns false and cause the problem.
We also see this issue in cooking process as well, but this is the easiest repro case we found.
Thank you!