I have a native c++ class that whose parent class is a WidgetComponent. Then I have a Blueprint class that derives from that. I then have some more blueprints that derive from that, meaning it is a grand child of the C++ class.
What happens sometimes is if you make changes to these blueprint classes enough, Eventually you won’t be able to save them, you’ll get this error:
[Image Removed]The blacked out bit is just the widget component blueprint class.
That message means that the BP is trying to save a reference on an object that is not public. The Public assets are the one exposed in the Content Browser. In this case, BodySetup_0 is likely the internal collision object of a StaticMesh. It is ok to manipulate this object in the BP graph but it should not be assigned to one of its properties. The BP will need to retrieve the object through the StaticMesh (or StaticMeshActor\Component) API.
If you answer yes, the list of referencers to BodySetup_0 will be dumped in the log and there should be a message that try to identify the current source of references that is problematic. I can assist if you share that information.
I spent some time reading the code of UWidgetComponent and I don’t understand how the BodySetup for the CDO can be initialized. That would mean that UWidgetComponent::UpdateBodySetup is executed on the CDO and the property gets copied during some instantiation of your widget. But that should not be possible since the property is declared as DuplicateTransient which should prevent the copy of the value.
I think I found a bug that you could probably lead to a workaround when the problem happens. The bug is that changing the UWidgetComponent::Space property should result in a call to UWidgetComponent::UpdateBodySetup. The fix would be:
Once the fix is in, changing the Space property in the widget should result in the BodySetup to be recreated or destroyed depending on the final option which should get rid of the reference to the CDO object.
You actually don’t need to fix the bug to work around the problem. You only need to change any of the properties that currently trigger UpdateBodySetup so: DrawSize, Pivot, GeometryMode or CylinderArcAngle. That should be enough break the dependency on the CDO.
Okay thank you yea there is no property like that. This is just a child of WidgetComponent. I did what you said. It looks like from the logs that the bodysetup comes from the widget component. Here’s the output:
Try to find the chain of references to that object (may take some time)?
LogSavePackage: Warning:
Referencers of BodySetup DWC_TextButton.Default__DWC_TextButton_C:BodySetup_0: