| 437 | } |
| 438 | |
| 439 | void StaticModel::Serialize(SerializeStream& stream, const void* otherObj) |
| 440 | { |
| 441 | // Base |
| 442 | ModelInstanceActor::Serialize(stream, otherObj); |
| 443 | |
| 444 | SERIALIZE_GET_OTHER_OBJ(StaticModel); |
| 445 | |
| 446 | SERIALIZE_MEMBER(ScaleInLightmap, _scaleInLightmap); |
| 447 | SERIALIZE_MEMBER(BoundsScale, _boundsScale); |
| 448 | SERIALIZE(Model); |
| 449 | SERIALIZE_MEMBER(LODBias, _lodBias); |
| 450 | SERIALIZE_MEMBER(ForcedLOD, _forcedLod); |
| 451 | SERIALIZE_MEMBER(SortOrder, _sortOrder); |
| 452 | SERIALIZE_MEMBER(DrawModes, _drawModes); |
| 453 | |
| 454 | if (HasLightmap() |
| 455 | #if USE_EDITOR |
| 456 | && !PrefabManager::IsCreatingPrefab |
| 457 | #endif |
| 458 | ) |
| 459 | { |
| 460 | stream.JKEY("LightmapIndex"); |
| 461 | stream.Int(Lightmap.TextureIndex); |
| 462 | |
| 463 | stream.JKEY("LightmapArea"); |
| 464 | stream.Rectangle(Lightmap.UVsArea); |
| 465 | } |
| 466 | |
| 467 | stream.JKEY("Buffer"); |
| 468 | stream.Object(&Entries, other ? &other->Entries : nullptr); |
| 469 | |
| 470 | if (_vertexColorsCount) |
| 471 | { |
| 472 | stream.JKEY("VertexColors"); |
| 473 | stream.StartArray(); |
| 474 | Array<char> encodedData; |
| 475 | for (int32 lodIndex = 0; lodIndex < _vertexColorsCount; lodIndex++) |
| 476 | { |
| 477 | auto& vertexColorsData = _vertexColorsData[lodIndex]; |
| 478 | if (vertexColorsData.HasItems()) |
| 479 | { |
| 480 | const int32 size = vertexColorsData.Count() * sizeof(Color32); |
| 481 | Encryption::Base64Encode((byte*)vertexColorsData.Get(), size, encodedData); |
| 482 | stream.String(encodedData.Get(), encodedData.Count()); |
| 483 | } |
| 484 | else |
| 485 | { |
| 486 | stream.String("", 0); |
| 487 | } |
| 488 | } |
| 489 | stream.EndArray(); |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | void StaticModel::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) |
| 494 | { |
nothing calls this directly
no test coverage detected