Hey folks,
Now that UDK started supporting custom vertex normals I'm struggling with the archaic Edit Normals modifier in Max and since Google fails me, I'm wondering if anyone has any nice tools or scripts to edit normals in Max in ways that are actually practical. Something like this script for Maya would be great!
http://migugi.net/mel/normalTools/
Specifically all I'm really interested in doing is this, as taken from the script above:
(forcing the connected vertex normals of a certain face to redirect along the face normal)
Much love as always.
Replies
But yeah, Max really isn't so hot for working with them, not only is the Edit Normals modifier kind of shitty, but max tends to mess up the edited normals alot depending on what you do to your model (like attaching stuff, or making other changes to the model).
The only script I have at the moment is one made by Zoffty (I can post it if someone is interested), it just averages the normals of your selected face when you run it, that works in many cases (in your example for instance Rasmus, it would work), but idealy it should align them to the face normal instead.
http://www.polycount.com/forum/showthread.php?p=1149155#post1149155
http://www.polycount.com/forum/showthread.php?p=1152529#post1152529
Theres also some good stuff on the wiki under 'Environment Foilage' : http://wiki.polycount.com/CategoryEnvironment
Ark: Thanks for the info - don't see exactly what I'm looking for but NormalThief looks useful.
I have a feeling this would be a breeze to whip up for anyone versed in MaxScript... I can promise big wet internet kisses to any and all takers :P Can't believe there aren't better tools for doing these things tbh, sort of like the same lack of quality tools when it comes to vertex colors.
[code]
macroScript AverageNormal category:"zOffTy Tools" tooltip:" AverageNormal " buttonText: "AverageNormal"(
--===========================================================================================================================
clearListener()
disableSceneRedraw()
---array pour stoker la face selectionn
Doesn't do exactly what you want tho.
The mig Normal Tools look great.
I looked into this awhile back, here are the (hidden) rules I uncovered.
http://wiki.polycount.com/wiki/VertexNormal#3ds_Max
Basically what I'm imagining is:
1. Make a face selection.
2. Run script.
3. Vertices connected to the selected face have their normals realigned to this face normal.
4. Happy puppyness.
I take that selected contiguous faces keep the normals averaged between their normals. It implies that on a multiple face selection only the selection border vertexes get their normals reoriented. Is it right?
Idealy I'd like a script that takes all my selected faces one by one, and aligns the vertex normals so they are perpendicular to their face. Order doesn't really matter, as usually you'll always have either unselected faces between your selected one, or the faces are coplanar to begin with, so it's not an issue.
Maybe a box with x -x y -y z -z buttons as presets for vertex normals could come in handy too.
rasmus, did the script not work for you? It's not ideal but it still saves me some boring Edit Normals modifier work most of the time.
The script works on Editable Poly Objects only, and it must be the active object in the stack. If not present, the script adds an Edit Normals Modifier right above the base object. Just go into Face sub-object level, make a face selection and run the script.
Get the script here, and find it under Category: Rasmus Tools, Set Normals (sorry, this evening I'm running out of fantasy).
What? I didn't know about the smooth modifier, but I really don't see how it helps here... It just seems to be reassigning smoothing groups, it's not affecting the vertex normals at all?
If you want to collapse the Edit Normal modifier, just substitute line 81:
from with
SyncViewS, works perfectly, you rock. Will tell you if I come across any problems.
Bal: Yeah I did get the script running (thanks) but I don't really see the use for the "Average"-function - to me this should be the same as just uniting the smoothing groups *opens can of worms*
great tools
works better than mine !!
You can add a subobjectLevel = 4 to return in Face selection mod
Thanks a lot !
If I apply the script on a face, that has a neighboring face on a separate smoothgroup, it's gonna edit the vertex normals of the neighboring face, aligning them with the ones from the selected faces, instead of just leaving them alone, fixable?
I don't really see the advantage of it doing this, can't imagine a situation where I'd want to. If I have a face on a different smoothing group, it's that I want that hard edge to stay.
Maybe both commands could be present in the script? I'm surprised it's not doing the same thing for Rasmus, Zoffty tells me he has the same as me on max 2010 64bit.
Thanks again!
You can simply download the script and overwrite the previous one. Enjoy
Thanks again!
http://wiki.polycount.com/wiki/VertexNormal#GetVertNormalsFromFace_MAXScript
To make an example to be sure to make it clear. Imagine to have four faces selected in a 2x2 way. There are 8 vertexes on the perimeter and 1 inner vertex, shared by all faces. The current script set all normals along the perimeter but doesn't reset the inner one. Which means it would be averaged among all shared faces, or if there is a split in smoothing groups, each face normal would be realigned to its face normal.
I couldn't really decide on this, but preferred to leave the inner vertexes unchanged to avoid "undoing" normals modifications inadvertently. Is it good as is right now, or need a change? It would be a matter of a couple of lines of code.
Edit: Thanks Eric, but maybe it would be better to name this script in a more meaningful way before adding it to the wiki. I didn't put a reference in the code either. Since it could still change, maybe you could link the thread only.
Again, thanks a million for spending the time on this, SyncView!
In practice though, I wouldn't notice the difference very often at all. When I have multiple neighboring faces selected like that, they are usually coplanar anyways, so one way or the other it wouldn't make a difference.
As rasmus said, at this point maybe it'd be interesting to expand it to an UI, or multiple commands, but personally the function you've made is the only one I really need for now, so not sure if it'd be worth it (that and surprisingly enough, not many people seem to mess with vertex normals much, especially max users).
Here is the same second release with some more meaningful names and "signed" by me in the code.
Category: Normal Tools
Action: Get Vert Normals from Faces
Bal: Not many people touch it probably because up until today it was useless :P Now we only need someone to take a look at multiple UV channel editing and some decent vertex color tools and Max is without blemishes for UDK folks! *hint hint*
Get the new version here.
Thanksa again! (To Eric too, for taking care of the Wiki so well
Trying to get better lighting for my vegetation... even though it's not bad right now, it would really help make the vegetation look way more natural further away when shadows are not hitting it.
Working in Cryengine 2.
Somehow, if a script could be made to make normals like this, vegetation would be perfectly lit.
The examples in here explain:
http://wypierpapier.blogspot.com/2010_02_01_archive.html
what version of 3ds Max are you on?
The script works on Editable Polygons only, make sure you are not trying to run it on Editable Meshes, otherwise it won't do anything.
To make a quick test: create a sphere, convert it to Editable Poly, select any face close to the equator (it is easier to spot the effect) and run the script. You should see a difference in the surface smoothing.
To double check if it worked, apply an Edit Normals modifier. If the script worked you should see the face affected with green normals, rather than blue, exactly perpendicular to it.
I've test it out and it works! But I had to spend some time to find out that before I use the script I have to set one smooting group to the mesh/part I'm working on (on stairs it's good to seet one SG to one stair). After that I can select face by face and hit shortcut with the script. It's awesome! Thanks!
http://dl.dropbox.com/u/1397854/polycount/stash/SetNormals_02.zip
I couldn't get it to work though. Could you give me a step-by-step how to use it?
1. Make an Editable Poly model, with a bevel.
2. Select one of the polygons on one side of the bevel.
3. Assign it a smoothing group.
4. Run the script.
Nothing happens? Tried in Max 2015, and in Max 2012.
I had to make break/hard concave between steps, right? I did it by assigning different smoothing groups on each step.
And before whole thing, go to edit normals, select all normals and hit reset, collapse to editable poly.
Currently I'm working on 20 meshes with steps and this technique helped me a lot, a huge time saver.
1. Add an Edit Normals modifier, select all normals, Reset, Collapse the stack.
2. Select all the faces, apply Smoothing Group 1.
3. Select the top face, run the script.
4. Select the bottom face, run the script.
Nothing happens?
Here's the file (3ds Max 2015 format)
http://www.ericchadwick.com/examples/images/SetNormals_Stair_Max2015.max
I have only max 2014: