rgomezjnr / GcodeFilenameFormatPlus

Cura plugin for controlling output filename format, now with multi-extruder and OctoPrint support
https://marketplace.ultimaker.com/app/cura/plugins/rgomezjnr/GcodeFilenameFormatPlus
GNU Lesser General Public License v3.0
30 stars 4 forks source link

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

Open evilC opened 2 years ago

evilC commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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,

martin-paulsburg commented 1 year ago

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 commented 1 year ago

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.