Skip to content

Repository files navigation

Resin Profile Migrator

A Python tool to convert resin printing profiles between different slicer programs.

Supported Formats

  • Anycubic Photon Workshop (.pwsr) - JSON format with mm/s speeds
  • PrusaSlicer (.ini) - Configuration bundle format with microstep notation
  • ChiTuBox (.cfgx) - JSON configuration format with mm/min speeds

Usage

List profiles in a file

python3 resin_profile_migrator.py input_file.pwsr --list
python3 resin_profile_migrator.py config_bundle.ini --list
python3 resin_profile_migrator.py settings.cfgx --list

Convert between formats

All formats can be converted directly to any other format:

# PWSR conversions
python3 resin_profile_migrator.py profile.pwsr -o output.ini    # PWSR → INI
python3 resin_profile_migrator.py profile.pwsr -o output.cfgx   # PWSR → CFGX

# INI conversions  
python3 resin_profile_migrator.py config.ini -o output.pwsr     # INI → PWSR
python3 resin_profile_migrator.py config.ini -o output.cfgx     # INI → CFGX

# CFGX conversions
python3 resin_profile_migrator.py settings.cfgx -o output.pwsr  # CFGX → PWSR
python3 resin_profile_migrator.py settings.cfgx -o output.ini   # CFGX → INI

No intermediate conversions needed - convert directly between any two formats.

Common Profile Parameters

The tool maps these common parameters between formats:

  • Basic Info: Name, Type, Vendor
  • Physical Properties: Density, Cost, Volume, Color
  • Print Settings: Layer height, Exposure times, Bottom layers
  • Movement: Lift heights and speeds, Retract speeds
  • Light Settings: PWM values for normal and bottom layers
  • Timing: Light off times
  • Advanced: Anti-aliasing, Gamma correction

Unit Conversions

The tool automatically handles unit conversions between formats:

  • Speed Units:
    • PWSR: mm/s (e.g., 6 mm/s)
    • CFGX: mm/min (e.g., 360 mm/min)
    • PrusaSlicer: microstep notation (e.g., layer1750, move8000)
  • Automatic conversion: All speed conversions handled seamlessly between formats
  • Microstep mapping: PrusaSlicer's unique notation is properly converted to/from physical speeds

Adding New Formats

To add support for a new slicer format:

  1. Create a new parser class inheriting from ProfileParser
  2. Implement parse() and export() methods
  3. Add the file extension and parser to ProfileMigrator.parsers
  4. Map the format's parameters to the ResinProfile dataclass

Examples

The repository includes sample files for testing:

  • ABS-Like Resin Pro 2 Black 0.1mm.pwsr
  • PrusaSlicer_config_bundle.ini
  • Anycubic_Photon_Mono_M7_ABS_Pro_V2_00.cfgx

Features

  • Complete format support - Full parsing and export for all three formats
  • Automatic unit conversion - Handles speed differences (mm/s ↔ mm/min) automatically
  • ChiTuBox compatibility - Generated CFGX files include all required parameters for successful import
  • Round-trip conversions - Convert back and forth without data loss
  • Multiple profiles - Handle files with multiple resin profiles (like PrusaSlicer bundles)
  • Extensible design - Easy to add support for new slicer formats

Validation

The tool has been tested with:

  • PWSR files from Anycubic Photon Workshop
  • INI configuration bundles from PrusaSlicer
  • CFGX project files from ChiTuBox
  • Round-trip conversions between all formats
  • Speed unit conversions (verified mathematically)

Troubleshooting

ChiTuBox Import Issues

If ChiTuBox fails to import a converted CFGX file:

  1. Ensure the original profile data is valid
  2. Check that speed values are reasonable (not extremely high/low)
  3. Verify the profile name doesn't contain special characters
  4. Fixed: Red warnings about "inconsistent second segment parameters" are now resolved

Photon Workshop Import Issues

If Photon Workshop shows wrong parameters for a converted PWSR file:

  1. Fixed: Complete PWSR structure now includes all required sections
  2. Fixed: Proper height calculations (total lift = stage1 + stage2)
  3. Fixed: All temperature curves and advanced parameters included

PrusaSlicer Import Issues

If PrusaSlicer shows "Invalid configuration bundle" errors:

  1. Fixed: Microstep values now use validated PrusaSlicer standard values
  2. Fixed: Material profile format ensures proper import as material (not printer)
  3. Fixed: All required material profile fields included for compatibility

Speed Conversion

The tool automatically converts speeds between formats:

  • PWSR: 6 mm/s → CFGX: 360 mm/min (6 × 60) → PrusaSlicer: layer1750
  • CFGX: 120 mm/min → PWSR: 2 mm/s (120 ÷ 60) → PrusaSlicer: layer350
  • PrusaSlicer: layer1750 → Physical: ~3.5 mm/s → CFGX: 210 mm/min
  • Two-stage movements: Each stage converted individually with proper mapping

Current Status

✅ Fully Implemented:

  • Complete PWSR ↔ INI ↔ CFGX conversions
  • Automatic speed unit conversions (mm/s ↔ mm/min ↔ microsteps)
  • PrusaSlicer microstep notation support (layer1750, move8000)
  • ChiTuBox-compatible CFGX export with all required parameters
  • Round-trip conversions preserve data accuracy
  • Multiple profile support (PrusaSlicer bundles)

🔧 Recently Fixed:

  • PrusaSlicer microstep notation system fully implemented
  • Material profile format compatibility (imports as material, not printer)
  • CFGX files now include complete structure required by ChiTuBox
  • Speed unit conversions between all three formats (mm/s ↔ mm/min ↔ microsteps)
  • File size increased from 3KB to 15KB+ for full compatibility
  • Two-stage movement parameters prevent ChiTuBox red warnings
  • Complete PWSR structure with all required sections for software compatibility
  • Proper parameter mapping ensures accurate profile recognition

📋 Future Enhancements:

  • Additional slicer format support (Lychee, UVTools, etc.)
  • GUI interface for easier usage
  • Batch conversion of multiple files
  • Configuration validation and warnings

License

This project is licensed under a Custom License - see the LICENSE file for details.

Important:

  • Free for personal/non-commercial use
  • Attribution required: Credit "Sebastian Trojanowski" when using
  • ⚠️ Commercial use: Requires written permission - contact sebek@civ.pl

Note: If external contributors submit code to this project, the licensing may be changed to a more standard open source license (e.g., MIT) to accommodate collaborative development.

Author

Sebastian Trojanowski - Creator and maintainer

This project was developed with AI assistance from Claude (Anthropic).

About

Python tool that converts 3D resin printing profiles between different slicer software formats.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages