ArticyXImporter
ArticyXImporter for Unreal Engine
Loading...
Searching...
No Matches
FArticyRef Struct Reference

Public Types

enum  EStringInitResult { NoneSet , IdSet , RefSet , AllSet }

Public Member Functions

void SetId (FArticyId NewId)
void SetReference (UArticyObject *Object)
const FArticyIdGetId () const
template<typename T = UArticyObject>
T * GetObject (const UObject *WorldContext) const
uint32 GetEffectiveCloneId () const
EStringInitResult InitFromString (const FString &SourceString)
FString ToString () const
bool operator== (const FArticyRef &Other) const
bool MatchesRaw (const FArticyRef &Other) const
bool MatchesEffective (const FArticyRef &Other) const
bool operator!= (const FArticyRef &Other) const

Public Attributes

bool bReferenceBaseObject = true
int32 CloneId = 0

Friends

uint32 GetTypeHash (const FArticyRef &Ref)

Member Function Documentation

◆ GetObject()

template<typename T>
T * FArticyRef::GetObject ( const UObject * WorldContext) const

Get a (single-instance) copy of the referenced asset.

◆ MatchesEffective()

bool FArticyRef::MatchesEffective ( const FArticyRef & Other) const
inline

Used to compare effective data; will act as if CloneID was 0 when bReferenceBaseObject = true.

◆ MatchesRaw()

bool FArticyRef::MatchesRaw ( const FArticyRef & Other) const
inline

Used to compare raw data; CloneID might have different values between two ArticyRefs that have bReferenceBaseObject = true.

◆ operator==()

bool FArticyRef::operator== ( const FArticyRef & Other) const
inline

Is used in hash operations, and in that case we want to know about effective data rather than literal data, so a 'hidden' CloneID (bReferenceBaseObject = true) does not influence the comparison

◆ ToString()

FString FArticyRef::ToString ( ) const
inline

TODO The ToString function is used to update Refs in the property system. When determining if a ref is the same as another ref in a TMap in BP, the ExportItem function is used and strings are compared The ExportItem function delivers Strings like below, but without spaces. Therefore it is possible to insert 2x the same ArticyRef. However, when we remove the spaces, typical BP Map problems start existing. If CharacterA Base = true exists, you can't add another CharacterA (because Base would be initialized to true) Keep it like it is for now, as compiling will remove the duplicates.

Future fixes: When Base is set to true, just set CloneId to 0 (data loss) Or use another ToString function that only works with effective data, not literal data! Same goes for FArticyId!

Member Data Documentation

◆ CloneId

int32 FArticyRef::CloneId = 0
mutable

The currently assigned clone ID. Use


The documentation for this struct was generated from the following files:
  • Source/ArticyRuntime/Public/ArticyRef.h
  • Source/ArticyRuntime/Private/ArticyRef.cpp