| Very introductory Maxscript tutorial 2 |
Nik Clark |
I much prefer to use maxscript/new rather than the listener. You can run the whole thing or individual chunks of code, and you can save your code. I presume Dub is coming to that.

read 3388 times 11/22/2006 2:08:42 PM (last edit: 11/22/2006 2:13:57 PM)
|
-=LeadMagnet=- |
Well Nik i have no idea what you just said... so i hope so.
 Do A Barrel Roll!!!
read 3386 times 11/22/2006 2:10:12 PM (last edit: 11/22/2006 2:10:12 PM)
|
Nik Clark |
I don't want to step on Dub's feet, so I'll not go into detail, but tools/maxscript/new. You get an empty maxscript in it's own window, which is much nicer than messing about with the listener to type code into.

read 3383 times 11/22/2006 2:15:01 PM (last edit: 11/22/2006 2:15:01 PM)
|
Dub. |
:-)
I am more than happy for other maxscripters to contribute/ correct errors etc.
A lot of the stuff I'm doing isn't the only or best way to do things. I'm just trying to avoid complexity at this stage.
Please do make any suggestions you can think of Nik!
read 3379 times 11/22/2006 3:06:14 PM (last edit: 11/22/2006 3:06:14 PM)
|
vlady. |
Ok, question : you got this code : for obj in $ do ( if (obj.modifiers[#turbosmooth] != undefined) do ( obj.modifiers[#turbosmooth].iterations = 1 obj.modifiers[#turbosmooth].useRenderIterations = true obj.modifiers[#turbosmooth].renderIterations = 2 ) )
Now, let's say I have no turbosmoothing. In order to create a turbosmooth fot the object, and apply the properties, my code would be :
for obj in $ do ( if (obj.modifiers[#turbosmooth] != undefined) do ( obj.modifiers[#turbosmooth].iterations = 1 obj.modifiers[#turbosmooth].useRenderIterations = true obj.modifiers[#turbosmooth].renderIterations = 2 ) else do (ob.modifiers[#turbosmooth]=true; ) )
or ?

I have somewhat changed the fluffy avatar.
read 3364 times 11/23/2006 3:05:24 AM (last edit: 11/23/2006 3:05:24 AM)
|
-=LeadMagnet=- |
nah, the command to add a turbosmooth modifier is: addModifier $ (Turbosmooth())
 Do A Barrel Roll!!!
read 3359 times 11/23/2006 3:43:22 AM (last edit: 11/23/2006 3:43:22 AM)
|
Dub. |
Leadmagnet is right. Also you don't need the last "do" So it should look like this:
for obj in $ do ( if (obj.modifiers[#turbosmooth] != undefined) do ( obj.modifiers[#turbosmooth].iterations = 1 obj.modifiers[#turbosmooth].useRenderIterations = true obj.modifiers[#turbosmooth].renderIterations = 2 ) else ( addModifier obj (turbosmooth()) ) )
read 3347 times 11/23/2006 11:52:49 AM (last edit: 11/23/2006 11:53:19 AM)
|
cre |
for obj in $ do ( obj.modifiers[#turbosmooth].iterations = 1 obj.modifiers[#turbosmooth].useRenderIterations = true obj.modifiers[#turbosmooth].renderIterations = 2 )
Works really fine but whenever i tried to use
for obj in $ do ( if (obj.modifiers[#turbosmooth] ! = undefined ) do ( obj.modifiers[#turbosmooth].iterations = 1 obj.modifiers[#turbosmooth].useRenderiterations = true obj.modifiers[#turbosmooth].renderIterations = 2 ) ) -- Syntax error: at ), expected < facto r > -- In line: )
whats the problem?????
read 2668 times 3/28/2008 5:59:34 PM (last edit: 3/28/2008 6:14:16 PM)
|
s_purs |
hey i have the same problem as cre.
even if i simply copy and paste any of the codes in the tutorial into mxs it comes out with:
-- Syntax error: at ), expected < facto r > -- In line: )
anybody know whats wrong?
read 1615 times 7/13/2009 5:29:22 AM (last edit: 7/13/2009 5:29:22 AM)
|
Dub. |
are you highlight selecting the whole lot before executing it?
if you just execute the last line, that is the sort of error you will get
read 1607 times 7/13/2009 5:50:39 AM (last edit: 7/13/2009 5:50:39 AM)
|
s_purs |
aha, thank you.
sorry if you said that in your tutorial and i missed it.
wondered why none of the codes would work when i tried.
thanks
read 1598 times 7/13/2009 6:32:54 AM (last edit: 7/13/2009 6:32:54 AM)
|