|
created Editing vertex normals in Max, got scripts?
on 08-11-2010 03:15 AM
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.
|
, polycounter,
810 Posts,
Join Date Dec 2007,
Location Tokyo, Japan
|
Yeah, I'm interested in this for the same reasons, now that I can use edited vertex normals in UDK, I'm doing it all over the place.
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.
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
, dedicated polycounter,
1,398 Posts,
Join Date Aug 2009,
Location UK
|
Bal: Cool, mind posting it?
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.
|
, polycounter,
810 Posts,
Join Date Dec 2007,
Location Tokyo, Japan
|
Here's the one I have rasmus, as I said, it's only really useful in some specific situations.
Code:
macroScript AverageNormal category:"zOffTy Tools" tooltip:" AverageNormal " buttonText: "AverageNormal"(
--===========================================================================================================================
clearListener()
disableSceneRedraw()
---array pour stoker la face selectionné, et la futur conversion en normal
my_face = #{} --array pour la face selectionné
my_normals = #{} --array du resultat de la face
---defini la face selectionné
my_face = $.EditablePoly.GetSelection #Face
---rajoute un edit normal
modPanel.addModToSelection (Edit_Normals ()) ui:on
---passe en mode face
$.modifiers[#Edit_Normals].selectBy = 3
---clear les selections precedente
$.modifiers[#Edit_Normals].EditNormalsMod.SetSelection #{}
---converti la face en normal
$.Edit_Normals.ConvertFaceSelection &my_face &my_normals
$.modifiers[#Edit_Normals].EditNormalsMod.Select my_normals
---fait un reset de la face au cas ou elle serait déja normalisé
$.modifiers[#Edit_Normals].EditNormalsMod.Reset ()
--- fait l'average avec le thresold off
$.modifiers[#Edit_Normals].EditNormalsMod.Average useThresh:off threshold:0.1
---collapse le merdier et retour sous edit poly
maxOps.CollapseNodeTo $ 1 off
enableSceneRedraw()
subobjectLevel = 4
)--end macro
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
Here's a quicker version of the NormalThief script (copies normals from one object to another) http://www.polycount.com/forum/showt...03#post1178203
Doesn't do exactly what you want tho.
The mig Normal Tools look great.
|
, Polycount.com Editor,
6,684 Posts,
Join Date Oct 2004,
Location Boston USA
|
Quote:
Originally Posted by Bal
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).
|
I looked into this awhile back, here are the (hidden) rules I uncovered.
http://wiki.polycount.com/VertexNorm...als_in_3ds_Max
|
, Polycount.com Editor,
6,684 Posts,
Join Date Oct 2004,
Location Boston USA
|
Cool, thanks Eric, I'd learnt most of this by trial and error, but never took the time to really try out what exactly works or doesn't work.
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
What's weird is they kind of fixed some of worser bits in 2010, but left the other problems in.
|
, Polycount.com Editor,
6,684 Posts,
Join Date Oct 2004,
Location Boston USA
|
Hmm I'm stumped guys - can I implore someone out there to take a look at writing a quick script that does what my first post describes? It could be as simple as the script posted by Bal, anything would be really appreciated. By now a lot of people use UDK and MAX and the complete lack of adequate handling of vertex normals is making me a sad puppy... SyncView? Render? All you other wizards?
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.
|
, polycounter,
810 Posts,
Join Date Dec 2007,
Location Tokyo, Japan
|
isn't select faces and avarage selected doing pretty much this?

Last edited by Neox; 08-19-2010 at 09:11 AM..
|
, veteran polycounter,
3,192 Posts,
Join Date Sep 2006,
Location Berlin Germany
|
I think it is, as long as you do it on one polygon at a time. The normals for the faces at the far left in your example don't seem to be pointing along their face normals.
|
, Polycount.com Editor,
6,684 Posts,
Join Date Oct 2004,
Location Boston USA
|
I'm on it, trying something simple to begin with, then add functionalities as needed. It will require an Edit Normals Modifier though. I'm starting with support for Editable Poly Object only, eventually extend to modifiers.
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?
|
, polygon,
586 Posts,
Join Date Dec 2008,
Location Leamington Spa, UK
|
yeah a bit bad example as its curved in space, on a flat plane it will do the normal you want, otherwise you'll have to do it on a per face level
|
, veteran polycounter,
3,192 Posts,
Join Date Sep 2006,
Location Berlin Germany
|
Neox, no doing average just averages the normals, if the angles of the neighboring faces are different, the resulting vector won't always be perpendicular to the face (which is what we want).
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.
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
Quote:
Originally Posted by Bal
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.
|
Don't need a script for this really. Select your faces, add a Smooth modifier, collapse the stack, done.
|
, Polycount.com Editor,
6,684 Posts,
Join Date Oct 2004,
Location Boston USA
|
Hi guys, I put together a fast script that should do the trick, it should be like the migNormalTools "Fillet Outside".
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).
|
, polygon,
586 Posts,
Join Date Dec 2008,
Location Leamington Spa, UK
|
SyncViews, this is great! Exactly what I wanted, now I just need to set it up so it auto collapses the Edit Normals afterwards (I never need to keep it around). Thanks alot.
Quote:
Originally Posted by Eric Chadwick
Don't need a script for this really. Select your faces, add a Smooth modifier, collapse the stack, done.
|
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?
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
Hi Bal, I'm glad you like it. It is not super tested, so let me know about any issue.
If you want to collapse the Edit Normal modifier, just substitute line 81:
from
Code:
modPanel.setCurrentObject theEditObj
with
Code:
maxOps.collapseNodeTo theNode theNode.modifiers.count true
|
, polygon,
586 Posts,
Join Date Dec 2008,
Location Leamington Spa, UK
|
Smoothing groups do in fact edit the vertex normals. But I think it's not what you want anyhow, since it breaks the vertex normals on the edge of the selection, instead of just bending them.
|
, Polycount.com Editor,
6,684 Posts,
Join Date Oct 2004,
Location Boston USA
|
Eric, yeah I think you misunderstood what I wanted (or I didn't explain it clearly enough  . Had me worried there, thought for a second there was a modifier already present in max to do what I wanted all along, heh.
SyncViewS, works perfectly, you rock. Will tell you if I come across any problems.
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
Wow, now that's what I'm talking about! Works like a dream  Thanks a million SyncView, you do indeed rock!
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* ;)
Last edited by rasmus; 08-19-2010 at 07:14 PM..
|
, polycounter,
810 Posts,
Join Date Dec 2007,
Location Tokyo, Japan
|
yeah!
great tools
works better than mine !!
You can add a subobjectLevel = 4 to return in Face selection mod :p
Thanks a lot ;) !
|
, spline,
165 Posts,
Join Date Sep 2006,
Location Paris
|
Ok, found a bug, or at least something unwanted I think.
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?
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
Bal: I think that's a matter of preference  I'd have to test it some more, but from what I could see nothing happens to faces that don't share smoothing (unlike Maya, where editing normals naturally forces smoothing across the affected faces). What I'm saying is, I wish it did what you describe  I had to set a common smoothing for the affected faces first, then run the script to see the effect (Max 2010 x64).
|
, polycounter,
810 Posts,
Join Date Dec 2007,
Location Tokyo, Japan
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|