[scripting - python] - GridData - SetCell Error

Date : Sun, 18 May 2008 01:30:22 +0200
To : <XSI(at)Softimage.COM>
From : "Cornelius Porzig" <xsilist(at)connimation.de>
Subject : [scripting - python] - GridData - SetCell Error

Hi all,

I have created a custom property with the custom property wizard with a Grid(Data) parameter. Now I want to set the rows and columns and initialize the values. This is my code (excerpt) I try to use  in the script:

 

for i in range(oShotGrid.RowCount):

                               xsiPrint(oValidNodes[i].Film.Value)                                      #value = “TestFilm”

                               oShotGrid.SetRowLabel(i, oValidNodes[i].Name)

                               oShotGrid.SetCell(0,i, oValidNodes[i].Film.Value)

                               oShotGrid.SetCell(1,i, oValidNodes[i].Shot.Value)

                               oShotGrid.SetCell(2,i, oValidNodes[i].Camera.Value)

                               oShotGrid.SetCell(3,i, oValidNodes[i].Startframe.Value)

                               oShotGrid.SetCell(4,i, oValidNodes[i].Endframe.Value)

 

 

However when I open the property page for it, I get the following error(s):

 

# INFO : TestFilm

# ERROR : 2028 - Traceback (most recent call last):

#   File "<Script Block >", line 189, in CP_Render_Dialog_OnInit

#     oShotGrid.SetCell(0,i, oValidNodes[i].Film.Value)

#   File "<COMObject <unknown>>", line 3, in SetCell

# COM Error: Invalid argument specified. - [line 188 in C:\users\Conni\Softimage\XSI_6.5\Application\Plugins\CP_Render_Dialog.py]

# ERROR : Property Page Script Logic Error (Python ActiveX Scripting Engine)

# ERROR :    [186]             for i in range(oShotGrid.RowCount):

# ERROR :    [187]                             xsiPrint(oValidNodes[i].Film.Value)

# ERROR :   >[188]                           oShotGrid.SetRowLabel(i, oValidNodes[i].Name)

# ERROR :    [189]                             oShotGrid.SetCell(0,i, oValidNodes[i].Film.Value)

# ERROR :    [190]                             oShotGrid.SetCell(1,i, oValidNodes[i].Shot.Value)

# ERROR :    [191]                             oShotGrid.SetCell(2,i, oValidNodes[i].Camera.Value)

# ERROR : 2028 -              Traceback (most recent call last):

#   File "<Script Block >", line 189, in CP_Render_Dialog_OnInit

#     oShotGrid.SetCell(0,i, oValidNodes[i].Film.Value)

#   File "<COMObject <unknown>>", line 3, in SetCell

# COM Error: Invalid argument specified.

 

The RowLabel is set correctly on the property page, however the first field is empty. (The other fields are not displayed.) The values, I try to set, are strings. I also tried Integers or Boolean values but I always get this error. The SDK documentation writes, that the CellValue type is  “Variant”  and the win32com module has to be linked.  I import it at the beginning of the script with:

 

import win32com.client

from win32com.client import constants

 

At the moment I don’t know any further and googling my problem revealed no clues. Any ideas, what I am doing wrong?

Kind regards and thanks in advance,

 

Cornelius


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.