PDA

View Full Version : script or plugin to remove all smoothing groups


himadri_sm
12-22-2010, 06:42 AM
i am using max & i have a scene that has a lot of objects & all of them have smoothing groups.manually i'll have to select each object & remove the smoothing groups one by one.is there any script or plugin that will help me get rid of all the smoothing groups from all the objects together. removing them individually per object is really time consuming. thanx.

Xoliul
12-22-2010, 07:18 AM
Select all, add "Smooth" modifier ?

dtschultz
12-22-2010, 07:41 AM
Or just select all and add an edit poly modifier. Then remove all smoothing groups. Collapse stack.

Mark Dygert
12-22-2010, 10:53 AM
by watching the MaxScript Listener Window you can probably come up with quick script that applies a smooth modifier and removes all smoothing, then collapses.

I cover watching it and writing a simple script in this post:
http://www.polycount.com/forum/showthread.php?t=78992

Bigjohn
12-22-2010, 11:22 AM
Select all, add "Smooth" modifier ?

Yes, this is by far the easiest way to do it if you have a bunch of objects.

Also, I love this script:
http://www.scriptspot.com/3ds-max/scripts/smooth-to-prevalent-smoothing-group

I have it assigned to a key, and it makes it real easy to maintain smoothing groups when working on a mesh. Especially when you extrude and whatnot and it resets the smoothing groups for the new polys. Also, in Max2011 you can bind a key to a popup window with the smoothing groups selection box.

cw
12-22-2010, 02:02 PM
here you go


macroScript cw_all1smooth
category:"CWtools"
tooltip:"cw_all1smooth"
(
-- set all selected to 1 smooth group

fn all1smooth sel=
(
for a in sel do
(
if classof a == editable_poly then
(
polyop.setFaceSmoothGroup a #all 13
)
)

)

all1smooth (selection as array)

)

macroScript cw_allnosmooth
category:"CWtools"
tooltip:"cw_allnosmooth"
(
-- set all selected to no smooth group

fn allnosmooth sel=
(
for a in sel do
(
if classof a == editable_poly then
(
polyop.setFaceSmoothGroup a #all 0
)
)

)

allnosmooth (selection as array)

)

Jonathan
12-23-2010, 08:25 AM
And a second option if you'd like. :)

Feel free to ask for new stuff. Maxscript is fun. :D

http://3dfergy.net/__oneclick_uploads/2010/12/smoothshop3df.gif
http://3dfergy.net/__oneclick_uploads/2010/12/smoothshop3df.zip
http://3dfergy.net/__oneclick_uploads/2010/12/smoothteapots.gif

himadri_sm
12-23-2010, 10:55 AM
thanx a lot for the great help guys...actually the easiest way is to add just a smooth modifier & collapse.i went with that.

Jonathan
12-23-2010, 11:28 AM
Yeah, that's sorta like what this one does, as normally using Max modifiers allow less memory usage and faster performance as it access the functions from the C++ core, IIRC,


--UI, function stuff, etc. removed to show the main example
--snip
if selection.count >= 1 then
(
local polycountSmoothModi = (Smooth autosmooth: FacetdFaces threshold: smoothAngle name: ("SmoothBy" + (smoothAngle as string)))
for o in selection do if superClassOf o == geometryClass do
(
addModifier o polycountSmoothModi
if (cnvToP) then
(
convertToPoly o
)
)
)

else
(
messageBox "No objects selected. Please select at least one object." beep:false
)
)

--snip

You can use polyOp and meshOp operations, but in the tests I've run, they're 30% slower, but either way, whatever gets the job done. :)

cw
12-23-2010, 11:54 AM
Heh heh nice stuff Jonathan. For me, 30% of a few miliseconds is bearable overhead. I should look more into using the stack. SOmetimes it's much neater way to achieve necessary results.

You're right though, scripting is kind of fun. Especially when it saves time longer term. :D

Jonathan
12-23-2010, 01:43 PM
Yeah, there's like 10 ways to do everything in Max due to "legacy support", so sometimes it's cool to see all the various ways people solve problems in Max.

:)