I want to encrypt some .babylon file with the .ebabylon extension.
Then I would like to decrypt the files when ImportMesh is called.
I saw BABYLON.SceneLoader.RegisterPlugin() but I’m not sure how to use it to decrypt the code when ImportMesh is called.
I did the encryption and decryption functions (but I don’t understand how the RegisterPlugin works)
For the moment I did this as an example of what I want to do. It’s not supposed to work as is, it’s just for example and to know if I’m on the right track.
I’m just trying to see if it’s doable.
Ok, I didn’t understand how to use the registerPlugin.
I saw that you could use base64. so I did like this:
1 I base64 encode the.babylon files and give them the ebabylon extension
2 with ajax I will read the encode file and return the result
3 I am using ImportMesh using "data:;base64," +code
And it works.
I would like to do the same with something other than base64 for the encoding. But it seems more complex than I thought.