Home Technical Talk

[maya] froX : an xNormal script exporter for maya

2

Replies

  • Gheromo
    Options
    Offline / Send Message
    Gheromo polycounter lvl 11
    I see, can very useful. I guess it depends on the situation when it is better to use that or the cage.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    Can I use multiple mesh ?
    Yes and no, you can't specify multiple mesh individualy. However you can make a group and specify it as a LP or HP mesh. This way the exporter will combine them and export all of them.

    so we tried this out at work today.. making a group and selecting that node then hitting < Get HP / LP and they exported correctly, xnormal opened and looked as if it was working, then nothing was baked. no textures were written. i didnt think that would be an issue but we then tried selecting just a mesh and using those for the HP/LP and it worked. thoughts?


    scratch that! we just diagnosed the problem. there were aparently n-gons in the mesh and xnormal ended up just closing out because of that during the bake.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Note that for diagnostic, when nothing is baked, you can load the xml in xNormal (load settings) and click on "generate". You will get this way directly the error. I wish xNormal could send back an error number which could be read in maya. Unfortunately it's not the case.

    Also, I have an n-gons detector but since you use a group instead of a mesh the detector logically doesn't work. I can add a separate n-gons button so you can test manually your mesh before exporting.
  • Boonta
    Options
    Offline / Send Message
    Boonta polycounter lvl 13
    AWESOME update! Gonna have to try this now!
  • deolol
    Options
    Offline / Send Message
    deolol polycounter lvl 6
    does this and Frotool work in 2013? :D
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    froTools 3 work with Maya 2013, FroX should too (but I haven't tested it personally).
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    Froyok wrote: »
    FroX should too (but I haven't tested it personally).

    it does. :D
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    The new version 0.6 is available !
    I have added the support of Cages (custom or Maya envelope) and the possibility to save the settings of the UI as a preset.

    Download : http://www.froyok.fr/maya/frox_0-6.zip
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Awesome!
    I'll give this a go tomorrow or friday at work.
  • Cap
    Options
    Offline / Send Message
    Cap triangle
    Would really like to test this out, but when I try to set the xNormal path, it crashes. Using Maya 2013. Any ideas?
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    You are the second person to tell me that and unfortunately I have no idea why it happens like that. I'm using Maya 2013 too now and it works fine for me and for some friends. That's really strange. I will try to find new informations about this... I'm really sorry. :poly103:

    A workaround for the moment is to copy the folder name of xNormal manually in the text field (+ adding the "/xNormal.exe" at the end). Like this :

    [noparse]F:\xNormal\x86\xNormal.exe[/noparse]
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    I just decided to try this out, or rather, I'm just trying it out as we speak. Using latest xnormal 3.17.15 and froX 0.6.

    I installed and ran the script with no problem. Added shelf button via the button available. The new shelf command fails the first try, then runs the second. It keeps working like this. Maybe you are not handling opening/closing the window in Maya properly?

    I get this error:
    // Error: file: C:/Users/kgia1/Documents/maya/2013-x64/scripts/froXno.mel line 59: windowPref: Object 'Winfrox' not found. //


    I'll keep you posted with the rest of my progress.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    I just tried the most simplest of settings to see what results I got right of the bat. I get no exported image file. I do the the export.xml. I am using Maya 2013 x64

    1) Ran script to get window showing
    2) Set the xnormal path to x64 (tried with x86 as well) version of the xnormal exe (v3.17.15)
    3) Set export path to my desktop
    4) Pointed to the HP using the button
    5) Pointed to the LP using the button
    6) Pressed "Bake textures".

    This should at this point give me a 512px normal map right?

    I get the xnormal splash screen which is loading all it's assets, then I get a xnormal progess bar window which just blinks for a split second (as if it was baking at lightning speed or just failing).
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Aha... instructions are for noobs right?

    I hadn't pressed the "Export HP" and "Export LP" :X
    Maybe have some form of check to see if these files are present and warn user if they are not?

    Seems to be working fine now. I'll keep trying features and keep you posted.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    The "Create Cage" button needs to have the lowpoly selected in advance, this could be handled automatically or at least inform the user of this requirement.

    I was working with adding more detail to my HP and was updating the HP by pressing the "Export HP" button again, and then "Bake Textures" again. I got no visual difference in my normal map. After trying this a few times it occurred to me that maybe for some reason xnormal stopped exporting the actual texture file to disk and I was actually viewing the same old normal map as I had used before. This seemed to be the case. I manually deleted the old normal map to try again in hopes that the program wouldn't now be asked to handle overwriting an existing texture. But no luck. Now it's just not outputing any texture. Am I doing something wrong? Is this some bug?
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    kodde wrote: »
    The "Create Cage" button needs to have the lowpoly selected in advance, this could be handled automatically or at least inform the user of this requirement.

    I was working with adding more detail to my HP and was updating the HP by pressing the "Export HP" button again, and then "Bake Textures" again. I got no visual difference in my normal map. After trying this a few times it occurred to me that maybe for some reason xnormal stopped exporting the actual texture file to disk and I was actually viewing the same old normal map as I had used before. This seemed to be the case. I manually deleted the old normal map to try again in hopes that the program wouldn't now be asked to handle overwriting an existing texture. But no luck. Now it's just not outputing any texture. Am I doing something wrong? Is this some bug?

    -I will look into the shelf button problem.

    -For the cage, I don't know why I didn't thought about the fact you could have already setup the LP field, I will fix that.

    -If you get nothing, it's probably because xNormal occurs an error, but since you batch you don't get the error message. Simple way to fix that : launch xNormal, load the xml and press "generate". You should get the error. Unfortunately I can't get the errors in an other way.

    kodde wrote: »
    Maybe have some form of check to see if these files are present and warn user if they are not?

    I will, it happens sometimes to me too. x]
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Thanks for the quick reply.

    I forgot to mention this important observation as well:
    This script is highly useful and I'm loving it so far :) Keep going!
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Your method of loading the settings worked fine.

    It was related to having ngons on my HP mesh. This might just be a noob mistake on my part since I don't bake normal maps that often in xNormal. But it could also be a common problem? Might be another future improvement which could be considered. When hitting the "Export HP" button the script will first do a check for faces with more than 4 sides and prompt the user with this as an error to fix.

    EDIT:
    Here's a good resource if you want to handle the ngons warning I mentioned.
    http://pozeststar.blogspot.se/2010/11/detect-n-gons-in-maya-using-mel.html
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    I already check the nGons for the LP, not the HP (because it can be very long). I will probably add an option to enable/disable the nGon check for the HP then.

    (Or even a direct button, select an object then hit the check nGons like in my froTools script.)
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    sweet dude! so is there a way we can get an option for doing 2:1 textures, the same way xNormal gives you the option?
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Oniram wrote: »
    sweet dude! so is there a way we can get an option for doing 2:1 textures, the same way xNormal gives you the option?
    Noted, I will add this.

    I think I have finally found a way to support multiple meshes (both HP & LP) without having to rewrite the functions I use to write inside the xml file. This mean I will support this sooner that I expected. :)
    Currently I'm fixing some behaviors (nGons button already added) and adding some missing parameters (I forgot some options for the curvatures maps).


    I have added all your request on my to-do list by the way.
  • Gheromo
    Options
    Offline / Send Message
    Gheromo polycounter lvl 11
    a suggestion for the hi-poly exporting:

    a checkbox that would convert maya sub-d into polygons and smooth them and export and leave model back as sub-d. doing that process by hand when exporting meshes for xnormal sometimes can get really annoying and time consuming
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    There is already a setting to convert the HP mesh smooth preview to polygon during the export (but revert back after the export to avoid any problems). Enabled by default by the way, see the "Convert HP smth" checkbox.

    If you want to keep the converted model, then keep the maya function in your shelf. I don't think it's a good idea to convert the mesh without giving it's original status back. Mostly because it's annoying if you want to update the mesh after a bake test.
  • Gheromo
    Options
    Offline / Send Message
    Gheromo polycounter lvl 11
    ah, i seemed to miss it, havent been baking anything recently and thought of it that this process is annoying sometimes. really good job on the plugin. :)
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    Blogging you, Froyok ! :D
    http://santyhammer.blogspot.com.es/2012/12/xnormal-script-exporter-for-maya.html

    Btw, I don't know if it can help but I write a warning/error log at [My documents]\xNormal_debugLog.txt. You perhaps could open that text file and output into a sub-window in your tool. I should improve a bit the log messages though.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    jogshy wrote: »
    Thanks a lot ! :poly136:
    jogshy wrote: »
    Btw, I don't know if it can help but I write a warning/error log at [My documents]\xNormal_debugLog.txt. You perhaps could open that text file and output into a sub-window in your tool. I should improve a bit the log messages though.
    I discovered that log file when I posted on the Eat3D forum, so I think I will be able to use it a bit. Of course simplify it a bit the messages inside will help to use them ! :thumbup:

    One thing I'm thinking aobut it that you separate each map rendering as a different message. This is logicial, but I would try to regroup them as a "session" or group. Since a user can ask to bake multiple map at once when he ask to generate texture(s).
  • Gheromo
    Options
    Offline / Send Message
    Gheromo polycounter lvl 11
    I dont know if its possible, but is there a way you can render out 2 normal maps straight away one Tangent space and one Object space? Perhaps make a tickbox to change what type of normal map I will be baking? perhaps a different naming too so that they dont overwrite each other. Might be a handy for dDo users :)
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Gheromo wrote: »
    I dont know if its possible, but is there a way you can render out 2 normal maps straight away one Tangent space and one Object space? Perhaps make a tickbox to change what type of normal map I will be baking? perhaps a different naming too so that they dont overwrite each other. Might be a handy for dDo users :)
    xNormal can render only one normal map at once, so I think it's better to keep the current process as-is, because it's hard to ask to xNormal to redo a map when you don't know if the program is already launched or not. If I make maya to ask if xNormal is finished before rendering a second map, it will freeze the program. I would like to keep the current process (aka : backing while you can still work). I can't change the nomenclature too, because it's xNormalk which generate it.

    Sorry, but I think the best way currently is to keep your export folder opened and make a copy of your Normal map once xNormal as rendered it before asking the second normal map.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    so this tool has been an awesome addition to my workflow, however there is still one small hiccup. When exporting a LP (with envelope) as .sbm it always seems to export to
    C:\Program Files\Autodesk\Maya2013
    

    instead of the location i initially entered in the export path. the textures, HP, and envelope all go to the path.. just not the LP (.sbm only)
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Hmmm, strange. Let me try on my own side if I can reproduce the problem. What version of xNormal is installed on your computer by the way ?


    [EDIT] Ha, the error is from my side. Really sorry. :poly103:
    I will fix this for a future release. You an manually fix it by finding the line (number 2419) :
    $mesh = $mesh + ".SBM";
    
    and changing it by :
    $mesh = ($objFolder + $mesh + ".SBM");
    
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    interesting. im not seeing that on line 2419. on that line im seeing
    print( "Exported : " + $mesh + "\n");
    

    the code you said to look for im seeing on lines 2308 and 2384. i would imagine the one i'm looking to change is on 2308 based off of the other 2 if/else statements
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Ha of course, silly as I am I forgot that I have edited my script since the time I posted it (I'm working on the 0.7 version). This explain why the line number is not the same.

    Sorry for the confusion.
    I have fixed the problem in the 0.7 version, I will try to post an update soon.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    i come bearing more suggestions. :) so ive been using this tool regularly now and its awesome.. but there's maybe 1 or 2 more things id like to have with this.

    Render Size: i think before there was a separate dropdown for L and W of your texture, and it has since been combined into 1. it would be great to have a tick box or something that would enable a 1:1 ratio lock, or allow 2:1 textures.

    Triangulation: I'm lazy and i dont cap my cylinders. XD and always when exporting as .SBM i get errors kicked back saying i need to triangulate my mesh before exporting.. which i really dont like to do until the end (export to engine). so im wondering if there could be a feature similar to the "Convert HP Smth" that would triangulate the LP mesh, export, then undo the triangulation.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Oniram wrote: »
    Render Size: i think before there was a separate dropdown for L and W of your texture, and it has since been combined into 1. it would be great to have a tick box or something that would enable a 1:1 ratio lock, or allow 2:1 textures.
    The next version will fix that. ;)
    Oniram wrote: »
    Triangulation: I'm lazy and i dont cap my cylinders. XD and always when exporting as .SBM i get errors kicked back saying i need to triangulate my mesh before exporting.. which i really dont like to do until the end (export to engine). so im wondering if there could be a feature similar to the "Convert HP Smth" that would triangulate the LP mesh, export, then undo the triangulation.
    That's strange. I have indeed planned to allow you to triangulate your mesh during the export (for OBJ and FBX mostly) but the SBM format should handle the triangulation by itself normally....
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    So here comes the version 0.7 ! _0/
    Download : http://www.froyok.fr/maya/frox_0-7.zip

    WARNING
    : Previous presets made with the 0.6 version don't work anymore.

    Changelog :
    //version 0.7
    -added a button to open the export folder
    -added possibility to bake non-square textures.
    -added "check nGons" button to check manually n-gons on a selected mesh.
    -added a check before calling xNormal to see if LP/HP mesh have been exported
    -updated the export path button, removed a conflic with the "froTools" script.
    -updated the checkbox "Convert HP smth" to be false by default
    -fixed an error about the WindowPref command when you load the script
    -fixed the missing settings for the Curvature map (UI, preset and xNormal xml)
    -fixed an error with the export path of the low poly mesh in the SBM format.
    -fixed the crash when setting the xNormal path.

    //version 0.6.1
    -added Smoothing group and Tangent/Binormals options for the FBX export.
    -fixed FBX Triangulate problem when using an older plugin verison (FBX 2011 and before)
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    cant believe i missed this update. XD but i tested it out today and it works like a charm .
  • Thousand
    Options
    Offline / Send Message
    Thousand polycounter lvl 9
    great tool!! makes xNormal even better! thanks for sharing!

    i´m not able to save/load presets
  • Cap
    Options
    Offline / Send Message
    Cap triangle
    Just got around to trying this out, I'm really enjoying it so far. One thing I'm curious about, there are buttons for export LP/HP but no export cage button. If I need to tweak the cage do I re-export the LP?
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Thousand wrote: »
    i´m not able to save/load presets
    Explain a bit, I can't help you otherwise.
    Cap wrote: »
    Just got around to trying this out, I'm really enjoying it so far. One thing I'm curious about, there are buttons for export LP/HP but no export cage button. If I need to tweak the cage do I re-export the LP?
    Yes, the "Export LP" button export the low-poly, the cage and the blocker.
  • Thousand
    Options
    Offline / Send Message
    Thousand polycounter lvl 9
    hi,

    when i hit the save button, this is what i see in the script editor:

    froxSavePreset;
    autoUpdateAttrEd;
    updateAnimLayerEditor("AnimLayerTab");
    statusLineUpdateInputField;

    when i hit the load button, nothing happens, but the script editor gives me this:

    froxLoadPreset;

    i would have expected a list where to choose the preset

    any idea?

    thanks m
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    A preset is just a group created in the scene, you have to select one and then click on the button to load it.
  • Thousand
    Options
    Offline / Send Message
    Thousand polycounter lvl 9
    Froyok wrote: »
    A preset is just a group created in the scene, you have to select one and then click on the button to load it.

    ah, now i understand! thanks for your help!
  • Braddish
    Options
    Offline / Send Message
    Hi Froyok,
    I just downloaded your tool here and gave it a go. It works great and can certainly save a lot of time!
    I've been having one problem with it though. I've been setting my exports to SBM files (SBM files tend to give proper, more accurate normal map results, I've had a lot of shading error problems with OBJs before). If I try using the SBM format with the "Use Cage" checked ON, xNormal opens up and closes down before baking the texture.
    The problem is coming from the OBJ that your script is exporting for the cage mesh. It needs to be an SMB file to match the low poly mesh otherwise xNormal sees them as being different, and can not bake out from them. If I export my cage as an SBM manually, open xNormal manually and load the SBM cage instead of the OBJ, it works properly. But then that kind of defeats the purpose of your tool :/

    Im assuming this is a bug? Or is there something that I am missing in your tool?
    Any help would be great, I'd love to make this a regular part of my work flow!
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Braddish wrote: »
    Hi Froyok,
    I just downloaded your tool here and gave it a go. It works great and can certainly save a lot of time!
    I've been having one problem with it though. I've been setting my exports to SBM files (SBM files tend to give proper, more accurate normal map results, I've had a lot of shading error problems with OBJs before). If I try using the SBM format with the "Use Cage" checked ON, xNormal opens up and closes down before baking the texture.
    The problem is coming from the OBJ that your script is exporting for the cage mesh. It needs to be an SMB file to match the low poly mesh otherwise xNormal sees them as being different, and can not bake out from them. If I export my cage as an SBM manually, open xNormal manually and load the SBM cage instead of the OBJ, it works properly. But then that kind of defeats the purpose of your tool :/

    Im assuming this is a bug? Or is there something that I am missing in your tool?
    Any help would be great, I'd love to make this a regular part of my work flow!

    Hi, thanks a lot for your feedback. It was indeed a bug.
    The script was forcing the export of the Cage as an OBJ. It's totally my fault because I never expected xNormal to complain about this. This is now fixed in the version 0.7.1. The cage file format is now the same as the one used by the Low-Poly mesh.

    You can download the new version here : froXno v0.7.1


    Changelog :
    -updated the Cage slider : now a field with a +/- buttons (more precise and scalable)
    -updated the SBM export, now totally silent (without the OK dialog after the export)
    -fixed the export of the cage when using the SBM format
  • Braddish
    Options
    Offline / Send Message
    Yay! thank you!
  • Thousand
    Options
    Offline / Send Message
    Thousand polycounter lvl 9
    Great tool, thanks for sharing! Beeing able to bake out tangent space and object space normals at the same time would still be great!
  • Shilo
    Options
    Offline / Send Message
    Great tool and timesaver. Thanks for making this!
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Thanks guys ! :)
    Thousand wrote: »
    Great tool, thanks for sharing! Beeing able to bake out tangent space and object space normals at the same time would still be great!

    I can't promise any updates soon, but I have a feature in development that will allow that.
  • Thousand
    Options
    Offline / Send Message
    Thousand polycounter lvl 9
    I was using FrXno all night long for baking; didn´t have any issues, everything worked like a charm.

    one question: how do I bake out Highpoly vertex colors (i.e. zbrush polypaint)? and is there a way to bake maya face colors?

    thanks again, great helper
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    For baking the polypaint from zBrush obj files you need to use the "HP out of scene" setting :
    -”HP out of scene” : You can set your HP as “out of the scene”, this way you don’t need to load it inside Maya. To use this feature you must respect the nomenclature : xxx_hp.format. Your mesh file must finish with “_hp”. Don’t forget to change the format of your meshes in the UI

    The HP mesh must be in the export folder, otherwise the script will not be able to find the mesh.


    If you want to export some vertex color to xNormal from Maya, you need to use the FBX format as objs from Maya don't contain vertex colors. The SBM format can maybe handle vertex colors too, but I'm not sure.
2
Sign In or Register to comment.