sethwolford
09-05-2006, 06:02 AM
I am new to maxscript and I am trying to modify a script that I was working on. Originally the script is part of CG-academy's fundamental set.
What I am trying to accomplish is to pick certain verts on a plane and have the script create a tree on that vert. Here is what I came up with
if selection.count == 1 then
(
vertexcount = getvertselection $.mesh
for index in vertexcount do
(
newpos = meshop.getvert $.mesh vertindex
newpos = newpos * $vertex.transform
newheight = random 80.0 150.0
makesingletree newheight newpos
)
group $myObject* name:"trees"
)
else
(
messagebox "Popeye says Select Mesh"
)
but when I run it I get an error saying "--Unable to convert :undefined to type: Integer"
if someone could explain what I am doing wrong I would be most grateful.
What I am trying to accomplish is to pick certain verts on a plane and have the script create a tree on that vert. Here is what I came up with
if selection.count == 1 then
(
vertexcount = getvertselection $.mesh
for index in vertexcount do
(
newpos = meshop.getvert $.mesh vertindex
newpos = newpos * $vertex.transform
newheight = random 80.0 150.0
makesingletree newheight newpos
)
group $myObject* name:"trees"
)
else
(
messagebox "Popeye says Select Mesh"
)
but when I run it I get an error saying "--Unable to convert :undefined to type: Integer"
if someone could explain what I am doing wrong I would be most grateful.
