RE: Python for loops on objects

Date : Fri, 13 Apr 2007 17:45:45 +0100
To : <XSI(at)Softimage.COM>
From : "Kim Aldis" <XSI(at)kim-aldis.co.uk>
Subject : RE: Python for loops on objects
It's misleading. Putting a logmessage of oCls in the loop prints a sensible
name. it's only when you try and access any properties that it kicks you
out. If you haven't checked it thoroughly you may want to. 

> -----Original Message-----
> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On
> Behalf Of Bernard Lebel
> Sent: 13 April 2007 15:16
> To: XSI(at)Softimage.COM
> Subject: Re: Python for loops on objects
> 
> No problem at all here.
> Note that I'm using XSI 5.11, so my pywin32 is hacked......
> 
> Cheers
> Bernard
> 
> 
> 
> 
> On 4/13/07, Kim Aldis <XSI(at)kim-aldis.co.uk> wrote:
> > Has anyone noticed this seems to give you an object in oCls but you
> can't
> > actually get any of its properties :-
> >
> > for oCls in oClusters :
> >         if ( oCls.type == constants.siSampledPointCluster ):
> >                 oCluster = oCls
> >                 break
> >
> > t = oCls.Elements # ERROR!
> >
> >
> > But this works just fine:-
> >
> > for i in range( oClusters.count ) :
> >         oCls = oClusters(i)
> >         if ( oCls.type == constants.siSampledPointCluster ):
> >                 oCluster = oCls
> >                 break
> >
> > t = oCls.Elements # Works
> >
> > www.kim-aldis.co.uk   |   kim(at)kim-aldis.co.uk
> >
> >
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> body:
> > unsubscribe xsi
> >
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> body:
> unsubscribe xsi

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.