PDA

View Full Version : Index out of bounds?


MOSS
10-16-2008, 10:03 PM
I'm trying to create a script that would create helpers at each cv of a nurbs surface.

nSet = getNURBSSet $
for i in 1 to nset[1].numCVs.y do
(
for k in 1 to nset[1].numCVs.x do
(

newPoint = point size:20 cross:false box:true wirecolor:blue
newPoint.pos = (getCV nSet[1] i k).pos

)
)


This seems to work for surfaces that don't have closed rows or columns, but as soon as I close the rows, I get this error -

-- Runtime error: NURBSSet object index out of bounds: 1

In the help, it says CV indexes are 1-based. What does that mean? Is there another way to get the CV position?

Pjanssen
10-17-2008, 06:30 AM
Try:

for i = 1 to nset[1].numCVs.y do


Also, are you sure that numCVs is a two dimensional array? And not just an integer?

CGTalk Moderation
10-17-2008, 06:30 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.