-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create MultiExtColorMix.py #16176
Create MultiExtColorMix.py #16176
Conversation
2-in-1-out and 3-in-1-out Color Mixer. Supports constant and gradient mixing using M163 and M164.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @GregValiant, thanks for your contribution! I would be very nice to have support for color mixing extruders in Cura. I did have some remarks though, please review and apply/discuss further. From there we can test the changes on our side.
"maximum_value_warning": "100", | ||
"enabled": "T1_include and mix_style == 'gradient'" | ||
}, | ||
"invis_setting": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I donnot think invis_setting
is very descriptive. Since we use descriptive setting names through out the code I would change this to something like
"invis_setting": | |
"sufficient_extruder_count": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to "enable_3rd_extruder"
if ext_cnt > 2: | ||
enable_invis = True | ||
else: | ||
enable_invis = False | ||
self._instance.setProperty("invis_setting", "value", enable_invis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be simplified to
if ext_cnt > 2: | |
enable_invis = True | |
else: | |
enable_invis = False | |
self._instance.setProperty("invis_setting", "value", enable_invis) | |
enable_invis = ext_cnt > 2 | |
self._instance.setProperty("invis_setting", "value", enable_invis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
super().initialize() | ||
|
||
ext_cnt = Application.getInstance().getGlobalContainerStack().getProperty("machine_extruder_count", "value") | ||
if ext_cnt > 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cura can have up to 8 extruders, what happens when this script is enabled, and a 4th or even 5th extruder is enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a message and exit (at line 253) if Extruder Count > 3.
if "MultiExtColorMix" in pp_name: | ||
multi_present += 1 | ||
if multi_present == 1: | ||
Message(text = "Multi-Extruder Color Mixer:" + "\n" + "You must have a Blending Hot End. Extruders Share Heater' and 'Extruders Share Nozzle' must be enabled in the 'Printer Settings' in Cura. Open 'MultiExtColorMix.py' in a text editor and review the opening lines for more instructions." + "\n").show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this message is a bit technical for the average cura user. We cannot expect users to open source code and read technical documentation.
Message(text = "Multi-Extruder Color Mixer:" + "\n" + "You must have a Blending Hot End. Extruders Share Heater' and 'Extruders Share Nozzle' must be enabled in the 'Printer Settings' in Cura. Open 'MultiExtColorMix.py' in a text editor and review the opening lines for more instructions." + "\n").show() | |
Message(text = "Multi-Extruder Color Mixer:" + "\n" + "You must have a Blending Hot End. Extruders Share Heater' and 'Extruders Share Nozzle' must be enabled in the 'Printer Settings' in Cura.).show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally such a message might be a bit verbose if a user is already aware of this requirement. Moving such a message in a less intrusive place might be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
I have a pull request in for a post processor that simply opens a PDF document with instructions for all the post processors. Aldo Hoeben commented on the fact that it "doesn't do anything" and it is true that it has no function as a post processor but it is documentation on the post processor settings that is right there for a user. We'll see how that goes.
if T1_include: | ||
T1_mix_start = int(self.getSettingValueByKey("T1_mix_start")) | ||
T1_mix_end = int(self.getSettingValueByKey("T1_mix_end")) | ||
T1_ext_incr = ((T1_mix_start - T1_mix_end) / (layer_span - 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T1_ext_incr = ((T1_mix_start - T1_mix_end) / (layer_span - 1)) | |
T1_ext_incr = (T1_mix_start - T1_mix_end) / (layer_span - 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Casper, |
Hi @GregValiant
Thanks for taking a look at the suggestions! I'm unable to see them though from my side. Did you already push the changes to the PR? |
I don't have access to Git Desktop as my Win10 computer is in for repair. All your suggestions have been completed. I'm just waiting to get the laptop back so I can post the changed file. |
I've put up the adjusted version with your suggested changes. See what you can make of it. |
Changed some verbiage. Allow the post to run if a printer has more than three extruders with a message that only 1, 2, and 3 will become mixed.
Casper, |
Add functionality for 4-in-one-out hot ends. Add an exit if the firmware is RepRap (M567 is not supported). Update MultiExtColorMix.py Change the variable names to start with lower case letter. Altered messages to include a title. Update MultiExtColorMix.py More variable name changes. Changed some string formats to templates. Update MultiExtColorMix.py merge 2
Casper, |
This reverts commit 8ec9521.
Hi @GregValiant, thanks for updating the PR with the remarks. Currently the PR contains some merge conflict messages, and thus we cannot merge. Example: Let me know if you can use some help. thanks, |
Along with help with Python I need help with Commits. I can't believe what a hash I've made of this. It wasn't just "changing computers in mid-stream" either. Here is my latest and greatest revision. (The file I see in my last commit (which should have incorporated your suggestions) is different. I tried the "revert" to straighten this out but I seem to have made even more of a mess.) One of your suggestions was in regard to this line: if any(["MultiExtColorMix" in pp_name for pp_name in pp_name_list.split("\n")]): My intent for that section of code was to keep the post from flooding the user with messages if there was more than one instance of the post running. With your suggested change I find it posting the message every time an additional instance of the post is enabled. That's what I was trying to avoid. |
Change concatenations to templates where possible. Update MultiExtColorMix.py Update Update MultiExtColorMix.py Update Update MultiExtColorMix.py Update2
Description
2-in-1-out and 3-in-1-out Color Mixer. Supports both Constant and Gradient mixing using M163 and M164.
This for Geeetech multi-extruders using a shared heater and nozzle. Color mixes using M163 and M164.
This is a replacement for the current ColorMix post processor that supports only 2-in-1-out hot ends. This post includes an option to "Park and Purge".
10-3 Added functionality for 4 in 1 out hot ends. Created an exit for RepRap machines (they use M567).
This fixes... OR This improves... -->
Type of change
How Has This Been Tested?
Tested on virtual multi-extruder printers.
Test Configuration:
Checklist: