[Closed] select all
hmm… that was really weird, i got that working a while ago… i guess i mustve copied and pasted the wrong codeor sumthing…and i tend to press CTRL+Z alot eheh, although maxscript only has 1 undo. well anyway, im really sory if i hav dissapointed u …(well, im a lil dissapointed at myself for not double cheking the script) … but this time its for real, i hav screen grabs of the b4 and after evaluation below.
well… i really hope this helps…
attachments are limited to 2 posts so… heres the remainder of the grabs…
in the two previous scripts, on the first method “selection”, i forgot to change this:
convertTo $ Editable_Poly
to this
convertTo i Editable_Poly
and on the next one…
this line:
if superclassof $ == shape do
to
if superclassof $[i] == shape do
and since i dont hav the Unreal plugin, i disabled them temporarily
thus, i ran the 3rd script with all those objects selected, here’s the result in the listener…
objsel = selection
for i in 1 to objsel.count do print objsel[i].name
"Rectangle01"
"Line03"
"Circle01"
"Line02"
"Line01"
OK
Hey, thank you, at least the first one is allready working flawlessy, which was the one I think I’ll be using most.
Another idea though, what if I wanted to have the last action (add a certain modifier) to add instances of that modifier to all the selected objects.
So if I change one property on one of these objects, I change properties on all previously selected object. That way, I wouldn’t have to make several macro’s for each operation, I’d just change one parameter afterwards…
So do you know how to code th last action to make instanced modifiers by any chance?
yup, that I know of.
to instance mods
mymod = bend()
addmodifier selection mymod
for non-instance mods
mymod2 = copy mymod
addmodifier selection mymod2
glad to hear something is finally working! hehe.
a very good resource of maxscripts (in case u didnt know yet ).
www.scriptspot.com
u can learn by looking at how they did some scripts from there.
Nope, doesn’t work.
well, at least, it does give the selection a shared modifier, but it also piles up the amount of modifiers.
So the first line has 1 mod, the second 2 etc…
Regardless of where I place the new lines of code, inside, before, or after the for loop, it just ends up piling up the modifiers. I suppose I’m merely making yet another mistake, either way, here’s the latest script, the one that logically seems best for this task
macroScript JamlanderMacro2
category:"JamlanderHelper"
toolTip:""
(
for i in selection do
(
if superclassof i == shape do
(
addmodifier i (extrude())
i.modifiers[#Extrude].amount = 128
i.modifiers[#Extrude].mapCoords = on
i.modifiers[#Extrude].matIDs = on
i.modifiers[#Extrude].smooth = on
i.modifiers[#Extrude].capType = 0
i.modifiers[#Extrude].capStart = on
i.modifiers[#Extrude].capEnd = on
)
addmodifier i (Uvwmap())
i.modifiers[#UVW_Mapping].maptype = 4
addmodifier i (Normalmodifier())
i.modifiers[#Normal].unify = on
i.modifiers[#Normal].flip = on
convertTo i Editable_Poly
)
mymod = (Unreal_Brush())
addmodifier selection mymod
)
Placing the mymod line before the loop and the addmodifier line after the loop didn’t work either. I tried placing them both before(although that can’t be the way, since it first applies the ubrush then…) the loop, but it seems to me it’s logical to place them after the loop? right? Still doesn’t work But hey, I’m getting there.
mymod = (bend())
for i in selection do
(
if superclassof i == shape do
(
addmodifier i (extrude())
i.modifiers[#Extrude].amount = 128
i.modifiers[#Extrude].mapCoords = on
i.modifiers[#Extrude].matIDs = on
i.modifiers[#Extrude].smooth = on
i.modifiers[#Extrude].capType = 0
i.modifiers[#Extrude].capStart = on
i.modifiers[#Extrude].capEnd = on
)
addmodifier i (Uvwmap())
i.modifiers[#UVW_Mapping].maptype = 4
addmodifier i (Normalmodifier())
i.modifiers[#Normal].unify = on
i.modifiers[#Normal].flip = on
convertTo i Editable_Poly
addmodifier i mymod
)
I placed the “mymod = (bend())” at the top, not within the script. If we place it within the loop, the value of mymod will get defined each time the loop iterates, we just need to define it once so the value (even though its still the same modifier) will remain constant.
The “addmodifier i mymod” was placed within the script, so that we could assign the value “mymod” (which was defined once) to each object in the loop.
In latter example, we used “selection” and if we place that within the loop, it will assgin a modifier to all of our selection for every loop pass. thats why you have piled up modifiers.
You were getting close, “Placing the mymod line before the loop and the addmodifier line after the loop didn’t work either”, the addmofier line must be inside the loop.