RE: Help with Python

Date : Wed, 1 Nov 2006 16:02:38 -0500
To : <XSI(at)Softimage.COM>
From : "Andre DeAngelis" <andre.deangelis(at)ubisoft.com>
Subject : RE: Help with Python
Thanks Bernard.

-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf
Of Bernard Lebel
Sent: November 1, 2006 3:51 PM
To: XSI(at)Softimage.COM
Subject: Re: Help with Python

Iterating over empty sequence should not raise an error.

I checked the doc and ShapeAnimatedClusters is a method. You forgot to
put (). So you did not get a sequence.

Cheers
Bernard



On 11/1/06, Steven Caron <carons(at)gmail.com> wrote:
> well the error suggests "clusters" isn't a sequence or has no length.
test
> "clusters" count and test its return value's type
>
> steven
>
>
> On 11/1/06, Andre DeAngelis <andre.deangelis(at)ubisoft.com> wrote:
> > Hi guys,
> >
> > Does anyone know of a Python equivalent of the typof function in
> > jscript?
> >
> > I am having some trouble converting a vbscript to Python so any help
> > would be grand.
> >
> > Here is the working VBscript version.
> >
> > set oObj = selection(0)
> > set clusters = oObj.ShapeAnimatedClusters
> > for each cls in clusters
> >    LogMessage cls.name
> > Next
> >
> > I tried to convert this to Python with this:
> >
> > oObj = Application.selection(0)
> > clusters = oObj.ShapeAnimatedClusters
> > for cls in clusters:
> >    Application.LogMessage (cls.name)
> >
> > When I run this, I get the following error:
> >
> > #TypeError: iteration over non-sequence
> >
> > No doubt this is a very trivial error.
> >
> > Any ideas?
> >
> > ---
> > 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.