Closed rfsheffer closed 2 years ago
I need TSubClassOf saved in my own stuff and the way I differentiate the field is to simply change the CastField to ExactCastField in TryWriteUObjectPropertyData and TryReadUObjectPropertyData.
So presumably on restore you instantiate the referenced object yourself? SPUD won't be able to really - even if we derived the concrete runtime type, it could be from somewhere we don't have access to like your own code or a plugin.
As long as the type is loaded as in the module has been linked the class reference can be made. Wheather it be a blueprint dynamic class or native. I cannot see any reason for TSubClassOf to not be serializable and restored to the property. I am doing it in custom code however. Anyway, this issue is just to mention TSubClassOf is false possitively saved and restored.
OK, I've added official support for TSubclassOf properties.
Currently the system does not support TSubClassOf for saving, but if somebody sets a TSubClassOf as a savable property it treats it like a non-actor UObject. The save/restore process acts like it saved the property correctly tho what is saved is just a class identification (tho incorrect) and nothing is restored on load. It should throw the general "unsupported type" error instead.
Cheers and thanks for the great plugin :) Ryan