Author : afisher


Reply
Reply
 
Thread Tools Display Modes
rasmus's Avatar
Old (#1)
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.
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

Bal's Avatar
Old (#2)
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.
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

Ark's Avatar
Old (#3)
Theres a couple of threads with some scripts and info:

http://www.polycount.com/forum/showt...55#post1149155

http://www.polycount.com/forum/showt...29#post1152529

Theres also some good stuff on the wiki under 'Environment Foilage' : http://wiki.polycount.com/CategoryEnvironment
Offline , dedicated polycounter, 1,398 Posts, Join Date Aug 2009, Location UK  
   Reply With Quote

rasmus's Avatar
Old (#4)
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.
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

Bal's Avatar
Old (#5)
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
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

Eric Chadwick's Avatar
Old (#6)
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.
Offline , Polycount.com Editor, 6,684 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

Eric Chadwick's Avatar
Old (#7)
Quote:
Originally Posted by Bal View Post
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
Offline , Polycount.com Editor, 6,684 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

Bal's Avatar
Old (#8)
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.
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

Eric Chadwick's Avatar
Old (#9)
What's weird is they kind of fixed some of worser bits in 2010, but left the other problems in.
Offline , Polycount.com Editor, 6,684 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

rasmus's Avatar
Old (#10)
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.
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

Neox's Avatar
Old (#11)
isn't select faces and avarage selected doing pretty much this?


Last edited by Neox; 08-19-2010 at 09:11 AM..
bonus vir semper tiro.

Steffen 'Neox' Unger
It's Airborn Baby!

freelance 3d artist
for hire
Offline , veteran polycounter, 3,192 Posts, Join Date Sep 2006, Location Berlin Germany Send a message via ICQ to Neox  
   Reply With Quote

Eric Chadwick's Avatar
Old (#12)
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.
Offline , Polycount.com Editor, 6,684 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

SyncViewS's Avatar
Old (#13)
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?
IllusionCatalyst – Instrument set for 3ds Max │ AliquaForma – Personal portfolio in fieri
Offline , polygon, 586 Posts, Join Date Dec 2008, Location Leamington Spa, UK  
   Reply With Quote

Neox's Avatar
Old (#14)
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
bonus vir semper tiro.

Steffen 'Neox' Unger
It's Airborn Baby!

freelance 3d artist
for hire
Offline , veteran polycounter, 3,192 Posts, Join Date Sep 2006, Location Berlin Germany Send a message via ICQ to Neox  
   Reply With Quote

Bal's Avatar
Old (#15)
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.
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

Eric Chadwick's Avatar
Old (#16)
Quote:
Originally Posted by Bal View Post
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.
Offline , Polycount.com Editor, 6,684 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

SyncViewS's Avatar
Old (#17)
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).
IllusionCatalyst – Instrument set for 3ds Max │ AliquaForma – Personal portfolio in fieri
Offline , polygon, 586 Posts, Join Date Dec 2008, Location Leamington Spa, UK  
   Reply With Quote

Bal's Avatar
Old (#18)
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 View Post
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?
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

SyncViewS's Avatar
Old (#19)
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
IllusionCatalyst – Instrument set for 3ds Max │ AliquaForma – Personal portfolio in fieri
Offline , polygon, 586 Posts, Join Date Dec 2008, Location Leamington Spa, UK  
   Reply With Quote

Eric Chadwick's Avatar
Old (#20)
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.
Offline , Polycount.com Editor, 6,684 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

Bal's Avatar
Old (#21)
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.
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

rasmus's Avatar
Old (#22)
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..
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

zOffTy's Avatar
Old (#23)
yeah!
great tools
works better than mine !!

You can add a subobjectLevel = 4 to return in Face selection mod :p

Thanks a lot ;) !
Offline , spline, 165 Posts, Join Date Sep 2006, Location Paris Send a message via MSN to zOffTy  
   Reply With Quote

Bal's Avatar
Old (#24)
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?
Offline , polycounter, 1,011 Posts, Join Date Jun 2006, Location Paris / France  
   Reply With Quote

rasmus's Avatar
Old (#25)
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).
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch