Home Technical Talk

[Max] mesh exploder for baking normal maps

polycounter lvl 12
Offline / Send Message
hannes d polycounter lvl 12
Hello

I started creating a mesh exploder for baking normal maps
here is my progress so far

feel free to let me know your ideas and feedback

planned features 

- recognise lowpoly / hipoly mesh 
- name them, link them
- explode mesh, hp follows lp
- setup baking, projection, cage etc
- bake normal map, apply to non exploded preview lp mesh

the idea has been in my head for a while but decided to actually start on it this evening
progress so far


Replies

  • Pac_187
    Offline / Send Message
    Pac_187 polycounter lvl 11
    Hey, though it's already a bit old and the website doesn't exist anymore, you might want to take a look at RTTassist.
    It already does what you are about to create. http://www.scriptspot.com/3ds-max/scripts/rttassist
    The Youtube videos and downloads are still available on Scriptspot.

    Just wanted to give a hint before you dive deeper into development, because this is going to result in a pretty big task :P

  • hannes d
    Offline / Send Message
    hannes d polycounter lvl 12
    i have heard about it several years ago ,never tried it though :P
    but the download link is actually down
    scriptspot doesnt allow you to upload scripts, only link to external sources (as far as i am aware)

    so since their website is down all images and download links on scriptspot are too.

    edit: i stand corrected, can download the attachment from scriptspot :D
    ----------------------
    talking about down, the internet was down on work all day so had some spare time to continue on this and managed to create the highpoly lowpoly link
    now lowpoly mesh gets exploded and the highpoly follows it
    it does it currently based on name suffix _HP and _LP and need the exact same name

    now i need to think of a way to add support for floaters
    i already have support for linking several objects but havent decided yet how i ll find them, let alone automatically 


    in the giv blue meshes are highpoly, white meshes are lowpoly
    the highpoly meshes keep their offset compared to their lowpoly

    the blue one that doesnt move in the middle is a floater

    next goals:
    think of a way how the user or script should link them
    do i want to base it on:
    -name
    -position 
    -size bounding box 
  • Zombiecrackers
    Offline / Send Message
    Zombiecrackers polycounter lvl 5
    This looks awesome! Colour me interested for sure!
  • hannes d
    Offline / Send Message
    hannes d polycounter lvl 12
    trying to do it based on position, center, and/or bounding box is fancy but it leaves tricky situations like highpoly floaters, or 2 meshes with the center or position on same location
    example : a sphere inside of a donut

    the program cant autodecide which mesh the floater belongs to since pivot is offset quite a bit
    could use a floater namingconvention and attach it to a mesh under it with raycast
    but then there is the hassle of which direction will the raycast take into account
    a easy way to do it is let the artist manually link floaters to the highpoly meshes, this would work but involves manual work

    also i think i can assume that when an artist makes a model he names at least the lowpoly parts. then again if they all get combined in 1 mesh at the end you could skip the naming step 
    so doing it based on naming conventions is the easiest way but i assume some people dont always use them, especially when quickly modelling stuff, or personal work

    someone sended me a private video of a tool that does exactly what i am planning to do
    and they seem to manually assign lowpoly highpoly, and dont use floaters
    it seems it is based on position, which i originally had planned however it comes with the disadvantage that if your pivot changes this would break it

    current plan
    -link HP and LP based on naming conventions
    -create autonamingconvention that guesses the correct name for the highpoly if your models are called "box004" instead of "magazine_LP"
    -manually link floaters to hp parent as part of modelling stage

    floaters could also be guessed based on closeness to a mesh its center, but this will lead to not always correct results
    so this should be discouraged imo since easy to miss
    or could guess based on naming convention also

    this leaves what if we have 2 highpoly meshes for 1 lowpoly

    magazine_01_HP
    magazine_02_HP

    magazine_a_HP
    magazine_b_HP

    or could also be solved by manually linking to main highpoly
    just like floaters
    then their name doesnt matter
  • Amatobahn
    Offline / Send Message
    Amatobahn polycounter lvl 7
    Are you targeting a certain third party baker or using Max's render to texture? If it is the latter I would suggest a completely different route using material IDs. You would then not have to worry about exploding the mesh at all.
  • hannes d
    Offline / Send Message
    hannes d polycounter lvl 12
    @Amatobahn
    the end goal is third party bakers like xnormal
    but atm i am only using max 
    the material ID sounds interesting. Do you have any more info about this 
  • monster
  • hannes d
    Offline / Send Message
    hannes d polycounter lvl 12
  • hannes d
    Offline / Send Message
    hannes d polycounter lvl 12
    update

    added projection modifier and combine meshes


  • hannes d
    Offline / Send Message
    hannes d polycounter lvl 12
    got v1.0 up

    scriptspot page is awaiting approvel, here is the download link meanwhile
    http://www.scriptspot.com/files/u53562/explode_1.0.ms

    atm recognises low and highpoly based on name
    supports custom pre and suffix

    tweak the slider to make it explode

    then click create projection and it adds the projection modifier and all highpolies to the modifier
    (or export to xnormal or whatever)

    need to make a gif but cant atm :P
Sign In or Register to comment.