About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
???
So regarding Your code, I'm not maxscript master, I making my first baby steps in maxscript so I would need more explanation regarding this script:
fn reassignModifier mode: modyClass: =
(
local tsArr = getClassInstances modyClass
local objs = case mode of
(
#all:
(
if tsArr.count == 0 then #() else
(
for i = 1 to tsArr.count where (nodes = refs.dependentNodes tsArr[i]).count != 0 collect nodes[1]
)
)
#selection:
(
if selection.count == 0 then #() else
(
local firstInstances = #()
for o in selection where o.modifiers.count != 0 do
(
InstanceMgr.GetInstances o &firstOnly
if firstOnly.count > 1 then append firstInstances firstOnly[firstOnly.count-1] else append firstInstances o
)
firstInstances
)
)
)
if objs.count != 0 and tsArr.count != 0 do
(
max create mode
with redraw off
(
for o in objs do
(
for m = o.modifiers.count to 1 by -1 where isKindOf o.modifiers[m] TurboSmooth do
(
bulb = o.modifiers[m].enabled
mody = copy o.modifiers[m] ; mody.enabled = bulb ; deleteModifier o m ; addModifier o mody before:(m-1)
)
)
)
)
)
I created some objects with active turbosmooth, fired it up and I noticed script do preety much nothing:) I eresed
"addModifier o mody before:(m-1)" line 37 so cript should only delete modyfiers(it's only way for me to check if script work, because modyfier look identical before and after execution) but it seems script dont erase modyfiers. I have also impression that max don't touched this modyfiers - last script make it blink - there was some reaction on max modyfi interface . I don't even know is it working at all or it's work and I use it in wrong way? Next thing is, you gave to line for action on selection and action for all scene elements but how to use it, exactly, how to create two different script for this using this command. Next thing is script copy and paste this same turbosmooth. When there is skin glitch cased by turbosmooth - turbosmooth must be deleted and added new because contain glitch so if I copy and paste this same turbosmoothit is useless.So settings from oryginal turbosmooth mus be taken, old turbosmooth must be removed, new added and settings from oryginal must be set also check if turbosmmoth is active or not and set it identical.
I know my understanding of maxscript leave a lot to be desired but I'm beginner:)
Can You explane this script, please, maybe I just don't get it.
Don't retired, people need help:)
...
this solution works for any modifier class and both (selection and all scene)
You have two fn arguments: "mode" and "modyClass"
This will works only on selected objects
and this will take to acount all scene modifiers of specified class
BTW... This is my 15000 point on this forum (see "users by points").
Maybe it's time to retire. Why do you think?
:)
bga
.
Make your 15 001 post and post the code above in the right thread. :)
Tools and Scripts for Autodesk 3dsMax
...
:) Yes. You are right! :)
This is the right thread:
http://www.scriptspot.com/forums/3ds-max/general-scripting/replacing-mod...
bga
Or you can use instance
Or you can use instance trimmer from neil blevins script pack (which everyone should have installed already :-) )
...
Try this
bga
Very Nice!
Could it me made to select all the objects that are not instances too?
so if I wanted to apply a modifier in all selected objects, that it would select the one instanced object like in the script and the objects that are not instances as well.
I could really use something like this.
Thanks!
Eric
...
Yup. Script select all non-instances object and first instace
bga
Cool...how do I add this to
Cool...how do I add this to the script below?
(
if selection.count != 0 do
(
local firstInstances = #()
for o in selection do
(
InstanceMgr.GetInstances o &firstOnly
if firstOnly.count > 1 do
append firstInstances firstOnly[firstOnly.count-1]
)
if firstInstances.count != 0 do select firstInstances
)
)
...
Which script below?
bga