Hi Stephane,
Sorry for the late reply, my laptop broke and I couldn't test it.
The problem that I'm having is that when calling the parent functions the unserialize function crashes:
void MyStructuralModel::serialize(SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber, const SBVersionNumber & classVersionNumber)
{
SBStructuralModel::serialize(serializer, nodeIndexer, sdkVersionNumber, classVersionNumber);
serializer->writeIntElement("one_property", number1);
serializer->writeIntElement("another_property", number2);
}
and:
void MyStructuralModel::unserialize(SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber, const SBVersionNumber & classVersionNumber)
{
SBStructuralModel::unserialize(serializer, nodeIndexer, sdkVersionNumber, classVersionNumber);
int p1 = serializer->readIntElement();
int p2 = serializer->readIntElement();
}
After saving, I get the crash at int p1 = serializer->readIntElement();
as an overflow, like the serializer didn't move into the next value.
I can avoid this crash if I don't call the parent functions, but then if I save more than one of my models, it will crash (again same error, probably because I'm reading something else from the .samx file)
I think this might be because I didn't implement serialize and unserialize functions for all elements of my model, I just re-used the code that we had for our internal saving (we are using json). I will try to set properly all serialize/unserialize functions.
Best regards,
Elisa