Download

Can I still use the Blueprint when I delete a component from its parent C++ class?

Hi guys,

I created a C++ class, and then created a Blueprint that inherited the class. Now I modified the C++ class (remove a component: delete its declaration in .h file and related statements in constructor from .cpp file). The created Blueprint still has the removed component. If I created a new Blueprint from the modified C++ class, the removed component is actually removed.

However, if there is some way that I can make the original Blueprint remove the component that I changed in the code? Because I already modified too much parameters and created too much graph nodes on that Blueprint, don’t want to create a new one and do that again.

Generally, if I change the parent C++ code, does the previous generated Blueprint change its logic automatically? Or I have to create a new one?

Thank you!

In an effort to bump this post, let me add my own similar issue.

I’m on 4.3. I added a component to a c++ class that a blueprint inherits from just as you did. It became the root component. Then I deleted the component from c++. Now when I launch the editor, it crashes. If I add the component back, the crash goes away. I thought maybe I needed to use some sort of redirector, but there doesn’t appear to be much documentation on it as it pertains to objects.

Here’s the call stack if that helps:

> UE4Editor-Core.dll!FMallocTBB::Realloc(void * Ptr, unsigned __int64 NewSize, unsigned int Alignment) Line 93 C++
UE4Editor-CoreUObject.dll!TArray<wchar_t,FDefaultAllocator>::AddUninitialized(int Count) Line 901 C++
UE4Editor-CoreUObject.dll!CreatePackage(UObject * InOuter, const wchar_t * PackageName) Line 414 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2154 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::VerifyImport(int i) Line 1945 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2183 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::VerifyImport(int i) Line 1945 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::CreateExport(int Index) Line 2906 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::IndexToObject(FPackageIndex Index) Line 3385 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::operator<<(UObject * & Object) Line 3556 C++
UE4Editor-CoreUObject.dll!UObjectProperty::SerializeItem(FArchive & Ar, void * Value, int MaxReadBytes, const void * Defaults) Line 23 C++
UE4Editor-CoreUObject.dll!UArrayProperty::SerializeItem(FArchive & Ar, void * Value, int MaxReadBytes, const void * Defaults) Line 77 C++
UE4Editor-CoreUObject.dll!FPropertyTag::SerializeTaggedProperty(FArchive & Ar, UProperty * Property, unsigned char * Value, int MaxReadBytes, unsigned char * Defaults) Line 133 C++
UE4Editor-CoreUObject.dll!UStruct::SerializeTaggedProperties(FArchive & Ar, unsigned char * Data, UStruct * DefaultsStruct, unsigned char * Defaults) Line 1098 C++
UE4Editor-CoreUObject.dll!UObject::SerializeScriptProperties(FArchive & Ar) Line 857 C++
UE4Editor-CoreUObject.dll!UObject::Serialize(FArchive & Ar) Line 805 C++

I found this on AnswerHub: https://answers.unrealengine.com/questions/2433/changing-components-in-c-doesnt-remove-old-ones-fr.html

I was able to use it to fix my issue.