Hello. I have made code changes to add UTexture2D to the nodes. It works, but only with already created dialogs (The already created dialogs allow me to select a texture for the node.). When I try to create and save a new dialog asset, I get an editor crash.
Dialogue.h
USTRUCT(BlueprintType)
struct FDialogueNode
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue Node")
int32 id = -1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue Node")
bool isPlayer = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue Node")
FText Text;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue Node")
UTexture2D* TextureCard;
DialoguePluginEditorDetails.cpp
...
const TSharedPtr<IPropertyHandle> ConditionsField = Child->GetChildHandle("Conditions");
const TSharedPtr<IPropertyHandle> SoundField = Child->GetChildHandle("Sound");
const TSharedPtr<IPropertyHandle> DialogueWaveField = Child->GetChildHandle("DialogueWave");
const TSharedPtr<IPropertyHandle> TextureCardField = Child->GetChildHandle("TextureCard"); // my edit
CurrentNodeCategory.AddProperty(IsPlayerField);
CurrentNodeCategory.AddProperty(DrawCommentBubble);
CurrentNodeCategory.AddProperty(Comment);
CurrentNodeCategory.AddProperty(EventsField);
CurrentNodeCategory.AddProperty(ConditionsField);
CurrentNodeCategory.AddProperty(SoundField);
CurrentNodeCategory.AddProperty(DialogueWaveField);
CurrentNodeCategory.AddProperty(TextureCardField); // my edit
.
Summary
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
UnrealEditor_Engine!UE::Transaction::FPersistentObjectRef::FPersistentObjectRef() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\TransactionCommon.cpp:37]
UnrealEditor_Engine!UE::Transaction::FSerializedObjectDataWriter::operator<<() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\TransactionCommon.cpp:302]
UnrealEditor_Core!FStructuredArchiveSlot::operator<<() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Serialization\StructuredArchiveSlots.cpp:260]
UnrealEditor_CoreUObject!FObjectProperty::SerializeItem() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\PropertyObject.cpp:119]
UPD: I changed the code to
UTexture2D* TextureCard = nullptr;
and now the editor doesn’t crash. Strange that without nullptr it worked in already created in assets.
