I made some particle effects in the babylon editor since this makes it a lot easier than typing it out in code. I then exported the json, but when trying to use the particle systems in my project there are multiple issues.
I eventually got it to work, but it feels like a really hacky way of doing it, so I’d like some feedback/advice on how to do it better
1. When I export to json from the babylon editor the particle texture name won’t be the actual file name, but a really long string. (Not ‘skull.png’, but ‘data:image/png;base64,iVBORw0KGgoAAAANSUhE…’)
2. It will always try to pull the particle texture from a path on the babylon website even when the path for the json is set correctly (assets.babylonjs.com/particles/textures/xxxxx)
I found a thread talking about this issue Forum Post however the solution doesn’t work for me. BABYLON.Constants.PARTICLES_BaseAssetsUrl doesn’t even exist for me.
I worked around this by set.systems[0].particleTexture.updateURL("skull.png"); after the particle system has loaded in. However this way we still get a failed request to where it originally wants to find it.
Hey @Deltakosh
Thanks for the reply.
I’ve been playing around with this a bit more since I made this forum post, but I still can’t figure it out.
I guess you’re pinging julien since the editor is involved.
In my case the editor spitting out a really long string isn’t that huge of an issue since I can just manually delete and change it. So that only adds one extra step.
The bigger issue is that I cannot change the path where it wants to find the texture for the effect before it makes a request to the babylon server.
If I use set.systems[0].particleTexture.updateURL("skull.png"); it will load the correct image, but it will still do a failed request to the original path first which will lead the users to have an error message in the console and makes one unnecessary get request.
Do you have an idea why BABYLON.Constants.PARTICLES_BaseAssetsUrl doesn’t seem to exist for me? Was this changed over the last couple of updates?
Edit:
I just realized the long string in the particle json came from me clicking embed texture when exporting from the editor. So issue 1 is fixed by just selecting no when asked.
When trying to use an embedded texture the same issue happens though with it making a get request to some babylon server.