Are you sure a_nodes and a_VC are of the same size?
On Thu, Sep 27, 2012 at 5:09 PM, Szabolcs Matefy <szabol...@crytek.com>wrote: > Hi,**** > > ** ** > > I still have issues with this PaintVertexColors command**** > > ** ** > > When I run my script, it gives an error:**** > > ** ** > > # ERROR : 2006-PROP-PaintVertexColors - Unexpected failure.**** > > # ERROR : Traceback (most recent call last):**** > > # File "<Script Block >", line 46, in <module>**** > > # Application.PaintVertexColors(OBJ.fullname, a_nodes, a_VC, 1)**** > > # File "<COMObject Application>", line 2, in PaintVertexColors**** > > # COM Error: Out of present range. (0x-7ffdfff6) - [line 46]**** > > ** ** > > ** ** > > Anyone with any idea?**** > > ** ** > > *From:* softimage-boun...@listproc.autodesk.com [mailto: > softimage-boun...@listproc.autodesk.com] *On Behalf Of *Szabolcs Matefy > *Sent:* Wednesday, September 26, 2012 1:43 PM > *To:* softimage@listproc.autodesk.com > *Subject:* RE: Python and xsi commands**** > > ** ** > > Thanks Eric, I’ll try it!**** > > ** ** > > *From:* softimage-boun...@listproc.autodesk.com > [mailto:softimage-boun...@listproc.autodesk.com] *On Behalf Of *Eric > Thivierge > *Sent:* Wednesday, September 26, 2012 12:17 PM > *To:* softimage@listproc.autodesk.com > *Subject:* Re: Python and xsi commands**** > > ** ** > > This code works for me. Make sure you have a CAV map on the object. I used > a default polymesh sphere. It's a generic code to set the colors for > Polynodes 0-99 to red (-16777216).**** > > ** ** > > # Python**** > > xsi = Application**** > > log = xsi.LogMessage**** > > collSel = xsi.Selection**** > > ** ** > > xsi.PaintVertexColors(collSel(0), [x for x in range(100)], [-16777216 for > x in range(100)], 1)**** > > ** ** > > In general Python lists are interpreted as arrays where needed.**** > > > -------------------------------------------- > Eric Thivierge > http://www.ethivierge.com**** > > On Wed, Sep 26, 2012 at 6:44 PM, Szabolcs Matefy <szabol...@crytek.com> > wrote:**** > > Hey guys,**** > > **** > > **** > > Can I add python list as array? I mean that PaintVertexColors command > waits for arrays, but can I feed list?**** > > **** > > Anyway, it throws me an error:**** > > **** > > # ERROR : Traceback (most recent call last):**** > > # File "<Script Block >", line 41, in <module>**** > > # Application.PaintVertexColors(OBJ.fullname, a_nodes, a_VC)**** > > # File "<COMObject Application>", line 2, in PaintVertexColors**** > > # COM Error: Out of present range. (0x-7ffdfff6) - [line 41]**** > > **** > > I made a script that reads ZBrush polypainted obj, and I wnt to make a > python version to test which version is faster**** > > **** > > **** > > Cheers**** > > **** > > **** > > Szabolcs**** > > ___ > This message contains confidential information and is intended only for > the individual named. If you are not the named addressee you should not > disseminate, distribute or copy this e-mail. Please notify the sender > immediately by e-mail if you have received this e-mail by mistake and > delete this e-mail from your system. E-mail transmission cannot be > guaranteed to be secure or error-free as information could be intercepted, > corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. > The sender therefore does not accept liability for any errors or omissions > in the contents of this message, which arise as a result of e-mail > transmission. If verification is required please request a hard-copy > version. Crytek GmbH - http://www.crytek.com - Grüneburgweg 16-18, 60322 > Frankfurt - HRB77322 Amtsgericht Frankfurt a. Main- UST IdentNr.: > DE20432461 - Geschaeftsfuehrer: Avni Yerli, Cevat Yerli, Faruk Yerli**** > > ** ** > -- Xavier