Why can we not assign Blueprint to TSubclassOf?

For example, the code below…

	// Factory
	UFUNCTION(BlueprintPure, Category=Message)
	static UMessageDataObject* CreateMessageDataObject(TSubclassOf MessageDataObjectClass);

The only way I can see to assign that Blueprint node with a Blueprint class is by making a variable in the Blueprint, assigning that Blueprint with a Blueprint class and then using a Get node to then assign it. It seems rather round about having to do it this way. It’d be nice if we could just press the arrow button with a Blueprint selected in the Content Browser and just have it set. Bringing the context menu up only allows you to set compiled classes.

The back end clearly works, it’s just the UI interface that doesn’t allow you to do it.

A programmer has been requested to answer your question. Thanks for your patience.

No problems. I’ll see if I can repeat the behavior in UE4. If I can, I may attempt a fix myself.

Hi James -

The inability to do that directly as you describe is a temporary limitation, stemming from the engine’s handling of cyclic dependencies between blueprints. The good news is that the fix for this is in the pretest pipeline, and once that’s in, you’ll be able to assign the class to any class, blueprint or non-blueprint, exactly the same. The limitation there was to force you to use the roundabout method, and prevent you from accidentally making a cyclic dependency in your blueprint that would cause data loss under the current system.

Thanks!

Ah, so the cyclic dependencies rears its head again. Thanks for the answer Nick.