SoftFever / OrcaSlicer

G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)
https://discord.gg/P4VE9UY9gJ
GNU Affero General Public License v3.0
5.86k stars 669 forks source link

AMS Custom Filament types should match by 'compatible_printers' rather than by profile name #5707

Open anselor opened 1 week ago

anselor commented 1 week ago

Is there an existing issue for this problem?

OrcaSlicer Version

2.0, 2.1

Operating System (OS)

Windows

OS Version

Windows 11

Additional system information

No response

Printer

Bambu P1S

How to reproduce

I recognize this is a narrow use case but I have custom filament profiles for a particular nozzle that have declared compatibility with multiple printer profiles.

Save the following as a JSON file and import. Try to select it in the AMS configuration screen. It will not be listed.

{
    "activate_air_filtration": [
        "0"
    ],
    "activate_chamber_temp_control": [
        "0"
    ],
    "additional_cooling_fan_speed": [
        "0"
    ],
    "chamber_temperature": [
        "0"
    ],
    "close_fan_the_first_x_layers": [
        "3"
    ],
    "compatible_printers": [
        "Bambu Lab P1P 0.4 nozzle",
        "Bambu Lab P1S 0.4 nozzle",
        "Bambu Lab X1 0.4 nozzle",
        "Bambu Lab X1 Carbon 0.4 nozzle",
        "Bambu Lab X1E 0.4 nozzle"
    ],
    "compatible_printers_condition": "",
    "compatible_prints": [],
    "compatible_prints_condition": "",
    "complete_print_exhaust_fan_speed": [
        "70"
    ],
    "cool_plate_temp": [
        "0"
    ],
    "cool_plate_temp_initial_layer": [
        "0"
    ],
    "default_filament_colour": [
        ""
    ],
    "during_print_exhaust_fan_speed": [
        "70"
    ],
    "enable_overhang_bridge_fan": [
        "1"
    ],
    "enable_pressure_advance": [
        "1"
    ],
    "eng_plate_temp": [
        "70"
    ],
    "eng_plate_temp_initial_layer": [
        "70"
    ],
    "fan_cooling_layer_time": [
        "30"
    ],
    "fan_max_speed": [
        "40"
    ],
    "fan_min_speed": [
        "10"
    ],
    "filament_cooling_final_speed": [
        "3.4"
    ],
    "filament_cooling_initial_speed": [
        "2.2"
    ],
    "filament_cooling_moves": [
        "4"
    ],
    "filament_cost": [
        "45"
    ],
    "filament_density": [
        "1.25"
    ],
    "filament_deretraction_speed": [
        "nil"
    ],
    "filament_diameter": [
        "1.75"
    ],
    "filament_end_gcode": [
        "; filament end gcode \nM106 P3 S0\n"
    ],
    "filament_flow_ratio": [
        "0.9821"
    ],
    "filament_id": "P9e57294",
    "filament_is_support": [
        "0"
    ],
    "filament_load_time": [
        "0"
    ],
    "filament_loading_speed": [
        "28"
    ],
    "filament_loading_speed_start": [
        "3"
    ],
    "filament_long_retractions_when_cut": [
        "nil"
    ],
    "filament_max_volumetric_speed": [
        "7"
    ],
    "filament_minimal_purge_on_wipe_tower": [
        "15"
    ],
    "filament_multitool_ramming": [
        "0"
    ],
    "filament_multitool_ramming_flow": [
        "10"
    ],
    "filament_multitool_ramming_volume": [
        "10"
    ],
    "filament_notes": [
        ""
    ],
    "filament_ramming_parameters": [
        "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
    ],
    "filament_retract_before_wipe": [
        "nil"
    ],
    "filament_retract_lift_above": [
        "nil"
    ],
    "filament_retract_lift_below": [
        "nil"
    ],
    "filament_retract_lift_enforce": [
        "nil"
    ],
    "filament_retract_restart_extra": [
        "nil"
    ],
    "filament_retract_when_changing_layer": [
        "nil"
    ],
    "filament_retraction_distances_when_cut": [
        "nil"
    ],
    "filament_retraction_length": [
        "nil"
    ],
    "filament_retraction_minimum_travel": [
        "nil"
    ],
    "filament_retraction_speed": [
        "nil"
    ],
    "filament_settings_id": [
        "3D-Fuel PCTG Pro @BBL P1X1 0.4 nozzle"
    ],
    "filament_shrink": [
        "100%"
    ],
    "filament_soluble": [
        "0"
    ],
    "filament_start_gcode": [
        "; filament start gcode\n{if (bed_temperature[current_extruder] >80)||(bed_temperature_initial_layer[current_extruder] >80)}M106 P3 S255\n{elsif (bed_temperature[current_extruder] >60)||(bed_temperature_initial_layer[current_extruder] >60)}M106 P3 S180\n{endif}\n\n{if activate_air_filtration[current_extruder] && support_air_filtration}\nM106 P3 S{during_print_exhaust_fan_speed_num[current_extruder]} \n{endif}"
    ],
    "filament_toolchange_delay": [
        "0"
    ],
    "filament_type": [
        "PCTG"
    ],
    "filament_unload_time": [
        "0"
    ],
    "filament_unloading_speed": [
        "90"
    ],
    "filament_unloading_speed_start": [
        "100"
    ],
    "filament_vendor": [
        "3D-Fuel"
    ],
    "filament_wipe": [
        "nil"
    ],
    "filament_wipe_distance": [
        "nil"
    ],
    "filament_z_hop": [
        "nil"
    ],
    "filament_z_hop_types": [
        "nil"
    ],
    "from": "User",
    "full_fan_speed_layer": [
        "0"
    ],
    "hot_plate_temp": [
        "70"
    ],
    "hot_plate_temp_initial_layer": [
        "70"
    ],
    "inherits": "",
    "is_custom_defined": "0",
    "name": "3D-Fuel PCTG Pro @Bambu Lab P1S 0.4 nozzle",
    "nozzle_temperature": [
        "270"
    ],
    "nozzle_temperature_initial_layer": [
        "270"
    ],
    "nozzle_temperature_range_high": [
        "270"
    ],
    "nozzle_temperature_range_low": [
        "240"
    ],
    "overhang_fan_speed": [
        "100"
    ],
    "overhang_fan_threshold": [
        "25%"
    ],
    "pressure_advance": [
        "0.03"
    ],
    "reduce_fan_stop_start_freq": [
        "1"
    ],
    "required_nozzle_HRC": [
        "3"
    ],
    "slow_down_for_layer_cooling": [
        "1"
    ],
    "slow_down_layer_time": [
        "8"
    ],
    "slow_down_min_speed": [
        "10"
    ],
    "support_material_interface_fan_speed": [
        "100"
    ],
    "temperature_vitrification": [
        "76"
    ],
    "textured_plate_temp": [
        "70"
    ],
    "textured_plate_temp_initial_layer": [
        "70"
    ],
    "version": "1.9.0.11"
}

Actual results

Note the compatible printers setting:

    "compatible_printers": [
        "Bambu Lab P1P 0.4 nozzle",
        "Bambu Lab P1S 0.4 nozzle",
        "Bambu Lab X1 0.4 nozzle",
        "Bambu Lab X1 Carbon 0.4 nozzle",
        "Bambu Lab X1E 0.4 nozzle"
    ],

The AMS screen, when matching filaments, appears to instead match based on the string after '@' in the filament profile name.

For example, if I have this name set: 3D-Fuel PCTG Pro @BBL P1X1 0.4 nozzle the filament type does not show up in the AMS list. But if I rename it to: 3D-Fuel PCTG Pro @Bambu Lab P1S 0.4 nozzle it shows up.

This string matching prevents the filament profile from being usable across printers.

Expected results

The list of available filaments should be based on the compatible printers not on some arbitrary naming convention.

Project file & Debug log uploads

profile is above.

Checklist of files to include

Anything else?

No response