for (TFieldIterator<UProperty> Prop(Class); Prop; ++Prop)
{
UProperty* RootProperty = *Prop;
UStructProperty* StructProperty = Cast<UStructProperty>(RootProperty);
FsProperty Item;
Item.ObjectName = ObjName;
Item.ComponentName = ComponentName;
Item.PropertyName = RootProperty->GetName();
Item.PropertyType = RootProperty->GetCPPType();
Item.PropertyValue = GetPropertyValue(isActor, Object, ActorComponent, RootProperty, StructProperty, PropertyValue, true, false);
PropertyCollection.Add(Item);
if (UStructProperty* StructProperty = Cast<UStructProperty>(RootProperty))
{
UScriptStruct* Struct = StructProperty->Struct;
for (TFieldIterator<UProperty> It(Struct); It; ++It)
{
UProperty* Property = *It;
Item.ObjectName = ObjName;
Item.ComponentName = StructProperty->GetName();
Item.PropertyName = It->GetName();
Item.PropertyType = It->GetCPPType();
//Item.PropertyValue = GetPropertyValue(isActor, Object, ActorComponent, RootProperty, Property, PropertyValue, false, false);
if (RootProperty->GetCPPType() == "FVector"){
UScriptStruct* Struct = StructProperty->Struct;
for (TFieldIterator<UProperty> It(Struct); It; ++It)
{
UProperty* Property = *It;
FString VariableName = Property->GetName();
for (int32 ArrayIndex = 0; ArrayIndex < Property->ArrayDim; ArrayIndex++)
{
>>>>>>>>>>>>> ERROR HERE <<<<<<<<<<<<<<
void* ValuePtr = It->ContainerPtrToValuePtr<void>(RootProperty->ContainerPtrToValuePtr<void>(Object), ArrayIndex);
if (UNumericProperty *NumericProperty = Cast<UNumericProperty>(Property))
{
if (NumericProperty->IsFloatingPoint())
{
Item.PropertyValue.Value_Float = NumericProperty->GetFloatingPointPropertyValue(ValuePtr);
}
else if (NumericProperty->IsInteger())
{
Item.PropertyValue.Value_Float = NumericProperty->GetSignedIntPropertyValue(ValuePtr);
}
}
}
}
}
PropertyCollection.Add(Item);
}
}
}
@CrashAngel
were you able to figure this out?
I’m trying to get UStructProperty value using ContainerPtrToValuePtr as well.
yes, it was simpler than I thought.