ParticleHelper.LoadASync loads textures from https://assets.babylonjs.com/particles/textures

#1

I have a custom .json file saved locally that defines my particle system.

When I set ParticleHelper.BaseAssetsUrl to my local public folder the json loads fine but then the texture that is defined as “textureName”: “flare.png” in json file is trying to load from https://assets.babylonjs.com/particles/textures even tho BaseAssetsUrl is set to my local directory.

To the level I was able to understand the source code, static variable BaseAssetsUrl is only used in ParticleHelper class and when the json is loaded end sent to ParticleSystemSet parse method there is no reference to BaseAssetsUrl. The parse methods always takes Constants.PARTICLES_BaseAssetsUrl value. I think ParticleHelper.BaseAssetsUrl should be injected into Parse methods for ParticleSystemSet and ParticleSystem classes.

I was thinking to change Constants.PARTICLES_BaseAssetsUrl but this seems like to much of a hack…

Please help.

#2

This is not a hack but the expected way actually :slight_smile:
Just call BABYLON.Constants.PARTICLES_BaseAssetsUrl = ...

1 Like
#3

Yeah, it was so simple! I’m stupid, I went into babylon.min.js source and changed variable there did not even come to mind to just do this hahah.

#4

No worries!