Skip to content
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

[Feature Request] Add Material's Display Name #8

Open
evilC opened this issue Nov 4, 2021 · 5 comments
Open

[Feature Request] Add Material's Display Name #8

evilC opened this issue Nov 4, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@evilC
Copy link

evilC commented Nov 4, 2021

Is it possible to add Display Name to the list of options?
image
I don't see it in the fdmprinter.def.json.pot - Does this mean I would have to get ultimaker to add it to that file?

@rgomezjnr
Copy link
Owner

Hello sorry for the late reply.

Right now the [material] option results in the Material Type generated in the filename since that is how it is referenced in the Cura backend. Do you want separate options [material_name] and [material_type]?

In your image you have Display Name 98A and Material Type 95A. Is that on purpose?

I don't see it in the fdmprinter.def.json.pot - Does this mean I would have to get ultimaker to add it to that file?

No, many print settings and object details are available in the Cura backend at slicing time and are not listed in fdmprinter.def.json. I simply have to add code to the GFF+ plugin to extract these extra options. This is what I would do for [material_name] and [material_type].

@thezemo
Copy link

thezemo commented Apr 16, 2022

I would like [material_name] ie display name since my settings change depending on brand so i just make the name something that ensures that I know what it is, since i run 2 different brands or more of pla i have been just adding the display name by hand but your plugin is great so would be good to have that done within the plugin

@evilC
Copy link
Author

evilC commented Apr 17, 2022

In your image you have Display Name 98A and Material Type 95A. Is that on purpose?
No, this is due to quirks of cura, or at least quirks of how Creality set up the Ender 3 profile.
If I make new categories, things behave strangely (I forget what, it's so long since I messed with it)

I would just like "TPU 98A" in the filename without the brand,

@rgomezjnr rgomezjnr added the enhancement New feature or request label May 27, 2022
@martin-paulsburg
Copy link

martin-paulsburg commented Feb 20, 2023

I had the same problem. I tryed to fix it my self and it seams to work:
edit the file GcodeFilnameFormatPlus.py (path: Appdata/roaming/cura/"current version"/plugins/GcodeFilenameFormatPlus)
adding in the function getPrintSettings(self, filename_format) in the first try
material_name = print_information.materialNames ca. line 138
and adding in the same function where all the print_settings[...] is filled ca. line 257

try:
if len(material_name)>1:
print_settings["material_name1"] = material_name[0]
print_settings["material_name2"] = material_name[1]
print_settings["material_name"] = material_name[0] + " " + material_name[1]
else:
print_settings["material_name"] = material_name[0]
except IndexError:
print_settings["material_name"] = "no material name available"

Then you can use material_name, material_name1 and material_name2 as all the other placeholders.

filename_plugin_result
My test results are shown in the picture. Ignore my ASA Filament classified as ABS but cura does not know the material-type ASA.

@rgomezjnr
Copy link
Owner

I had the same problem. I tryed to fix it my self and it seams to work: edit the file GcodeFilnameFormatPlus.py (path: Appdata/roaming/cura/"current version"/plugins/GcodeFilenameFormatPlus) adding in the function getPrintSettings(self, filename_format) in the first try material_name = print_information.materialNames ca. line 138 and adding in the same function where all the print_settings[...] is filled ca. line 257

try: if len(material_name)>1: print_settings["material_name1"] = material_name[0] print_settings["material_name2"] = material_name[1] print_settings["material_name"] = material_name[0] + " " + material_name[1] else: print_settings["material_name"] = material_name[0] except IndexError: print_settings["material_name"] = "no material name available"

Then you can use material_name, material_name1 and material_name2 as all the other placeholders.

filename_plugin_result My test results are shown in the picture. Ignore my ASA Filament classified as ABS but cura does not know the material-type ASA.

Hi thank you for investigating this. I'll try your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants