satguru Posted February 3, 2016 Share Posted February 3, 2016 Load a scene from a file, serialize it and count the number of materials in the serialized string. You will see that the material count in the string is double the count in the file. Serialization doubles the count. I checked the code and I think it has to do with the way the loader and serializer work together. Loader, while loading, loads each material in the file as StandardMaterial into the scene. The Serializer while serializing adds all the material in the scene to the JSON object and then adds the material again if it is StandardMaterial - effectively doubling the count. I am working on an app which allows the user to serialize and save the scene to a file and I noticed that over subsequent saves the file kept getting bigger and bigger even though no changes were made to the scene, which is when I started looking into this issue. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.