Home Technical Talk

Modo: Average normals?

polycounter lvl 13
Offline / Send Message
Ramseus polycounter lvl 13
Hey duders, just wondering if anyone knows if it's possible to average normals in Modo. I'm using 701.

Basically I've got a bunch of ground/dirt tiles with extremely obvious seams because the normals are just doing their thing. Other than smashing them all together into a gigantic mesh all I can think of to fix it is modifying the normals, which I don't know if modo even allows.

Replies

  • Farfarer
    Options
    Offline / Send Message
    That functionality isn't built in to modo, but I could certainly script it. Been looking for features to add to my vertex normal toolkit, I think that'd be a good one.

    If you have the time, as a work-around, you could merge them together, bake the normals (Vertex Map > Bake Vertex Normals... I think), then split the mesh back apart. The normals get stored in a vertex map which remains unaffected by geometry edits.
  • Farfarer
    Options
    Offline / Send Message
    If you grab this script...

    http://www.farfarer.com/temp/averageselectednormals.zip

    ...extract it to your modo Scripts folder, bind a key or add a button to run the command...

    @averageselectednormals.py

    ...then you can select some verts and run the script and it'll average the normals of all the selected verts and assign that averaged normal to each of them.
    Works across multiple meshes/layers.
  • Ramseus
    Options
    Offline / Send Message
    Ramseus polycounter lvl 13
    I would love you long time if you made that script. Would be nice for foliage too. I've used Max scripts for normal averaging stuff before, but I can't 'educate' myself on Max anymore ;)

    I'll try that vertex baking for now, should work better than nothing in any case. I've never actually done it but I've seen normal vertex maps plenty of times on imported meshes.


    edit: maybe I shouldn't wander off mid typing a post, thanks so much I'll go take it for a test run
  • Ramseus
    Options
    Offline / Send Message
    Ramseus polycounter lvl 13
    Looks like my ground issue's going to need a bit more effort to fix, but the script works great! I just averaged a bunch of foliage with a sphere and it took about about a second, imports perfectly to ue3.

    Just one thing I noticed, the script complains about not being able to find something if there's an existing vertex normal map or if one mesh has one generated by your script and another selected mesh doesn't. Not a big deal IMO.
  • Farfarer
    Options
    Offline / Send Message
    Yeah, modo's a bit crappy like that. There's ways around it, but I just quickly hacked this together from bits of script I had lying around - it's not very foolproof, sorry.

    I'll update it tomorrow with something more solid :)
  • Farfarer
    Options
    Offline / Send Message
    Download it again and give it another try, put a hacky fix in for that :)
Sign In or Register to comment.