Skip to content

A python script that generates data for Lens Studio's VFX Editor. It redirects particles to the bright areas in a black & white image! Useful for morphing particles between shapes, or spawn within a mask more efficiently.

License

max-van-leeuwen/SnapLensStudio-ParticleRedirect

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

SnapLensStudio-ParticleRedirect

A python script that generates data for Lens Studio's VFX Editor. It redirects particles to the bright areas in a black & white image! Useful for morphing particles between shapes, or spawn within a mask more efficiently.



Alt Text



  • When you would need this:

If you want particles to spawn within a texture, or if you want to store those positions in the particles' attributes so they can move from one to the next.



  • What it does:

The Python script converts a square black & white image to a really small texture (<10kb), which contains all the positional information. The custom Sub-Graph then reads the texture, and picks a position from it. Its output can then be wired into the particle's world position, or it can be stored as an attribute for other uses.



  • How to use it:
  1. Run the Python script using 'python3 (this py path) (png path)', for example: 'python3 ./RedirectGenerator.py ./ExampleSpawnMap.png'.
  2. A texture file of the same name with '_redirect' appended will appear in the same folder. This can be imported into your Lens Studio resources panel.
  3. Then, import the 'particle redirect.subgraph' file into your VFX Editor panel and connect a 'Texture 2D Object Parameter' to it.

See the included example Lens Studio project!

About

A python script that generates data for Lens Studio's VFX Editor. It redirects particles to the bright areas in a black & white image! Useful for morphing particles between shapes, or spawn within a mask more efficiently.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages