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