Let’s say that you inherit from something like ACharacter. Going forward, you don’t want to allow any blueprints to be created from or inherit from ACharacter, only from your new class. Is there any way, without modifying the engine code, to either change the parent class from Blueprintable to NotBlueprintable or otherwise remove it from the editor?
The only way is to use the “Hidden” specifier in the class header. This will prevent any further Blueprints from inheriting your C++ class (tho existing blueprints will be fine).
UCLASS(BlueprintType, Hidden)
class ....
If you want to do that on an engine class, you’ll need to edit engine source.
Yeah, that’s what it seems to be. I was hoping for something like “ParentNotBlueprintable” the overrides the tag on the parent class.
You can make an editor module to modify metadata tags of existing classes at runtime.
Something like this
#include "EdGraphSchema_K2.h"
void FMyEditorModule::StartupModule()
{
ACharacter::StaticClass()->SetMetaData(FBlueprintMetadata::MD_IsBlueprintBase, TEXT("false"));
}
You might actually want an abstract class for this from the sounds of it.
UCLASS(Abstract)
1 Like