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