You might need to add :2 to your slicing

> for a, b in zip( vertList1[:-1:2], vertList1[1::2] ):

dado


On Apr 30, 3:00 pm, Keir <[email protected]> wrote:
> I also don't quite understand the problem you are trying to solve. I
> feel that you may be making it more complicated than it needs to be.
> But in any case the following is a way of looping a pair of values
> from a list using list slicing and zip.
>
> for a, b in zip( vertList1[:-1], vertList1[1:] ):
>     for point in vertList2:
>         doTest()
>
> Keir
>
> On May 1, 8:51 am, "Ofer Koren" <[email protected]> wrote:
>
>
>
> > what do you mean "x/y values for pSphere1 faces"? where is the 'z'
> > coordinate? is that for the center of the face or each of the vertices of
> > that face?
>
> > maybe you could state the context of this problem?
>
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Jon Mills
> > Sent: Friday, April 30, 2010 3:31 AM
> > To: [email protected]
> > Subject: Re: [Maya-Python] repeat code?
>
> > vertList1 is the y values of pSphere1 faces
> > vertList2 is the x values of pSphere1 faces
>
> > ok im trying to match up faces which have the same vertices,
> > so say from a sphere pSphere1[0], y1, y2 and pSphere1[20], x1, x2 are the
> > same verts
>
> > then using the dot product of pSphere1[0] and pSphere1[20]
> > ill be finding the difference pSphere1[0] - pSphere1[20]
>
> > hope this helps
>
> > --http://groups.google.com/group/python_inside_maya
>
> > --http://groups.google.com/group/python_inside_maya
>
> --http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to