Closed AndersBillLinden closed 8 years ago
I think the saving needs to be refactored. It should keep the face enabled on save even if it doesn't have any textures.
But does the model format really keep information about disabled faces?
Yes. If you ignore writing one of the face definitions when creating an element, it won't render that face.
{
"name": "Cube",
"from": [ 1.0, 14.0, 0.1 ],
"to": [ 15.0, 15.0, 1.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 14.0, 1.0 ] }
}
},
Won't render east, south, and up face.
But then, the face definitions will be lost.
You'll only lose the UV, but if you're disabling it on purpose, it doesn't matter.
As it is now, if you load a model with faces that you not yet has set a texture on, they will not show up in the one color fashion (depending on direction) as they probably did when you were saving the model.
So it would appear like you do not load what you did save.
Okay, I get it now. I will get a fix out. Setting them enabled on load is not the correct solution.
Hello MrCrayfish! When I create a cube, I will see it even if I did not choose a texture yet. If I save the file, either exporting it as json or saving it to the model format and then load it again, the faces without texture will not show any longer so I will see nothing after I have loaded the model.
This is maybe not satisfactory.
The change will enable all faces when loading/importing an object. I am not totally sure this is appropriate, so you better think about it twice before accepting this PR. When should loaded faces actually be disabled?