How to make a pause in a script ?

Date : Sat, 23 Jul 2005 00:06:34 +0200
To : XSI(at)Softimage.COM
From : guillaume laforge <guillaume.laforge.3d(at)gmail.com>
Subject : How to make a pause in a script ?
Hi,
 
I'm writing a script who save .ptp files somewhere. I would like to use a variable for
the .ptp path. I find "FolderPicker" in the doc who create a CPset with a path.
 
If the custom parameter already exist in the scene, there is no pb.
"oPSet.parameters("FolderPicker").Value"  give me the path the user choose before.
 
But if there is no custom parameter in the scene, it is create and then "oPSet.parameters("FolderPicker").Value" return nothing.
The user is not faster than the script and can't set the path before the logmessage :-p.
 
Here is the code :
 
var oPSet = ActiveSceneRoot.Properties(("ptp_path"));
if (!oPSet)
{
   //layout for selecting a folder where .ptp are saved.
   var oPSet=ActiveSceneRoot.AddProperty ("CustomProperty",false,"ptp_path") ;
   oPSet.AddParameter3( "FolderPicker", siString ) ;
   var oPPGLayout = oPSet.PPGLayout ;
   var oItem = oPPGLayout.AddItem( "FolderPicker", "", "Folder" );
   oItem.SetAttribute( siUIInitialDir, "user" ) ;


   //Open the CustomPset to choose a path.
   //I can't "stop" the script during the user interaction...
   InspectObj( oPSet );

   //I would like to find the path now.
   logmessage(oPSet.parameters ("FolderPicker").value)
}
else
{
   //But I only find the path when the CustomPset already exist before the script.
   logmessage(oPSet.parameters("FolderPicker").Value)
}

Help !

Thanks,

Guillaume Laforge
CG artist / Jr TD
Antefilms studio

 

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.