Kaynağa Gözat

Initialize mixing virtual tools to behave like standard a multi-extruder setup (#6853)

* Initialize mixing virtual tools to behave like standard a multi-extruder setup

* Update Marlin_main.cpp

* Update Marlin_main.cpp
Thomas Moore 7 yıl önce
ebeveyn
işleme
ecf19344f6
1 değiştirilmiş dosya ile 14 ekleme ve 5 silme
  1. 14
    5
      Marlin/Marlin_main.cpp

+ 14
- 5
Marlin/Marlin_main.cpp Dosyayı Görüntüle

@@ -13923,12 +13923,21 @@ void setup() {
13923 13923
   #endif
13924 13924
 
13925 13925
   #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
13926
-    // Initialize mixing to 100% color 1
13927
-    for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
13928
-      mixing_factor[i] = (i == 0) ? 1.0 : 0.0;
13929
-    for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS; t++)
13926
+    // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc.
13927
+    for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS; t++)
13930 13928
       for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
13931
-        mixing_virtual_tool_mix[t][i] = mixing_factor[i];
13929
+        mixing_virtual_tool_mix[t][i] = (t == i) ? 1.0 : 0.0;
13930
+
13931
+    // Remaining virtual tools are 100% filament 1
13932
+    #if MIXING_STEPPERS < MIXING_VIRTUAL_TOOLS
13933
+      for (uint8_t t = MIXING_STEPPERS; t < MIXING_VIRTUAL_TOOLS; t++)
13934
+        for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
13935
+          mixing_virtual_tool_mix[t][i] = (i == 0) ? 1.0 : 0.0;
13936
+    #endif
13937
+
13938
+    // Initialize mixing to tool 0 color
13939
+    for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
13940
+      mixing_factor[i] = mixing_virtual_tool_mix[0][i];
13932 13941
   #endif
13933 13942
 
13934 13943
   #if ENABLED(BLTOUCH)

Loading…
İptal
Kaydet