mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Rename ColorChange to FilamentChange
I think this is more clear to the users what this should actually do.
This commit is contained in:
parent
6cae5c2e35
commit
ecfb62b69e
1 changed files with 10 additions and 12 deletions
|
@ -2,17 +2,15 @@
|
|||
# under the terms of the AGPLv3 or higher
|
||||
|
||||
from ..Script import Script
|
||||
#from UM.Logger import Logger
|
||||
# from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
class ColorChange(Script):
|
||||
class FilamentChange(Script):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def getSettingDataString(self):
|
||||
return """{
|
||||
"name":"Color Change",
|
||||
"key": "ColorChange",
|
||||
"name":"Filament Change",
|
||||
"key": "FilamentChange",
|
||||
"metadata": {},
|
||||
"version": 2,
|
||||
"settings":
|
||||
|
@ -60,17 +58,17 @@ class ColorChange(Script):
|
|||
if later_retract is not None and later_retract > 0.:
|
||||
color_change = color_change + (" L%.2f" % later_retract)
|
||||
|
||||
color_change = color_change + " ; Generated by ColorChange plugin"
|
||||
color_change = color_change + " ; Generated by FilamentChange plugin"
|
||||
|
||||
layer_targets = layer_nums.split(',')
|
||||
layer_targets = layer_nums.split(",")
|
||||
if len(layer_targets) > 0:
|
||||
for layer_num in layer_targets:
|
||||
layer_num = int( layer_num.strip() )
|
||||
layer_num = int(layer_num.strip())
|
||||
if layer_num < len(data):
|
||||
layer = data[ layer_num - 1 ]
|
||||
layer = data[layer_num - 1]
|
||||
lines = layer.split("\n")
|
||||
lines.insert(2, color_change )
|
||||
final_line = "\n".join( lines )
|
||||
data[ layer_num - 1 ] = final_line
|
||||
lines.insert(2, color_change)
|
||||
final_line = "\n".join(lines)
|
||||
data[layer_num - 1] = final_line
|
||||
|
||||
return data
|
Loading…
Add table
Add a link
Reference in a new issue