Home Quixel Megascans

TIPS AND TRICKS: Blender - An Export Colour ID Addon and Other Useful Information

polycounter lvl 6
Offline / Send Message
NoiseCrime polycounter lvl 6
As a blender user i've found exporting a material/colour ID map quite awkward, resorting to bakes and having to enable or disable blender options to get a clean unaltered diffuse colour render. A process that is both fiddly and time consuming.

By chance I came across the offical BLender uv layout addon to export the uv layout as a wireframe and noticed it had an option to export the diffuse colours. Sadly there was no option to only export the diffuse colours (i.e without wireframe), so I dug around in the python code I came up with my own version.



Blender Export Colour Layout Addon - Download link
This is an addon for Blender that enables the exporting to png the unmodified diffuse colors of applied materials using the meshes uv map as a layout. In essence it generates a colour ID map for use in applications such as Quixel Suite DDO. As it does not use baking it is easier and quicker to generate colour ID map, it also (appears) to work the same regardless of whether you are using Blender Renderer or Blender Cycles.

It is heavily based on the original UV Layout addon and is still a work in progress, but it exports the colour map just fine. In the future I'd love to work out a method of assigning DDO colour link id's to Blender materials and export those, instead of having to set the materials diffuse colour.

The download has a brief read me with more details in it. If you have any problems with the addon feel free to post them in this thread and I'll see if there is anything I can do to help. I'm unsure if not going the baked approached means that something important is missing. As far as I can tell uv islands are not anti-aliased, but materials that share the same edges are and that appears to work fine within DDO.



Using Blender with DDO
Just a couple of notes about using Blender with DDO, specifically in regard to generating the required input maps.

After spending some time my advice would be not to bother trying to bake maps with Blender. There are some specific issues with Blender baking currently and it does not support some important input maps that DDO really needs for best functionality. In the end I've just found it easier to export your High poly, Low Poly and optional Cage mesh then use xNormal to generate the maps instead.



Exporting OBJ Format from Blender
The default settings seem to work fine, though do remember to enable 'export normals'.

It might be a good idea to enable 'triangulation', but i'd suggest it may be better to do that on the actual mesh to ensure consistency between exports.

My settings are to enable, Selection Only, Apply Modifiers, Include Edges, Write Normals, Include UV's, Write Materials, Objects as OBJ Objects. With Forward = -z forward and Up = y Up. Depending upon content you might find you need additional options enabled/disabled.



Problems with Blender Map Baking.
Currently Blender Renderer bakes object Space Normals using a different directional bias to that which DDO expects. This means front/back from Blender becomes top/down in DDO etc ( can't actually remember exactly which direction maps to which, just that it was wrong). This could probably be fixed with some messing around in Photoshop but its not worth the bother.

Blender Cycles Object Space Normal baking allows you to specify the directions assigned to colour channels, but sadly the baking process as of 2.71 is broken as the object is not baked in object space. From memory it doesn't reset the positional and rotation transforms or something.

Finally one of the most important input maps, Curvature is not directly supported by Blender and although DDO can generating one from other input maps, it will miss hard edges present in the geometry but that is not encoded into say the tangent normal map.

So just my opinion, but once you've exported the material colour ID map and the .obj versions of your meshes you are better off investing your time with xNormal.

Replies

  • AbidalSarraj
    I went without thinking throw and bought Quixel Suite thinking it will save me a lot of time but for the past few days I wasted lots of time searching for answers..
    Loved that you did take your time to address point us to the right way of getting the most of Quixel Apps.
    I just wish that after the official release they'll make time and support Blender.

    Thanks for the link you provided and I've a question for you What is the fastest way of doing textures Blender Compositor or (other apps like Quixel, SD, Toolbag, etc..)?

    Regards
  • NoiseCrime
    Offline / Send Message
    NoiseCrime polycounter lvl 6
    I went without thinking throw and bought Quixel Suite thinking it will save me a lot of time but for the past few days I wasted lots of time searching for answers..
    Loved that you did take your time to address point us to the right way of getting the most of Quixel Apps.
    I just wish that after the official release they'll make time and support Blender.

    Thanks for the link you provided and I've a question for you What is the fastest way of doing textures Blender Compositor or (other apps like Quixel, SD, Toolbag, etc..)?

    Your welcome.

    Alas I'm unable to answer your questions about Blender Compositor, its a feature that i've not used myself. Not sure what you mean about other apps can you elaborate.
  • stilobique
    Offline / Send Message
    stilobique polycounter lvl 12
    Create a new pannel "Quixel" for add more function use to quixel as possible ? Personally i paint ma id color ; exemple with my fish.
  • nwopolygonshapeshifter
    Ill give this a snoop around later.
  • tungerz
    Offline / Send Message
    tungerz polygon
    Thanks for sharing your script -n- process, (
  • AbidalSarraj
    NoiseCrime wrote: »
    Your welcome.

    Alas I'm unable to answer your questions about Blender Compositor, its a feature that i've not used myself. Not sure what you mean about other apps can you elaborate.

    Thanks for your reply, I mean I'm good with Blender Compositor and see the other apps take less time to create materials but the issue of compatibility between them and blender make it harder and for me take more time than it needed..
    I did a lot of search and asking question in the past few days but I think I got the answer and it's as long as Blender not supported with these apps (Quixel, SD, Toolbag) it's a wast of time to go back and forth.
    Maybe in the future Blender will get more support but, thank you for your support and work :)

    Regards
  • NoiseCrime
    Offline / Send Message
    NoiseCrime polycounter lvl 6
    Thanks for your reply, I mean I'm good with Blender Compositor and see the other apps take less time to create materials but the issue of compatibility between them and blender make it harder and for me take more time than it needed..
    I did a lot of search and asking question in the past few days but I think I got the answer and it's as long as Blender not supported with these apps (Quixel, SD, Toolbag) it's a wast of time to go back and forth.
    Maybe in the future Blender will get more support but, thank you for your support and work :)

    Ah, it sounds as if you are talking about Quixel to Blender, in using the textures/assets DDO creates in Blender, is that right? In which case i'm afraid I'm unable to assist as my focus is using the texture in real-time graphics in a 3D engine, so my focus is the opposite direction (i.e. Blender > Quixel > Unity ) and I guess I should have made that clear in my OP.

    It may be worth your time posting your concerns to the 'Great big Blender thread' as Quixel to Blender does feel like an area that is under-developed.

    I'd also just like to state to anyone reading the thread not to take my current criticisms and issues with Blender as meaning its bad or a poor choice to use with Quixel. Although Blender currently has some issues, those should be resolved eventually. However even then i've more or less decided that personally i'm just going to use xNormal for generating the various maps and I think that approach is also valid for any other 3D apps too (e.g. Max, Maya etc).
  • AbidalSarraj
    Thanks, I like Blender because it's easy to use and for light projects it works great and for heavy project I use maya.. I always love to do anything to save time so when I got Quixsl Suite I thought I did..
    Your work flow (i.e. Blender > Quixel > Unity ) mine is (Blender > Quixel > Blender)..
    I'll see the thread you mentioned .. thanks for pointing that out.
  • Eric Ramberg
    Thank you so much Noisecrime for all your hard work! We really apreciate it!!
  • DennG
    Hi NoiseCrime,

    thanks for the addon and sharing your experience with us! :-)

    Unfortunately im having problems with importing the addon in Blender v2.72.
    It's not showing under Preferences->Addons. I've tried to import both .py files with no success.
    I'm using Blender on a Mac. Any idea what I'm doing wrong?

    Best regards
    Dennis

    Edit:
    Working now.. I just copied it manually in the blender addons directory :)
    Thanks!
  • paksas
    Let me join others thanking you, NoiseCrime, for sharing the wisdom.

    The export runs fine and the materialID map gets exported correctly ( I think ), but I'm running into an issue as soon as I try importing it into DDO - it crashes instantaneously, with the message box showing a tediously large callstack that looks like this:

    quixelIDMapCrash.PNG

    I used the material swatches from the .fbx file quixel supplies ( imported it into Blender then saved it as a .blend file which then I'm linking into my file when I want to reference a material ).
    I'm running ver 1.8 of the QUIXEL suite.
    Would you ( or anyone else for that matter ) know what it's all about ?

    Thank you very much,
    Piotr
  • Eric Ramberg
    Pakas - Make sure the color id input is a flattened PNG without any transparency! This is most likely the cause of the crash!
  • Deadity
    Offline / Send Message
    Deadity polycounter lvl 7
    All I get is a a 231 white colour where the UV's are? The script isn't working.

    I had separate objects that all had a different Diffuse BSDF surfaces with different colors that I merged into one object then tried exporting the color layout with no success. What am I doing wrong?
  • iinewmanii
    I bake my color ID map and base color map with blender render by selecting faces on my high poly and creating a material for those faces and applying that material to those faces. Then I just select a color for those faces. After doing that for the whole model I bake textures down to the low poly and export that image. Seems to have worked as it should so far. I dont have any lighting info in my images just flat color. All other images I bake in xnormal. I bake a monochrome curvature according to the settings earthquake posted. Is there a better method that produces better results? All my maps seemed to have worked like they should.
  • NoiseCrime
    Offline / Send Message
    NoiseCrime polycounter lvl 6
    Deadity wrote: »
    All I get is a a 231 white colour where the UV's are? The script isn't working.

    I had separate objects that all had a different Diffuse BSDF surfaces with different colors that I merged into one object then tried exporting the color layout with no success. What am I doing wrong?


    Not sure, doesn't sound like you are doing anything out of the ordinary. Maybe something changed in a recent build of Blender?

    One check you can make is to try Blenders own 'Export UV Layout' from the same menu and see if that renders the object colors or not. If it doesn't then something has changed in blender and this method may no longer work.

    One thing to note is that in Cycles it would appear you need to have a 'settings' rollout from the Surface material, which contains a property 'ViewPort Color' and it is this color that is rendered when using my add-on. This is quite useful as it means you can have independent ID color from the Surface color.
  • NoiseCrime
    Offline / Send Message
    NoiseCrime polycounter lvl 6
    iinewmanii wrote: »
    I bake my color ID map and base color map with blender render by selecting faces on my high poly and creating a material for those faces and applying that material to those faces. Then I just select a color for those faces. After doing that for the whole model I bake textures down to the low poly and export that image. Seems to have worked as it should so far. I dont have any lighting info in my images just flat color. All other images I bake in xnormal. I bake a monochrome curvature according to the settings earthquake posted. Is there a better method that produces better results? All my maps seemed to have worked like they should.


    Don't think there is anything particularly wrong with your system, the purpose of the Color Layout export addon here was just to make it easier and quicker to export than baking.
  • voda22
    I'm kinda new in this topic but as far as i know only low poly mesh needs to be unwraped during baking process. But when I bake color ID i must do this from highpoly model, right?

    So is this above method force me to unwrap highpoly too?
    Can't this diffuse colours be projected in some sort from high poly to low one?
    Sorry if it is stupid question, just saying.
  • romuloarts
    Hi, I am unable to import the addon to blender 2.76  :'(
    I tried copying it manually and importing in the blender add-ons manager, but nothing happens.

    update - I found it at testing options, sorry for being noob.  :p
  • tobiasniva
    I 2nd last post - not working in 2.76.
  • masterxeon1001
    Offline / Send Message
    masterxeon1001 polycounter lvl 7
    I've been experimenting with exporting color maps of material IDs and Im currently using either substance or Blender for it.


    This was how I was dealing with it in substance painter using just the material IDs. Ive been testing it for a while and it works pretty good. Also baking in the Blender render using the shadeless mats and baking full render also does a good job but the AA treatment kills me.
    I'm just baking from high to a UVed low.

    Hope that helps as well

Sign In or Register to comment.