I made a thing!
If you import images with alpha channels into Blender this is a script that will trace the alpha channels of the image and create a polygon to match, and create a UV map and material to display the image.
This is useful if you're doing 2D animation with images.
This is part of my project to de-adobefy myself, by using open-source tools like Blender to replace After Effects.
The second image is a 2D rig I'm using to animate an image, built with bendy bones. Although you could possibly create rigs like this in After Effects with 3rd-party tools like DuIK and RubberHose, Blender's rigging toolset is far superior and a lot easier to set up.
My script seems to only work reliably with png images, I don't have a good enough understanding of OpenCV to deal with funky image formats, though I'd like it to be able to open multi-layer images.
Source is here: https://codeberg.org/stib/stibs_blender_scripts/src/branch/main/import_and_trace_alpha.py
(To install it download the python script and go to blender preferences > addons, then click the little drop-down in the top right and choose `install from disk`)
#IMadeAThing #Blender #AfterEffects #OpenSource #FOSS #Animation
Binary partitioning with k-d trees is silly amazing. And with OSM data in radians and pretending the planet is a perfect sphere, scikit-learn's BallTree works wonderfully for quickly finding things nearby some reference point.
Like how far away the nearest bicycle_parking is for every building in a city.