I’ve added a property in Skeleton.h:
// Additions //
public:
UPROPERTY(BlueprintReadOnly, Category = "Universal Rig")
UUniversalRig* RigDefinition = nullptr;
In USkeleton::USkeleton() in the cpp
if (!RigDefinition)
{
UE_LOG(LogTemp, Warning, TEXT("New RigDefinition. Skeleton::Skeleton()"));
RigDefinition = NewObject();
RigDefinition->InitUniversalRig(this);
}
In UE4 editor, it’s saved, I can close the SkeletonEditor tab and reopen it, and it’s still the same object.
When I close the UE4 editor and reopen though, the pointer has been nullified. When the USkeleton::USkeleton() is called, it successfully creates a new object.
But trying to access that object for via IDetailsView->SetObject(), it crashes the editor with “EXCEPTION_ACCESS_VIOLATION” even though it has
DetailsView = FModuleManager::GetModuleChecked("PropertyEditor").CreateDetailView(DetailsViewArgs);
if (InRigAsset)
{
UE_LOG(LogTemp, Warning, TEXT("Rig Asset is valid (UniversalRigEditor::Construct())"));
DetailsView->SetObject(InRigAsset);
ChildSlot
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
DetailsView.ToSharedRef()
]
];
} else
{
UE_LOG(LogTemp, Warning, TEXT("Rig Asset is null"));
}
I’m self taught when it comes to programming, so there’s a lot of critical knowledge I simply don’t have I’m sure, but it’s my understanding that all UPROPERTY() variables are serialized, so I’m at a bit of a loss.