Re: Scripting : Little object question.

Date : Wed, 14 Jun 2006 07:59:38 -0400
To : XSI(at)Softimage.COM
From : "Bernard Lebel" <3dbernard(at)gmail.com>
Subject : Re: Scripting : Little object question.
Why is it breaking *at that point* I have no idea, but binding the
parameters to a name does the trick:


var oPanel = ActiveSceneRoot.AddGeometry("Grid","MeshSurface", "Panel" ); //create a polymesh grid var oU = oPanel.Parameters('subdivu'); var oV = oPanel.Parameters('subdivv');

oPanel.rotx = 90; //Rotate the grid
ResetTransform(oPanel, siCtr, siRot, siXYZ); //freeze rotation
oPanel.properties('visibility').rendvis.Value = 0;//Hide in render

oU.Value = 2; //set the U grid subdivision
oV.Value = 2; //set the V grid subdivision



On 6/14/06, guillaume laforge <guillaume.laforge.3d(at)gmail.com> wrote:
Hi list,

 I've got a strange error in a script. Not a big problem but I would like to
understand better XSI/Jscript behaviour.

 If I run those lines in this order it works fine :

 var oPanel = ActiveSceneRoot.AddGeometry("Grid","MeshSurface", "Panel" );
//create a polymesh grid
 oPanel.Parameters('subdivu').Value = 2; //set the U grid subdivision
 oPanel.Parameters('subdivv').Value = 2; //set the V grid subdivision

 oPanel.rotx = 90; //Rotate the grid
 ResetTransform(oPanel, siCtr, siRot, siXYZ); //freeze rotation
 oPanel.properties('visibility').rendvis.Value = 0;//Hide in render

 But if I change the order like bellow it throw an error at the last line (
null value or not an object ) :

 var oPanel = ActiveSceneRoot.AddGeometry("Grid","MeshSurface", "Panel" );
//create a polymesh grid
 oPanel.rotx = 90; //Rotate the grid
 ResetTransform(oPanel, siCtr, siRot, siXYZ); //freeze rotation
 oPanel.properties('visibility').rendvis.Value = 0;//Hide in render

 oPanel.Parameters('subdivu').Value = 2; //set the U grid subdivision
 oPanel.Parameters('subdivv').Value = 2; //set the V grid subdivision

 It looks like oPanel instance object is not updated. Is it the standard
behaviour ?

 Cheers,


-- Guillaume Laforge freelance TD | cg Artist
---
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.