|
@@ -18,15 +18,16 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
|
|
|
writer.Write(manager.CurrentBgAsset);
|
|
|
|
|
|
- TransformDtoSerializer.Serialize(new TransformDTO(GetBgTransform(manager)), writer);
|
|
|
+ var bgTransform = GetBgTransform(manager);
|
|
|
+ var transformDto = bgTransform ? new TransformDTO(bgTransform) : new TransformDTO();
|
|
|
+
|
|
|
+ TransformDtoSerializer.Serialize(transformDto, writer);
|
|
|
}
|
|
|
|
|
|
public override void Deserialize(EnvironmentManager manager, BinaryReader reader, SceneMetadata metadata)
|
|
|
{
|
|
|
_ = reader.ReadVersion();
|
|
|
|
|
|
- var bg = GetBgTransform(manager);
|
|
|
-
|
|
|
var bgAsset = reader.ReadString();
|
|
|
|
|
|
var transformDto = TransformDtoSerializer.Deserialize(reader, metadata);
|
|
@@ -55,6 +56,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
|
|
|
if (!validBg) return;
|
|
|
|
|
|
+ var bg = GetBgTransform(manager);
|
|
|
+
|
|
|
+ if (!bg) return;
|
|
|
+
|
|
|
bg.position = transformDto.Position;
|
|
|
bg.rotation = transformDto.Rotation;
|
|
|
bg.localScale = transformDto.LocalScale;
|