Enum Arrays don't copy

Hi , this is a fairly easily reproducible bug.

If you make an array of custom enum and assign them to a placed actor any attempt to copy the entire array will fail.

Hi Frozenfire,

Unfortunately, I have not been able to reproduce this error on my end. I have tried several methods to copy a custom enum array. I’ve duplicated within a single blueprint, copied/pasted get nodes in the blueprint, copied set nodes within the blueprint. After this, I tried copying get nodes and set nodes between two separate blueprints. All of these copied and pasted without any errors. Is there anything else I can try to recreate this on my end?

Apologies. I seems to have mixed up the causative factor.

Enums array in a structure don’t copy.
I zipped a test project.
FYI I am using 4.11.

Just try copying values from either one to each other. The enum will not copy correctly.

  1. Copying entire structure results in enum not copied correctly.

  2. Copying Array of Enum within the structure and manually pasting it will not work as well.

link text

I’m having a bit of difficulty following. Where are you copying the array? Where are you pasting it to? Did you copy a variable of the enum from a struct get variable or is there another step I am missing?

I’m copying the property of one actor to another.

Both the actor in the test project have a structure. and array enums in that structure.

Scenario 1:

Copy Structure from Actor 1 → Paste to Actor 2’s structure.

Scenario2:

Copy Enum ( in the structure ) from Actor 1 → Paste to Enum ( in the structure ) of Actor 2

Hey Frozenfire,

Thank you for the bug report. I was able to reproduce this and I see what you mean. I’ve created JIRA UE-32315 and our developers will be investigating the issue further. I’ll post back here with updates as we have them.

Cheers,

TJ

Not sure if this will help but I figured out the cause of the bug. I’m mentioning this because this seems to be not fixed in 4.13.

Since blueprint-made enums are all NewEnumerator0,1,2,3 with display name.
Apparently the Editor copies the display name instead of the actual Enum name.
If you paste them to notepad and modify them to NewEnumerator1,2,3 and repaste them it’ll work.

The issue I believe is found is in

UnrealEngine/Engine/Source/Runtime/Engine/Private/UserDefinedEnum.cpp

line 109 onwards

FText UUserDefinedEnum::GetEnumText(int32 InIndex) const
{
	if (DisplayNames.IsValidIndex(InIndex))
	{
		return DisplayNames[InIndex];
	}

	return Super::GetEnumText(InIndex);
}

The super function ( in Enum.cpp ) uses GetEnumName(InIndex) instead. This will therefore produce inconsistency when copying blueprint / C++ enum.

Not sure if this will help but I figured out the cause of the bug. I’m mentioning this because this seems to be not fixed in 4.13.

Since blueprint-made enums are all NewEnumerator0,1,2,3 with display name.
Apparently the Editor copies the display name instead of the actual Enum name.
If you paste them to notepade and modify them to NewEnumerator1,2,3 and repaste them it’ll work.

This seems to be a relatively easy fix.

Hey Frozenfire,

Thank you for the additional info. I copied your comment to the JIRA as comment for the devs.

Just for reference, here is a link to the Public JIRA for this issue. Keep in mind that you won’t see the comment I made as it’s internal only.

Thanks,

TJ

This issue has no votes at the time of my post. Maybe those who raised it can go and upvote it too?