Home Adobe Substance

Substance Maya Toolset

greentooth
Offline / Send Message
Froyok greentooth
1427982306-smt_06png


/!\ Compatible Maya 2013 and above. Windows only.
Not compatible with Mac OS and Maya LT.


Hey everybody !
I'm finally able to share my "little" Maya script to all. Subtly named "Substance Maya toolset". As you probably guessed, the script is dedicated to Maya and related to Substance. I'm open to any requests or suggestions, if any.

What is the goal of the script ?
It's a integrated interface inside Maya to call the Substance bakers via our BatchTools. It handles quick exports and conversions to output all the textures that you want. You can also process multiple meshes at once if needed. You can also use the script to process custom substances (sbsar) over you baked textures to batch multiple meshes.


Where do I get the script ?
The script can be downloaded on Substance Share :  https://share.allegorithmic.com/libraries/1647


How do I install and use the script ?
A detailed documentation is available on our website over here : Substance Maya Toolset Documentation


Current features :
- Automatic export
- Automatic triangulation of LP during export
- Automatic smooth preview to polygon conversion for Hp during export
- Move and Export from 0,0,0 then put LP/HP back where they were
- Baking multiple meshes in a row (batching)
- Custom mesh nomenclature for batching multiple HP/LP
- One Interface for configuration bakers, export format and export location
- Template system for baking substances in sync with the outputs form the bakers
Planned features :
- Support for name matching when baking
- Support for multiple high-poly
- Cage creation from low-poly
Supported bakers :
- Ambient Occlusion
- Ambient Occlusion from mesh
- Normal from mesh
- Height from mesh
- Curvature
- Materials IDs color
- Vertex colors
- Position
- UVs islands
- World space direction
- World space normal
- Thickness
Changelog :

[SubstanceMayaToolset 0.7]
-Added cage creator (with step, triangulation and offset type settings)
-Fixed incorrect dialog box when the tangent space plugin is missing

[SubstanceMayaToolset 0.6.1]
-Fixed : Material IDs baker doesn't need anymore an high-poly mesh if set to low-poly
-Fixed : Incorrect path for cage mesh when sent to the bakers

[SubstanceMayaToolset 0.6]
-Added HP convertion (from smooth preview to polygons) during export
-Added new bakers : Materials Color (from HP or LP), AO from HP, Thickness
-Added warnings if export/batch path is incorrect/doesn't exist
-Added normal Plugin setting (mikkt/unity/custom)
-Added Triangulation during export for LP mesh
-Added global parameters for Rays, Anti-Aliasing and Normal type
-Updated script to support Batch tool 5.0.3
-Updated UI to optimize the overall workflow
-Updated Mesh nomenclature : now saved permanently
-Updated Map suffix : Now saved permanently
-Fixed missing dilation/diffusion setting for some bakers

Replies

  • SwdPwnzDggr
    Offline / Send Message
    SwdPwnzDggr polycounter lvl 7
    Awesome, going to use this a ton.
  • Aasmund1986
    Offline / Send Message
    Aasmund1986 polycounter lvl 5
    Have anyone tried it? Does it work with MayaLT?
  • animax
    Offline / Send Message
    animax polycounter lvl 15
    This is going to be very useful. Thanks a lot!

    I will definitely try it out.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Have anyone tried it? Does it work with MayaLT?
    It will not work with Maya LT because of Maya LT limitations (you can't call external programs or write in custom files).
  • Aasmund1986
    Offline / Send Message
    Aasmund1986 polycounter lvl 5
    Hopefully Audodesk will add plug-in support for plug-ins like this on MayaLT soon :)
  • SwdPwnzDggr
    Offline / Send Message
    SwdPwnzDggr polycounter lvl 7
    Seems like the High Poly and Low Poly naming is reversed. I used defaults and I get the textures for _hp and it exports _hp.obj
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Seems like the High Poly and Low Poly naming is reversed. I used defaults and I get the textures for _hp and it exports _hp.obj
    I just tried to be sure with simple cubes and I don't have this behavior, everything works fine. What is your setup ?
  • Shriken
    Offline / Send Message
    Shriken polycounter lvl 11
    You have no idea how much I wanted this. THANK YOU!
  • SwdPwnzDggr
    Offline / Send Message
    SwdPwnzDggr polycounter lvl 7
    Froyok wrote: »
    I just tried to be sure with simple cubes and I don't have this behavior, everything works fine. What is your setup ?

    I found out what my issue was. I had the high poly selected when I hit bake and I had assumed the naming structure would handle what mesh was being baked to.

    For anyone in the future who runs into this: Select the low poly before hitting bake.
  • jfitch
    Offline / Send Message
    jfitch polycounter lvl 5
    This looks really awesome Froyok, I'm excited to use it. Can't wait for that cage feature too! This will really help with baking on the macs I have to use at work too...no xnormal.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    I found out what my issue was. I had the high poly selected when I hit bake and I had assumed the naming structure would handle what mesh was being baked to.

    For anyone in the future who runs into this: Select the low poly before hitting bake.
    Indeed. I didn't want to process all the scene automatically, it could be very annoying if you only want to update one mesh. That's why the system is based on the user selection.

    jfitch wrote: »
    This looks really awesome Froyok, I'm excited to use it. Can't wait for that cage feature too! This will really help with baking on the macs I have to use at work too...no xnormal.
    I'm afraid you won't be able to. Our batch tools doesn't work properly on Mac (we have to fix some little things) and my script rely on batch file which are only available on Windows.

    Once we will fix the batchtools, I will update the script to support Mac OS.
  • Denny
    Offline / Send Message
    Denny polycounter lvl 14
    Awesome work on this script Froyok! I'm planning to do my own "proxy script" to automate things even further based on your work.

    Is there any specific rules that I have to follow when including a cage? I always get failed on loading the cage. Naming convention matches. I have even tried duplicating the low poly straight up, yet does not work. It's not that big of a deal however as the normal baker gives 95% great results without a cage. It would just be nice to see how much difference it makes.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Denny wrote: »
    Is there any specific rules that I have to follow when including a cage? I always get failed on loading the cage. Naming convention matches. I have even tried duplicating the low poly straight up, yet does not work. It's not that big of a deal however as the normal baker gives 95% great results without a cage. It would just be nice to see how much difference it makes.
    Could be a bug, my tests with the cage mesh weren't as serious as with the rest of the workflow. Do you get any specific errors ? Either in Maya or the command window ?
  • SwdPwnzDggr
    Offline / Send Message
    SwdPwnzDggr polycounter lvl 7
    Froyok wrote: »
    Could be a bug, my tests with the cage mesh weren't as serious as with the rest of the workflow. Do you get any specific errors ? Either in Maya or the command window ?

    Now that I try it I am getting the same results. All I did was make a cage from the low poly. Everything else besides what is show in image 2 are at default settings.

    Zh429xg.png


    ZeECzLh.png
  • Froyok
    Offline / Send Message
    Froyok greentooth
    I just updated the script, the update can be downloaded on your account along Substance Designer 5. :)

    Changelog :
    [SubstanceMayaToolset 0.6.1]
    -Fixed : Material IDs baker doesn't need anymore an high-poly mesh if set to low-poly
    -Fixed : Incorrect path for cage mesh when sent to the bakers
  • Denny
    Offline / Send Message
    Denny polycounter lvl 14
    Sorry for the late reply Froyok, I'm glad it got solved anyway. Great work! Cage is working on my end now. :)
  • Shriken
    Offline / Send Message
    Shriken polycounter lvl 11
    finally got round to testing and using the tools, really nice so far.

    My only gripe would be is there a way to save out a copy of the template when you bake out a .sbsar? It would be amazing to then have a permanent editable sbsar with your exported assets maps applied (could edit in Player etc).
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Update 0.7 is now available ! :)
    [SubstanceMayaToolset 0.7]
    -Added cage creator (with step, triangulation and offset type settings)
    -Fixed incorrect dialog box when the tangent space plugin is missing
    


    Shriken wrote: »
    finally got round to testing and using the tools, really nice so far.

    My only gripe would be is there a way to save out a copy of the template when you bake out a .sbsar? It would be amazing to then have a permanent editable sbsar with your exported assets maps applied (could edit in Player etc).
    My next goal will probably be to support presets files.
    I can look into supporting the Templates at the same time. The template system also need the possibility to edit more parameters type (like float/booleans).
  • R00
    Offline / Send Message
    R00 polycounter lvl 12
    Hey Froyok,

    I'm currently using 5.0 at the moment so you may have fixed these issues. Nevertheless I'm encountering some problems when using your script.

    The first is more of a request than an 'issue'.

    Is there any way to define my _hp through a group rather than a mesh? The current issue I'm having is that particular meshes with crease setting are being reset, which means I have to redefine them again (which can be tedious when baking lots of separate geo).

    I have flagged the crease issue with Autodesk so this may be an issue that can be resolved on both ends hopefully.

    The Baking issue I am currently experiencing is when I view my baked mesh in a 2D package. It seems to have shifted the bake along the X-axis but has no visual effect on the UV's themselves. I'm not sure if anyone else has encountered this too.

    I hope these aren't to demanding and I look forward to the next build :)
  • Froyok
    Offline / Send Message
    Froyok greentooth
    polycrunch wrote: »
    Hey Froyok,

    I'm currently using 5.0 at the moment so you may have fixed these issues. Nevertheless I'm encountering some problems when using your script.

    The first is more of a request than an 'issue'.

    Is there any way to define my _hp through a group rather than a mesh? The current issue I'm having is that particular meshes with crease setting are being reset, which means I have to redefine them again (which can be tedious when baking lots of separate geo).

    I have flagged the crease issue with Autodesk so this may be an issue that can be resolved on both ends hopefully.

    The Baking issue I am currently experiencing is when I view my baked mesh in a 2D package. It seems to have shifted the bake along the X-axis but has no visual effect on the UV's themselves. I'm not sure if anyone else has encountered this too.

    I hope these aren't to demanding and I look forward to the next build :)

    I'm not sure what you means by version "5.0", are you talking about the batch tools or my script ?

    Can you describe the intended workflow with a group ?

    I use this one for example :

    smt_hplp_group_example.png

    I select the LP group, the meshes inside a group don't need to have a proper naming convention as long the group for the HP match. If the crease disappear during the export, is that with the "Convert smooth" setting enabled ?


    What software do you use to visualize the textures ? I have seen many apps unable to properly read grayscale texture properly and display them shifted horizontaly about 1/3 their size. I don't have this problem with XnView for example of Photoshop CS6.
  • R00
    Offline / Send Message
    R00 polycounter lvl 12
    Hey Froyok,

    Yeah sorry I was referring to the 5.0.0 Batch tool I'm currently using.

    I wasn't aware we could group it together (pardon my ignorance), I must have interpreted some text incorrectly.

    With regards to the crease disappearing when meshes are merged together. That's actually a bug that Autodesk is now working on for our build at work.

    I was trying to preview my normal map in Photoshop CS6 with similar results to what you have described. I Rebooted a couple of times and it seemed to work...

    Thanks for getting back to me dude :)
  • R00
    Offline / Send Message
    R00 polycounter lvl 12
    Hey Froyok,

    Whilst the baker works with just singular meshes it doesn't seem to work for me when baking multiple meshes down onto a singular one. I'm often left with the percentage bar stuck at 0%. It'd be better if it crashed and threw out an error report, meaning I could make the change that is causing it to freeze.

    Am I doing something wrong with the groups? or can multiple meshes being baked down onto one be implemented?

    For example:

    Group: Name_hp

    Window_hp
    Wall_hp
    Door_hp
    Roof_hp


    Group: Name_lp

    Plane_lp

    Your example shows grouped meshes named correctly but they are singular (which is fine) but I want to do something similar to my above example.

    Thanks
  • Froyok
    Offline / Send Message
    Froyok greentooth
    In this situation the only thing that matters is the name of the groups. Then you just have to select the low-poly group before starting the baking. I'm already merging meshes together if you selected the "convert smooth" setting (otherwise I just export the HP group with everything underneath it).

    If you get a 0% progress bar that means there is probably an error somewhere. I will need to know more about your setup and what Maya says in the log (visible via the script editor).
    (If you can send me the Maya scene it would be even better.)
  • KHM3dia
    Offline / Send Message
    KHM3dia polycounter lvl 10
    Why is it when i run the command "source SubstanceMayaToolset.mel; SubstanceMayaToolset();" it gives me the error "// Error: source SubstanceMayaToolset.mel; SubstanceMayaToolset(); //
    // Error: Line 1.32: Cannot find file "SubstanceMayaToolset.mel" for source statement. // " Im using Maya 2014
  • Froyok
    Offline / Send Message
    Froyok greentooth
    This message indicates that Maya can't find the mel file. So you either put the file in the wrong place or forgot to use the rehash command to refresh the script folder (or just to restart Maya).
  • KHM3dia
    Offline / Send Message
    KHM3dia polycounter lvl 10
    Thats really odd because although the files from the autodesk site are for maya 2013, i just added them to the 2014 maya folders.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Which files from Autodesk are you talking about ? I'm not sure to understand how it relates to this script and how to install it.
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    is the max render size really 4096?
    and can we get options for non uniform scaling of bakes
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Unfortunately that's not dependent of the script but the bakers themselves. Until they support higher resolutions and non-square textures, I can't do much.
  • Shriken
    Offline / Send Message
    Shriken polycounter lvl 11
    I just thought I'd ping this to see if there is any updates coming soon? I've been using this plugin a fair bit at work and home and love it so far :)
  • Froyok
    Offline / Send Message
    Froyok greentooth
    I'm currently on other projects and didn't had the time to work again on the script. So no updates planned for the moment.
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    Hey Froyok,  there seems to be a bug when export settings are set as FBX.  I'm getting an error in the CMD that says:
    Computing...
    Error: Scene File_Location.fbx couldn't be loaded!
    echo ----------------------
    I'm running Maya 2016 SP3, I've tried exporting FBX versions 2014,2013,2012 - all giving me the error.  Exporting as OBJ works fine.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Can you post the content of the batch file and tell me the version of your batch tools ?
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    What do you mean by content of batch file? Maya .ma file that I'm using?
    And I'm on Substance BatchTools 5.2.1 build 16422
  • Froyok
    Offline / Send Message
    Froyok greentooth
    The script works by creating a .bat file on the disk to call the batch tools. By default the file is removed after the bake, but you can enable the setting to keep it. There is probably an error in the path to the mesh file, but without the .bat I can't know for sure.
  • Froyok
    Offline / Send Message
    Froyok greentooth
    The script is now available on Substance Share : https://share.allegorithmic.com/libraries/1647
  • Tvidotto
    Offline / Send Message
    Tvidotto polycounter lvl 9
    I've been using the script for some time and I need to say that it is amazing!
    seriously, it made my life much easier on the baking part
    Sometimes I use substance painter to bake but is not as smooth as baking from maya with this script

    Thanks a lot for it =]
  • kolocim
    Offline / Send Message
    kolocim polycounter lvl 3
    "
    1. Computing...
    2. Error: Scene File_Location.fbx couldn't be loaded!
    3. echo ----------------------
    "

    I have the same problem. 
    II little trick to fix it (it work in my case): 
    1. Turn File Dialog to "Maya default"  (link)
    2. Try To use DAE Format in Substance Maya Toolset (Pure FBX still not working).
  • kolocim
    Offline / Send Message
    kolocim polycounter lvl 3
    "
    1. Computing...
    2. Error: Scene File_Location.fbx couldn't be loaded!
    3. echo ----------------------
    "

    I have the same problem. 
    II little trick to fix it (it work in my case): 
    1. Turn File Dialog to "Maya default"  (link)
    2. Try To use DAE Format in Substance Maya Toolset (FBX still not wor).
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Usually this error means that :
    - The path contains some characters that produce errors
    - The FBX mesh use a a version too recent for the bakers
    - The mesh doesn't exist on the disk
  • kolocim
    Offline / Send Message
    kolocim polycounter lvl 3
    "- The FBX mesh use a a version too recent for the bakers
    If I choose version through the toolset it doesn't work.
    But when I set up it in maya fbx export settinks in works (I use 2013 version of FBX)
  • kolocim
    Offline / Send Message
    kolocim polycounter lvl 3
    FROYOK, Is it possible to make auto asigning baked normal map to the lowpoly in maya? like it happens when you use default baking with "Transfer Maps".
  • Froyok
    Offline / Send Message
    Froyok greentooth
    kolocim said:
    "- The FBX mesh use a a version too recent for the bakers" 
    If I choose version through the toolset it doesn't work.
    But when I set up it in maya fbx export settinks in works (I use 2013 version of FBX)
    That's odd, I will look into it.
    kolocim said:
    FROYOK, Is it possible to make auto asigning baked normal map to the lowpoly in maya? like it happens when you use default baking with "Transfer Maps".
    That's on my To-Do list, but I didn't had the time yet.
  • MDiamond
    Offline / Send Message
    MDiamond polycounter lvl 10
    Hey Froyok, is it possible to implement a "save bake settings" on a scene-basis? Kinda like Designer does. Right now the settings reset everytime you close the window and that would be a huge time saver, especially if you have to rebake a mesh done weeks ago with settings tailored to it.  
  • Froyok
    Offline / Send Message
    Froyok greentooth
    Presets should take care of that, they are planned. :)
  • ltphu
    Offline / Send Message
    ltphu polycounter lvl 7
    hey Froyok when i baking amb occlusion_lp with normal map its said FileTextureLoader Loading Failed.How to fix that? thanks Froyok
  • Froyok
    Offline / Send Message
    Froyok greentooth
    I can't help without more information : 
    - Which version of the batch tools have you installed ?
    - Try to attach the bat file generated for the baking (it's deleted by default, use the interface to keep it)
  • ltphu
    Offline / Send Message
    ltphu polycounter lvl 7
    Froyok, i'm using Substance Batchtools 5.3.3 and this is the bat file.
Sign In or Register to comment.