有构建板,支持多模型构建,但生成支撑的切片还有bug
This commit is contained in:
19
tmp/parse_presets.py
Normal file
19
tmp/parse_presets.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
import configparser
|
||||
|
||||
def get_quality_presets():
|
||||
preset_dir = os.path.join(os.path.dirname(__file__), 'print_config', 'presets', 'creality', 'base')
|
||||
presets = []
|
||||
if os.path.exists(preset_dir):
|
||||
for f in os.listdir(preset_dir):
|
||||
if f.startswith('base_global_') and f.endswith('.inst.cfg'):
|
||||
config = configparser.ConfigParser()
|
||||
try:
|
||||
config.read(os.path.join(preset_dir, f))
|
||||
name = config.get('general', 'name', fallback=f)
|
||||
presets.append((f, name))
|
||||
except Exception as e:
|
||||
pass
|
||||
return sorted(presets, key=lambda x: x[1])
|
||||
|
||||
print(get_quality_presets())
|
||||
Reference in New Issue
Block a user