Guest User

BS PETG Matte Registration

a guest
Sep 30th, 2026
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. python3 - <<'EOF'
  2. import json, glob, os
  3. root = os.path.expanduser("~/Library/Application Support/BambuStudio/system/BBL")
  4. idx = os.path.join(root + ".json")
  5. d = json.load(open(idx))
  6. have = {e["name"] for e in d["filament_list"]}
  7. # base must come before its children
  8. files = sorted(glob.glob(root + "/filament/Bambu PETG Matte @*.json"), key=lambda p: "@base" not in p)
  9. for f in files:
  10. name = json.load(open(f))["name"]
  11. if name not in have:
  12. d["filament_list"].append({"name": name, "sub_path": "filament/" + os.path.basename(f)})
  13. print("added", name)
  14. json.dump(d, open(idx, "w"), indent=4)
  15. EOF
Advertisement
Add Comment
Please, Sign In to add comment