~Add script for importing colors and hex values from Polymaker's online store~
Integrate Polymaker color script into compile-filaments.py
I just got in an order of 10 different colors of PolyTerra PLA and thought what a good time to try out the load from external source feature. Alas Polymaker exists but no PolyTerra so here's every color of PolyTerra added to the data. Since I didn't want to copy paste that many items by hand I created a small python script to load the hex values Polymaker supplies on the store.
Create basic fields for the filament in polymaker.json but leave color as "color": [] and "product_url" : "<product_page-url>"
~Add filament name and colors block to the filaments block at the bottom of import-polymakercolors.py copying the name you gave the filament in polymaker.json and changing the URL to the URL of the Polymaker product page for that line.~
Run python3 scripts/compile-filaments.py
Done!
Limitations of script modification:
~Entire color block is replaced - this is intentional to avoid complicated merge logic - comparing hex colors for existing filaments in polymaker.json and my own manual entries in Spoolman show very little difference in practical use and are the result of camera sensors and batch variance.~
Colors array must be empty - to prevent overwriting for filament types like silk with multiple hexes
Colors that do not have a hex value from Polymaker will be entered as white ffffff
Dual extrusion color filament not supported Polymaker don't provide these hex values on their website so I didn't code for the edge case that doesn't have data
~Still have to create base block in polymaker.json and a filament block in the script this is a tradeoff for a tiny amount of duplicate data in return adding functionality to need to explicitly add a filament for it's colors to be overwritten and not complicating compile-filaments.py for a single manufacturer color generator script. Also Polymaker doesn't report every field needed and provide others as ranges or other hard to retrieve formats~
This PR contains the following changes:
I just got in an order of 10 different colors of PolyTerra PLA and thought what a good time to try out the load from external source feature. Alas Polymaker exists but no PolyTerra so here's every color of PolyTerra added to the data. Since I didn't want to copy paste that many items by hand I created a small python script to load the hex values Polymaker supplies on the store.
Steps to use the script:
python3 -m pip install -r scripts/requirements.txt
"color": []
and"product_url" : "<product_page-url>"
import-polymakercolors.py
copying the name you gave the filament in polymaker.json and changing the URL to the URL of the Polymaker product page for that line.~python3 scripts/compile-filaments.py
Limitations of script modification: