Open nimdavirus opened 4 months ago
Urho binary format is not safe (and was never safe) if serializable layout changes:
https://github.com/u3d-community/U3D/blob/master/Source/Urho3D/Scene/Serializable.cpp#L334
You must have the same attributes of the exact type in the exact order on save and load.
We have solved it by serializing StringHash+VariantType of attributes together with the value.
Urho binary format is not safe (and was never safe) if serializable layout changes:
https://github.com/u3d-community/U3D/blob/master/Source/Urho3D/Scene/Serializable.cpp#L334
You must have the same attributes of the exact type in the exact order on save and load.
We have solved it by serializing StringHash+VariantType of attributes together with the value.
Can you show me an example please?
@nimdavirus I can show you our code that does this task, but it is completely disconnected from current U3D codebase. I didn't want to share it initially because I didn't consider it helpful.
https://github.com/rbfx/rbfx/blob/master/Source/Urho3D/Scene/NodePrefab.cpp#L87-L126
@nimdavirus I can show you our code that does this task, but it is completely disconnected from current U3D codebase. I didn't want to share it initially because I didn't consider it helpful.
https://github.com/rbfx/rbfx/blob/master/Source/Urho3D/Scene/NodePrefab.cpp#L87-L126
I will use VariantVector in attributes for proper binary file serialization
If you save the scene in binary format and then create a new attribute in the component, then a crash will occur when loading the scene. There is no such thing with the text format of the scene.