I had a look at this when you first posted, started to write something and then decided it was way above my head. I guess I’m not 100% sure what it is you want to do. Maybe if you added the code for the declarations of your types (UGAAttributesBase, FGAAttribute, FGAAttributeBase) so the relationship between them is clear, it might make your intention clearer.
UGAAttributeBase is to big to post it here, but beyond that one function it doesn’t have any particular relevance here.
FGAAttributeBase is struct containg information about attribute (BaseValue, CurrentValue, Values of modifiers).
FGAttribute have single property called Name (;.
In any case I think I have figured out solution, I could access properties indirectly, since I should be able to find any UPROPERTY() inside USTRUCT(), I can get it’s numeric value and set it.
Though, this case will require performing at very least 2 searches (find struct, find property inside struct).
I had a little look through the engine code, and honestly it looks like what you are doing should work to me. If you check the implementation of UProperty::ContainerPtrToValuePtrInternal, it’s just adding on the byte offset of the property to the pointer to the outer UCLASS object that you give it. So I’d expect you’d end up with a casted direct pointer to the struct property. Did you check that the FindField call is returning what you’re after? You didn’y say in what way this isn’t working, so it’s hard to say more.
And it work. But only on primitive properties like float, int etc (and for that matter only those exposed to reflection).
What I tried to is to set properties inside what you can call complex property (like struct).
And I think in this case I simply don’t get an point to struct I pointer to copy of my struct, and I set value in this copy.
Also you must consider there is special function is used to set numeric properties
UNumericProperty::SetFloatingPointPropertyValue(pointer, value).
But as far as I can see there is build in engine easy way to simply change values inside struct.
But presumably what you suggested above, iterating over the child properties, allows this? Attempting to call a method and accessing a non-UPROPERTY member are things that you should not expect to be exposed by the engine, since they’re not reflected. Any way of doing it would be to some extent a bit of a hack I think.