"Directions are not compatible" error breaks compilation in 4.12

I did a cautious update from 4.11 to 4.12 on one machine today to check my project on the new version. The project is a mixed C++ / BP project. It compiles in VS 2015/SP 3 without error.
When running, I now get a bunch of identical errors. All errors are in Animation BPs in the EventGraph section.
I did not change anything and the program runs under 4.11 without problems.
The first picture shows the error in the BP:

The second picture shows the function that is being called. It is a call into a BP function library that I made.

Since there was no change in either program or BP this must be some sort of bug.

Hey ,

Upgrading to a new version can always cause some issues. Can you try deleting one of the nodes that are giving you an error and re-doing it with the same node and then recompiling the Animation Blueprint?

Yes that was the first thing I tried. The new node gave the same error

Hey ,

There are a lot of duplicates of the function that gives this error, depending on the “GraphScheme” that the Blueprint node is used for. I am guessing yours is just a normal Blueprint function.

// Categorizes two pins into an input pin and an output pin.  Returns true if successful or false if they don't make sense as such (two inputs or two outputs)
template<typename PinType>
static bool CategorizePinsByDirection(PinType* PinA, PinType* PinB, /*out*/ PinType*& InputPin, /*out*/ PinType*& OutputPin)
{
	InputPin = NULL;
	OutputPin = NULL;

	if ((PinA->Direction == EGPD_Input) && (PinB->Direction == EGPD_Output))
	{
		InputPin = PinA;
		OutputPin = PinB;
		return true;
	}
	else if ((PinB->Direction == EGPD_Input) && (PinA->Direction == EGPD_Output))
	{
		InputPin = PinB;
		OutputPin = PinA;
		return true;
	}
	else
	{
		return false;
	}
}

By the comment, for some reason that Blueprint node has conflicting input/output pins, such as only input or only output. My first guess is to try removing the “ExpandEnumAsExec” Meta from the UFUNCTION Macro and re-compile. Then, see if the node still gives an error. If it doesn’t give an error without that Meta command, try adding it back and see if it persists. If it does, please update your post.

I will try and track down a fix or work around if it continues to be an issue for you.

Since this function is used extensively in my whole program, I made a copy of it GetCharacterSubobjectVolatile2() to experiment.
First I created the new function with identical parameters without the meta tag and then replaced one of the original calls with it. This version compiles in BP without error.
When I add the meta tag the same error happens again.

I should add that I use the same function a lot throughout actor BPs without problems. The error only occurs when used in an animation BP. So it must have something to do with the location where it is used.

In order for me to create some repro steps, can you post a chunk of the code that is causing the issue? This would include the function declaration (as you have in the screenshot). All of the argument types of the function (US_SUBCLASS_CHARACTER_VOLATILE and FE_ITEM_FOUND_TYPE). And, the function itself.

If this is not possible, can you create a small project that displays the same behavior that I can download?

Thanks.

I compiled the respective datatypes and the code in a compressed form, leaving out repeated datatypes like about 30 more boolean flags, but the general content of this function is here.
I would assume that if you create a BP function library and within it a function with this definition and call it from an animation BP you should get the same results.

I include the respective code below.

UENUM( BlueprintType )
enum FE_ITEM_FOUND_TYPE
{
	FOUND			UMETA( DisplayName="FOUND" ),
	NOTFOUND		UMETA( DisplayName="NOTFOUND" )
};



UENUM( BlueprintType )
enum class FE_KARMA_GENERAL : uint8
{
	RED							UMETA( DisplayName = "RED" ),
	GRAY						UMETA( DisplayName = "GRAY" ),
	BLUE						UMETA( DisplayName = "BLUE" ),
	E_MAX		                UMETA( DisplayName = "E_MAX" )
};




UCLASS( BlueprintType )
class CLIENT_API US_SUBCLASS_CHARACTER_VOLATILE : public UObject
{
	GENERATED_BODY()
public:

	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		int32							ActualHitpoints;

	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		int32							ActualMana;

	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		int32							ActualArrows;

	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		int32							ActualBullets;

	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		bool							IsGhost;
	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		bool							CanWalk;

	UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = "Mikaboshi|Characters" )
		FE_KARMA_GENERAL				Karma;

};





void UObjectManager::GetCharacterSubobjectVolatile( int32 CharacterID, US_SUBCLASS_CHARACTER_VOLATILE *&SubobjectData, TEnumAsByte<FE_ITEM_FOUND_TYPE> &Branches )
{
	CharacterInMCPFormat		*l_Original_Object;

	// ################################################################################
	// Check if there is an object with the ID. If not, return an error
	// ################################################################################
	auto ci_position = DATA->m_ObjectID_2_Character.find( CharacterID );
	if ( ci_position == DATA->m_ObjectID_2_Character.end() )
	{
		Branches = FE_ITEM_FOUND_TYPE::NOTFOUND;
		return;
	}
	l_Original_Object = ci_position->second;
	SubobjectData = NewObject<US_SUBCLASS_CHARACTER_VOLATILE>();

	SubobjectData->ActualHitpoints = l_Original_Object->mc_volatile.mu16_actual_hitpoints;
	SubobjectData->ActualMana = l_Original_Object->mc_volatile.mu8_actual_mana;
	SubobjectData->ActualArrows = l_Original_Object->mc_volatile.mu8_ammunition_arrows;
	SubobjectData->ActualBullets = l_Original_Object->mc_volatile.mu8_ammunition_bullets;

	SubobjectData->IsGhost = ( l_Original_Object->mc_volatile.m_Bitflags & 0B00000001 ) != 0;
	SubobjectData->CanWalk = ( l_Original_Object->mc_volatile.m_Bitflags & 0B00000010 ) == 0;

	if ( l_Original_Object->mc_volatile.ms16_karma < -D_KARMA_GREY_BOUNDARY )
	{
		SubobjectData->Karma = FE_KARMA_GENERAL::RED;
	}
	else {
		if ( l_Original_Object->mc_volatile.ms16_karma > D_KARMA_GREY_BOUNDARY )
		{
			SubobjectData->Karma = FE_KARMA_GENERAL::BLUE;
		}
		else {
			SubobjectData->Karma = FE_KARMA_GENERAL::GRAY;
		}
	}


	Branches = FE_ITEM_FOUND_TYPE::FOUND;

}

Hey ,

Thank you for your patience and information provided. I have recreated the issue and it is currently being logged at https://issues.unrealengine.com/issue/UE-33884

I’m getting the same error with my set of enums