This plugin will export the layer masks for all selected layers in the layer stack. *Substance Painter 2.1 required.
Usage:
1. Add the plugin to the plugin folder.
C:\Users\"username"\Documents\Substance Painter 2
2. In the Export Masks view, set the directory to save the masks using the Export Directory button.
3. In the layer stack, select the layer(s) that contain masks you want to export and click the Export Mask button in the toolbar.
4. In the Mask Export view, you can set the format as well as resolution
Uploaded: almost 6 years ago
Updated: almost 6 years ago
Version: 1
File Name: export_masks.zip
Size: 3.36 KB
looking great! thank you Wes.
is this in preparation for the layered materials workflow?
Thanks! Not in preparation, but will be good use for the plugin : )
Hi Wes this is awesome and a great step in the right direction to export masks back into Mari.
However is there a way to get it to work for linux?
awesome!
This is absolutely awsome and helpful, thank you very much!!
But now I'm having a problem with the plugin. When I first tested it, and exported a mask successfully, everything worked fine. But later when I tried to start up SP again it continuously shut down before the main window was even shown. Only when I removed the plugin from the plugin folder, SP2 starts without problems. What is wrong here? I'm so sad, because the export option for masks is desperately needed :-(
I forgot to mention, I'm on Substance Painter 2.1.1., on a 64Bit Windows 8.1 machine.
Why did it first work well, starting up without problems and even exportet my test map, but on later trials SP2 suddenly refused to start??
I did further testing. I have no problems with the other plugin ('saving incremental files'), this one doesn't disturb my SP2. But as soon as I again add the 'export masks' to the plugin folder, SP2 refuses to start properly, it shuts down during the process of loading, before opening the main window, and later when trying again comes up with the crash report window (which I filled once and sent to Allegorithmic).
@bytefactor3d I'm sorry for this issue. I haven't seen this happen before. Can send the crash report to me at wes.mcdermott@allegorithmic.com
So we figured this out, thank you very much again to Wes for a quick assistance!!
What you guys need to do is: don't touch the plugin's window, don't undock it, leave it in place docked where it appears first after installation.
An update of Substance Painter (which is scheduled for around the end of this week) should solve the issue, so later it will be possible again to undock and move the plugin window to any other place or monitor.
Thank you and cheers from Charlie ( at Bytefactory3D)
Hey there,
I've installed the plugin and the tab appears in the toolbar at the top of the program, but I select a layer with an alpha mask and click on the 'Export Masks' tab, I get this message in the Log window:
[MapExporter] Map export failed (Couldn't open a device on file:///Fill layer 1_mask.png)
Any ideas what's causing this?
Thanks
@Paul_S I haven't seen that error before. Can you post in the Painter forums and I can help.
Thank you for this wes
is there a way to add padding to the mask on export?
Thanks everyone : ) Glad the plugin was helpful.
@Dinusty I'm sorry but I didn't add the padding options to the plugin. I can add the option in an update.
+1 for padding! Is it possible to do now with 2.4.1? Getting some seams in engine due to mips I suspect.
@Dinusty if you want to have the maps exported with infinite padding, for now (until Wes updates it officially) you can open the export.js file in a text editor and change at the bottom section of the code (//export masks) the padding is set to "false" you just need to set to "true", save and close, then re-open Painter.
I hope Wes will add an option for padding size, that's something out of my level of understanding :]
@zurhoch that works for me :) Thanks!
@wes That would be great! thanks :)
Anybody use it? Not workable now at substance 2.5 and 2.51
thank you
I second the vote for linux support. Looks like a simple pathing issue maybe (dropping the first '/'):
[MapExporter] Could not save var/tmp/Surface Details_mask.png map
[MapExporter] An error occurred while finalizing the export
[Plugin - export_masks] {
"name": "ExportError",
"message": "An error occurred while exporting map to 'var/tmp/Surface Details_mask.png'"
}
[Plugin - export_masks] Canceled
very close to prefect! I just wish there were more options to adjust the naming in the ssame way that the regular export textures button does. Adding Udim tags and such would make this so much more useful!
I will have to manually add them this way, still faster than the alternative I suppose.
Im having error with the script too:
[MapExporter] Could not save //b_mask.png map
[MapExporter] An error occurred while finalizing the export
[Plugin - export_masks] {
"name": "ExportError",
"message": "An error occurred while exporting map to '/b_mask.png'"
}
I'm using Substance Painter 2.6.1
it would be great if this could export with UDIM and/or texure set in the name! (or have similar options like regular export)
Hi does this have padding function?
[Plugin - export_masks] {
"name": "ExportError",
"message": "An error occurred while exporting map to '/Fill layer 2_mask.png'" help me
Hello,how solve this error ?!
[Plugin - export_masks] {
"name": "ExportError",
"message": "An error occurred while exporting map to '/Fill layer 1_mask.png'"
}
This doesn't work anymore with Painter 2018.2.1
Plugin works in 2018.3.3 but instead of using button "Export masks" in viewport UI use right click menu on layer and choose export mask to file (or clipboard) then save in *.png or other format.
Great job. Thanks :)
Getting the same error as some other people:[Plugin - export_masks] {
"name": "ExportError",
"message": "An error occurred while exporting map to '/Fill layer 1_mask.png'"
}
Im on version 2019.1.2 on Linux
Let me know if there is a way to fix this for newer versions since its not possible to export each mask separately due to production schedules.
Does not work in Painter 2019.3.3
Awesom! Thank you! Exactly what I was looking for
Inspect you log and see if the path its trying to export is proper. For me on Mac I needed to add the root (/) in front on the path. So:
if(res == "Document Resolution") {
alg.mapexport.save(selectedLayers[i], "/"+dir+"/" + selectedLayerNames[i]+"_mask" + "."+format, {padding:false});
}else{
alg.mapexport.save(selectedLayers[i], "/"+dir+"/" + selectedLayerNames[i]+"_mask" + "."+format, {padding:false, resolution:[Number(res), Number(res)]});
}
how to use this plugin in 2019 version?
1. Add the plugin to the plugin folder.(you can open folder in SP menu: plugins--plugins folders),and restart!
2.Click Window--Views--Export_masks-Export Mask,make sure you check the option.
3.you can see the Export_masks window,set the format and resolution,select a layer mask then click "Export Directory" set the export path,click "Export Mask" button,done!
Is there any way that I can use it for Substance Painter 2019?
thank you it's working great